3

I have two iSCSI target servers. The iSCSI Initiator is an Ubuntu host (Ubuntu 14.04). I am using Ubuntu's open-iscsi to mount the iSCSI targets from both iSCSI targets servers to my Initiator.

The problem is that the symlinks in /dev/disk/by-id are "overwritten".

When I do the iscsiadm discovery and the iscsiadm -m node -l command to the first iSCSI target server, the targets are mounted and there are symlinks under /dev/disk/by-id.

For example, doing an ls -l /dev/disk/by-id after logging in to the first iSCSI target server might show the following:

scsi-3600000e00010001 -> ../../sdc
scsi-3600000e00010002 -> ../../sdd
scsi-3600000e00010003 -> ../../sde
wwn-0x60000e00010001 -> ../../sdc
wwn-0x60000e00010002 -> ../../sdd
wwn-0x60000e00010003 -> ../../sde

After doing a discovery and a login to the 2nd iSCSI target server (without logging out of the iSCSI target server), doing an ls -l /dev/disk/by-id shows something like this:

scsi-3600000e00010001 -> ../../sdaa
scsi-3600000e00010002 -> ../../sdab
scsi-3600000e00010003 -> ../../sdac
wwn-0x60000e00010001 -> ../../sdaa
wwn-0x60000e00010002 -> ../../sdab
wwn-0x60000e00010003 -> ../../sdac

1) I checked that all the iSCSI targets are mounted on the Ubuntu initiator by issuing an fdisk -l command. The iSCSI targets are all mounted.

2) But the symlinks point to targets from the 2nd server now. It looks like the symlinks to the targets from the 1st server were overwritten by symlinks to the 2nd server.

Is it possible to have all the iSCSI targets, from both iSCSI target servers, have separate symlinks and be listed under /dev/disk/by-id?

I am not an iSCSI expert so I thought I'd ask. I Googled this problem and searched for relevant tags here but I didn't see any answers. Maybe I am not configuring something correctly?

A workaround would be for me to write a script that ccreates individual, unique symlinks for all the iSCSI targets but I'd first like to see if I am misconfiguring something.

SQA777
  • 151
  • 6

2 Answers2

1

You need to specify VPD (Vital Product Data) for your iSCSI target LUNs. This involves specifying manufacturer IDs and serial numbers for each LUN you add, and is controlled entirely on the target side.

However, you haven't specified what server you are using, and this process is wildly different from target server to server. If you let me know what your target server is, I can update this to be more specific. Otherwise, it stands as a fairly general recommendation.

Spooler
  • 7,016
  • 16
  • 29
  • SmallLoanOf1M, The server is a Dell 730. The iSCSI targets were set up using Ubuntu's iSCSI software along with iSER, which is the SW for use with Infiniband cards. The initiators and targets connect via Infiniband connections, not Ethernet connections. How can I get VPD set up on my iSCSI targets? – SQA777 Oct 01 '16 at 17:59
1

I found the answer to this.

For iSCSI targets that are on an Ubuntu, you have to edit the target's configuration file at: /etc/tgt/conf.d/1.conf

In the file 1.conf, the configuration information is stored in an HTML format.

For each iSCSI target, you need to specify a "scsi_id" value for each iSCSI target

Before:

`<`target iqn.2001-04.com.hostname-tgt-1`>`
    direct-store /dev/disk/by-id/wwn-0x500258aaa
    direct-store /dev/disk/by-id/wwn-0x500258aab
    direct-store /dev/disk/by-id/wwn-0x500258aac
    direct-store /dev/disk/by-id/wwn-0x500258aad
    initiator-address 10.10.10.21
    initiator-address 10.10.10.22
    initiator-address 10.10.10.23
    initiator-address 10.10.10.24        
    initiator-address 10.10.10.25
    initiator-address 10.10.10.26
`<`/target`>`

After:

`<`target iqn.2001-04.com.hostname-tgt-1:target-001`>`
    scsi_id 500258aaa
    direct-store /dev/disk/by-id/wwn-0x500258aaa
    initiator-address 10.10.10.21
    initiator-address 10.10.10.22
    initiator-address 10.10.10.23
    initiator-address 10.10.10.24        
    initiator-address 10.10.10.25
    initiator-address 10.10.10.26
`<`/target`>`

`<`target iqn.2001-04.com.hostname-tgt-1:target-002`>`
    scsi_id 500258aab
    direct-store /dev/disk/by-id/wwn-0x500258aab
    initiator-address 10.10.10.21
    initiator-address 10.10.10.22
    initiator-address 10.10.10.23
    initiator-address 10.10.10.24        
    initiator-address 10.10.10.25
    initiator-address 10.10.10.26
`<`/target`>`

`<`target iqn.2001-04.com.hostname-tgt-1:target-003`>`
    scsi_id 500258aac
    direct-store /dev/disk/by-id/wwn-0x500258aac
    initiator-address 10.10.10.21
    initiator-address 10.10.10.22
    initiator-address 10.10.10.23
    initiator-address 10.10.10.24        
    initiator-address 10.10.10.25
    initiator-address 10.10.10.26
`<`/target`>`

`<`target iqn.2001-04.com.hostname-tgt-1:target-004`>`
    scsi_id 500258aad
    direct-store /dev/disk/by-id/wwn-0x500258aad
    initiator-address 10.10.10.21
    initiator-address 10.10.10.22
    initiator-address 10.10.10.23
    initiator-address 10.10.10.24        
    initiator-address 10.10.10.25
    initiator-address 10.10.10.26
`<`/target`>`

When you mount the iSCSI targets from both iSCSI servers, the symlinks under /dev/disk/by-id will be unique for every iSCSI target.

NOTE: I used backticks ("`") in front of the < or > characters because this website's editor was not displaying them correctly. Don't use backticks when you edit your 1.tgt file.

SQA777
  • 151
  • 6