On Thu, Nov 19, 2009 at 02:04:32PM -0600, Mike Christie wrote:
>xi qihao wrote:
>> Hi all:
>> 
>> I a newbie of iscsi. Now I use two PC to test software iscsi.
>> My problem is how to fix connect of iscsi target?
>> 
>> The below are the detail:
>> SAN: iscsi target device  ip: 192.168.3.2
>> master: iscsi initiator   ip: 192.168.3.124
>> 
>> 1. configure on SAN
>> 1)install iscsi-target
>> [r...@san ~]# yum -y install  scsi-target-utils
>> 
>> 2)create two files
>> [r...@san ~]# dd if=/dev/zero of=/lun/lun1.img bs=1M count=4096
>> [r...@san ~]# dd if=/dev/zero of=/lun/lun2.img bs=1M count=4096
>> 
>> 3)add the content to  /etc/tgt/targets.conf
>> <target iqn.2009-09.com.test:sa-1:tgtd>
>> backing-store /lun/lun1.img
>> initiator-address 192.168.3.124
>> </target>
>> <target iqn.2009-09.com.test:sa-2:tgtd>
>> backing-store /lun/lun2.img
>> initiator-address 192.168.3.124
>> </target>
>> 
>> 4) restart tgt service
>> [r...@san tgt]# /etc/init.d/tgtd restart
>> 
>> 5) check iscsi target
>> [r...@san tgt]# tgtadm --op show --mode target
>> Target 1: iqn.2009-09.com.test:sa-1:tgtd
>>     System information:
>>         Driver: iscsi
>>         State: ready
>>     I_T nexus information:
>>         I_T nexus: 8
>>             Initiator: iqn.1994-05.com.redhat:155e0ebbe8c
>>             Connection: 0
>>                 IP Address: 192.168.3.124
>>     LUN information:
>>         LUN: 0
>>             Type: controller
>>             SCSI ID: deadbeaf1:0
>>             SCSI SN: beaf10
>>             Size: 0 MB
>>             Online: Yes
>>             Removable media: No
>>             Backing store: No backing store
>>         LUN: 1
>>             Type: disk
>>             SCSI ID: deadbeaf1:1
>>             SCSI SN: beaf11
>>             Size: 4295 MB
>>             Online: Yes
>>             Removable media: No
>>             Backing store: /lun/lun1.img
>>     Account information:
>>     ACL information:
>>         192.168.3.124
>> Target 2: iqn.2009-09.com.test:sa-2:tgtd
>>     System information:
>>         Driver: iscsi
>>         State: ready
>>     I_T nexus information:
>>         I_T nexus: 7
>>             Initiator: iqn.1994-05.com.redhat:155e0ebbe8c
>>             Connection: 0
>>                 IP Address: 192.168.3.124
>>     LUN information:
>>         LUN: 0
>>             Type: controller
>>             SCSI ID: deadbeaf2:0
>>             SCSI SN: beaf20
>>             Size: 0 MB
>>             Online: Yes
>>             Removable media: No
>>             Backing store: No backing store
>>         LUN: 1
>>             Type: disk
>>             SCSI ID: deadbeaf2:1
>>             SCSI SN: beaf21
>>             Size: 4295 MB
>>             Online: Yes
>>             Removable media: No
>>             Backing store: /lun/lun2.img
>>     Account information:
>>     ACL information:
>>         192.168.3.124
>> 
>> 2 configure iscsi initiator on master
>> 1) install 
>> [r...@master ~]# rpm -ql iscsi-initiator-utils
>> 
>> 2) discovery iscsi target
>> [r...@master scsi]# iscsiadm -m discovery -t sendtargets -p 192.168.3.2
>> 192.168.3.2:3260,1 iqn.2009-09.com.test:sa-1:tgtd
>> 192.168.3.2:3260,1 iqn.2009-09.com.test:sa-2:tgtd
>> 
>> 3) check
>> [r...@master scsi]# sfdisk -s
>> /dev/sda:  78150744
>> /dev/sdb:   4194304
>> /dev/sdc:   4194304
>> total: 86539352 blocks
>> 
>> [r...@master scsi]# fdisk -l
>> 
>> Disk /dev/sdb: 4294 MB, 4294967296 bytes
>> Disk /dev/sdc: 4294 MB, 4294967296 bytes
>> 
>> 
>> My problem is how to setup fix connect on master after reboot?
>> ex: lun1.img  /dev/sdb       lun2.img  /dev/sdc
>> if lun1.img does not exist, lun2.img is still /dev/sdc. 
>> How can I configure it? I should set tgt or initiator?
>> 
>
>What distro are you using? If you look in /dev/disk/by-id there should 
>be names that are persistent across reboots.

It is CentOS (2.6.18-128.1.16.el5xen) x86_64

[r...@master ~]# ls -l  /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Nov 20 11:00
scsi-SATA_WDC_WD800BD-22M_WD-WMAM9YU42742 -> ../../sda
lrwxrwxrwx 1 root root 10 Nov 20 11:00
scsi-SATA_WDC_WD800BD-22M_WD-WMAM9YU42742-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov 20 11:00
scsi-SATA_WDC_WD800BD-22M_WD-WMAM9YU42742-part2 -> ../../sda2
lrwxrwxrwx 1 root root  9 Nov 20 11:01 scsi-S_beaf11 -> ../../sdc
lrwxrwxrwx 1 root root 10 Nov 20 11:01 scsi-S_beaf11-part1 -> ../../sdc1
lrwxrwxrwx 1 root root  9 Nov 20 11:01 scsi-S_beaf21 -> ../../sdb

you mean scsi-S_beaf are persistent?


--

You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=.


Reply via email to