Differences

This shows you the differences between two versions of the page.

Link to this comparison view

saisp:labs:06:contents:06 [2014/03/29 23:16]
mihai.carabas [06. Restricționarea accesului la dispozitivile logice (LUN)]
saisp:labs:06:contents:06 [2014/03/30 00:26] (current)
mihai.carabas [06. LIO backstore as a physical block device]
Line 1: Line 1:
-==== 06. LIO backstore as a physical block device ====+==== 06. [20p] LIO backstore as a physical block device ====
  
 Creați un ''​backstore''​ de tip physical device (Hint: ''​iblock''​) folosind discul ''/​dev/​sdb''​ de pe stația ''​storage1''​. Asociați ''​backstore''​-ul creat cu un LUN și montați-l pe stația ''​storage3''​. Nu uitați să mapați IQN-ul stației ''​storage3''​ la noul LUN. Creați un ''​backstore''​ de tip physical device (Hint: ''​iblock''​) folosind discul ''/​dev/​sdb''​ de pe stația ''​storage1''​. Asociați ''​backstore''​-ul creat cu un LUN și montați-l pe stația ''​storage3''​. Nu uitați să mapați IQN-ul stației ''​storage3''​ la noul LUN.
  
-<note warning>​Implicit,​ clientul creat de voi va avea acces la ambele ​LUN-uri si vor apărea ca /dev/sdd și /dev/sd3Voi lucrați doar pe /dev/sde.</​note>​+<note warning>​Implicit,​ clientul creat de voi va avea acces la toate LUN-urilePermiteți accesul ​doar pentru ''​LUN 2''​. Eliminați de asemenea ''​LUN 2''​ de la IQN-ul stației ''​storage2''​.</​note>​
  
 <​solution -hidden> <​solution -hidden>
-<​code>​+<​code ​bash>
 root@storage1:​~#​ targetcli root@storage1:​~#​ targetcli
 /> cd backstores/​iblock /> cd backstores/​iblock
Line 13: Line 13:
 Created iblock storage object sdb using /dev/sdb. Created iblock storage object sdb using /dev/sdb.
 /​backstores/​iblock>​ cd /​iscsi/​iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d/​tpgt1/​luns/​ /​backstores/​iblock>​ cd /​iscsi/​iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d/​tpgt1/​luns/​
-/​iscsi/​iqn.20...4d/​tpgt1/​luns>​ create /​backstores/​iblock/​sdb ​lun1 +/​iscsi/​iqn.20...4d/​tpgt1/​luns>​ create /​backstores/​iblock/​sdb ​lun2 
-Successfully created LUN 1+Successfully created LUN 2
-Created mapped LUN in node ACL iqn.2005-03.org.open-iscsi:​fc35d7d3fc24+Created mapped LUN in node ACL iqn.2005-03.org.open-iscsi:​fc35d7d3fc24
 /> saveconfig /> saveconfig
 WARNING: Saving storage1 current configuration to disk will overwrite your boot settings. WARNING: Saving storage1 current configuration to disk will overwrite your boot settings.
Line 31: Line 31:
 /​iscsi/​iqn.20...4d/​tpgt1/​acls>​ create iqn.2005-03.org.open-iscsi:​8ceabce62de9 /​iscsi/​iqn.20...4d/​tpgt1/​acls>​ create iqn.2005-03.org.open-iscsi:​8ceabce62de9
 Successfully created Node ACL for iqn.2005-03.org.open-iscsi:​8ceabce62de9 Successfully created Node ACL for iqn.2005-03.org.open-iscsi:​8ceabce62de9
 +Created mapped LUN 2.
 Created mapped LUN 1. Created mapped LUN 1.
 Created mapped LUN 0. Created mapped LUN 0.
 +/​iscsi/​iqn.20...4d/​tpgt1/​acls>​ cd iqn.2005-03.org.open-iscsi:​8ceabce62de9
 +/​iscsi/​iqn.20...:​8ceabce62de9>​ delete 0
 +Deleted Mapped LUN 0.
 +/​iscsi/​iqn.20...:​8ceabce62de9>​ delete 1
 +Deleted Mapped LUN 1.
 /> saveconfig /> saveconfig
 WARNING: Saving storage1 current configuration to disk will overwrite your boot settings. WARNING: Saving storage1 current configuration to disk will overwrite your boot settings.
Line 40: Line 46:
 root@storage3:​~#​ iscsiadm --mode discovery --type st --portal 192.168.1.1 root@storage3:​~#​ iscsiadm --mode discovery --type st --portal 192.168.1.1
 192.168.1.1:​3260,​1 iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d 192.168.1.1:​3260,​1 iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d
- 
 root@storage3:​~#​ iscsiadm -m node -L all root@storage3:​~#​ iscsiadm -m node -L all
 Logging in to [iface: default, target: iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d,​ portal: 192.168.1.1,​3260] (multiple) Logging in to [iface: default, target: iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d,​ portal: 192.168.1.1,​3260] (multiple)
 Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d,​ portal: 192.168.1.1,​3260] successful. Login to [iface: default, target: iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d,​ portal: 192.168.1.1,​3260] successful.
 +root
 root@storage3:​~#​ iscsiadm -m session root@storage3:​~#​ iscsiadm -m session
 tcp: [1] 192.168.1.1:​3260,​1 iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d (non-flash) tcp: [1] 192.168.1.1:​3260,​1 iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d (non-flash)
  
-root@storage3:​~# ​iscsiadm ​-m session -P 1 +root@storage3:​~# ​dmesg |tail -10 
-Targetiqn.2003-01.org.linux-iscsi.storage1.x8664:sn.25e09e86bb4d (non-flash+[24607.849541] scsi3 iSCSI Initiator over TCP/IP 
-        ​Current Portal: 192.168.1.1:3260,1 +[24608.105052] scsi 3:0:0:2: Direct-Access ​    LIO-ORG  IBLOCK ​          4.0  PQ: 0 ANSI: 5 
-        Persistent Portal192.168.1.1:3260,1 +[24608.105819] sd 3:0:0:2: Attached scsi generic sg3 type 0 
-                ********** +[24608.107245] sd 3:0:0:2: [sdd] 204800 512-byte logical blocks: (104 MB/100 MiB
-                Interface+[24608.110439] sd 3:0:0:2[sdd] Write Protect is off 
-                ​********** +[24608.110442] sd 3:0:0:2[sdd] Mode Sense: 43 00 00 08 
-                Iface Namedefault +[24608.111382] sd 3:0:0:2[sdd] Write cache: disabled, read cache: enabled, doesn'​t support DPO or FUA 
-                Iface Transporttcp +[24608.120119] ​ sddunknown partition table 
-                Iface Initiatornameiqn.2005-03.org.open-iscsi:8ceabce62de9 +[24608.124463] sd 3:0:0:2: [sdd] Attached SCSI disk 
-                Iface IPaddress: 192.168.1.3 +[24615.904190] nfs: server storage1 not responding, timed out
-                Iface HWaddress<​empty>​ +
-                Iface Netdev<​empty>​ +
-                SID+
-                iSCSI Connection StateLOGGED IN +
-                iSCSI Session StateLOGGED_IN +
-                ​Internal iscsid Session StateNO CHANGE +
-                ​ +
 </​code>​ </​code>​
 </​solution>​ </​solution>​
  
saisp/labs/06/contents/06.1396127775.txt.gz · Last modified: 2014/03/29 23:16 by mihai.carabas
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0