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:15]
mihai.carabas [06. Lorem ipsum]
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. Restricționarea accesului la dispozitivile logice (LUN) ====+==== 06. [20p] LIO backstore as a physical block device ​====
  
-Vom mai crea un nou ''​LUN'' ​ce are ca ''​backstore'' ​tot un fișier:<​code>​ +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. 
-/​backstores/​fileio> create ​disk2 /disk2.img 100M+ 
 +<note warning>​Implicit,​ clientul creat de voi va avea acces la toate LUN-urile. Permiteți accesul doar pentru ''​LUN 2''​. Eliminați de asemenea ''​LUN 2''​ de la IQN-ul stației ''​storage2''​.</​note>​ 
 + 
 +<​solution -hidden>​ 
 +<​code ​bash> 
 +root@storage1:​~#​ targetcli 
 +/> cd backstores/iblock 
 +/​backstores/​iblock> create ​sdb /dev/sdb
 Generating a wwn serial. Generating a wwn serial.
-Not using buffered mode. +Created ​iblock storage object sdb using /dev/sdb
-Created ​fileio disk2+/​backstores/​iblock> cd /​iscsi/​iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d/​tpgt1/​luns/​ 
-/​backstores/​fileio> cd /​iscsi/​iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d/​tpgt1/​luns/​ +/​iscsi/​iqn.20...4d/​tpgt1/​luns> ​create /​backstores/​iblock/​sdb lun2 
-/​iscsi/​iqn.20...4d/​tpgt1/​luns>​ +Successfully created LUN 2. 
-</code>+Created mapped LUN 2 in node ACL iqn.2005-03.org.open-iscsi:​fc35d7d3fc24 
 +/> saveconfig 
 +WARNING: Saving storage1 current configuration to disk will overwrite your boot settings. 
 +The current target configuration will become the default boot config. 
 +Are you sure? Type '​yes':​ yes
  
-Vom mai crea încă un ''​LUN''​ asociat backstore-ului ''​disk2.img''​:<​code>​ + 
-/iscsi/iqn.20...4d/tpgt1/luns> create ​/backstores/​fileio/​disk2 lun1 +root@storage3:~# apt-get install open-iscsi 
-Successfully created LUN 1+root@storage3:​~# ​iscsi-iname 
-Created mapped LUN 1 in node ACL iqn.2005-03.org.open-iscsi:​fc35d7d3fc24 +iqn.2005-03.org.open-iscsi:​8ceabce62de9 
-</code> +root@storage3:​~#​ cat /etc/iscsi/initiatorname.iscsi 
-Observați că în mod implicit acesta s-a adăugat automat pentru clientul ''​storage2''​ (la IQN-ul acestuia)Dorim să scoatem această mapare:<​code>​ +InitiatorName=iqn.2005-03.org.open-iscsi:​8ceabce62de9 
-/​iscsi/​iqn.20...4d/​tpgt1/​lunscd ../acls/iqn.2005-03.org.open-iscsi:​fc35d7d3fc24 + 
-/​iscsi/​iqn.20...:​fc35d7d3fc24ls +/> cd /​iscsi/​iqn.2003-01.org.linux-iscsi.storage1.x8664:sn.25e09e86bb4d/​tpgt1/​acls/​ 
-o- iqn.2005-03.org.open-iscsi:​fc35d7d3fc24 ........................................... [2 Mapped LUNs] +/​iscsi/​iqn.20...4d/​tpgt1/​aclscreate iqn.2005-03.org.open-iscsi:​8ceabce62de9 
-  o- mapped_lun0 ​......................................................................... [lun0 (rw)] +Successfully created Node ACL for iqn.2005-03.org.open-iscsi:​8ceabce62de9 
-  o- mapped_lun1 ........................................................................[lun1 (rw)] +Created mapped LUN 2. 
-/​iscsi/​iqn.20...:​fc35d7d3fc24> delete 1+Created mapped LUN 1. 
 +Created mapped LUN 0. 
 +/​iscsi/​iqn.20...4d/​tpgt1/​aclscd 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. Deleted Mapped LUN 1.
 +/> saveconfig
 +WARNING: Saving storage1 current configuration to disk will overwrite your boot settings.
 +The current target configuration will become the default boot config.
 +Are you sure? Type '​yes':​ yes
 +
 +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
 +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)
 +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
 +tcp: [1] 192.168.1.1:​3260,​1 iqn.2003-01.org.linux-iscsi.storage1.x8664:​sn.25e09e86bb4d (non-flash)
 +
 +root@storage3:​~#​ dmesg |tail -10
 +[24607.849541] scsi3 : iSCSI Initiator over TCP/IP
 +[24608.105052] scsi 3:0:0:2: Direct-Access ​    ​LIO-ORG ​ IBLOCK ​          ​4.0 ​ PQ: 0 ANSI: 5
 +[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)
 +[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
 +[24608.111382] sd 3:0:0:2: [sdd] Write cache: disabled, read cache: enabled, doesn'​t support DPO or FUA
 +[24608.120119] ​ sdd: unknown partition table
 +[24608.124463] sd 3:0:0:2: [sdd] Attached SCSI disk
 +[24615.904190] nfs: server storage1 not responding, timed out
 </​code>​ </​code>​
 +</​solution>​
 +
saisp/labs/06/contents/06.1396127719.txt.gz · Last modified: 2014/03/29 23:15 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