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.

--

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