I have a RHEL system set up as an iSCSI target with 2 luns shared out via one target via the following configuration in /etc/tgt/targets.conf (which I built following the commented out examples in /etc/tgt/targets.conf):
<target iqn.2014-04.com.local.box:ESXi.target1>
backing-store /dev/ESXi_VG/ESXi_LUN_01 #LUN01
backing-store /dev/ESXi_VG/TEST_LUN_01 #LUN02
</target>
These are intended to be shared out to a pair of ESXi hosts as a Datastore.
I originally created a single 4.00 TB LVM logical volume on the vg ESXi_VG for the datastore; however I realized I'd need a second LUN for Iops testing via RDM to a vm stored on local storage on the ESXi host. To that end I created a second 5.00 GB LVM logical volume on the same volume group and added the LUN entry for the second LUN in the target configuration I showed above. I then unmounted the 4.00 Tb LUN on my ESXi host, and restarted tgtd.
I'm seeing some weird stuff now. First, Here is the output from a tgt-admin -s command to show current LUNs:
[root@box ~]# tgt-admin -s
Target 1: iqn.2014-04.com.local.box:ESXi.target1
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: null
Backing store path: None
Backing store flags:
LUN: 1
Type: disk
SCSI ID: IET 00010001
SCSI SN: beaf11
Size: 5369 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/ESXi_VG/TEST_LUN_01
Backing store flags:
Account information:
ACL information:
ALL
As you can see, only 1 LUN is displaying, not 2 - and the LUN that is displaying is only the 5.00 GB LUN that I added at a later date. If I remove or comment out the LUN entry it only shows LUN 0, the controller, and not LUN 1.
However, ESXi can see the 4.00 TB LUN still and can mount it, format it, etc. what it can't see is the 5.00 GB partition, despite it being shared out via the same iSCSI target.
I have a couple questions as a result:
Does tgt-admin only show LUNs not currently connected to an initiator? If not why is my 4.00 TB datastore no longer showing?
How can I get the 2nd LUN to appear to ESXi so I can mount it to a VM via RDM for iops testing?