If you're adding a new LUN, and your iscsi initiator is already connected, you just have to rescan your iscsi bus for the new LUN:
for i in /sys/class/scsi_host/host*/scan ; do echo - - - > $i ; done
If you're changing the size / geometry of a LUN, you'll also need to rescan the device:
for i in /sys/class/scsi_device/*/device/rescan ; do echo 1 > $i ; done
That works for me. If it does not for you, you can try to rescan the iscsi session:
iscsiadm -m node -R
You should really use UUIDs or WWIDs (when working with multipath) so that you don't have to rely on device names.
To have multiple initiators share a single target, whether over ISCSI, Fibre Channel or other SAN solution, you need a cluster-aware filesystem. VMWare ESXi does this with VMFS. Veritas offers one in Veritas Cluster Suite. Sun offered one back in the day that would cause no end of troubles. Oracle did this with RAC, until they got wise and changed to transaction replication instead of shared block-storage. Microsoft offers NTFS Cluster Shared Volumes, which is a Windows clustered filesystem. I believe Red Hat has one, though I have never played with it.
Clustered filesystems have a lot more nuanced work that stand-alone filesystems, since they have to understand quorum-counting, fencing, dead-peer detection and propagation. If they cannot do these things, a split-brain scenario (each node thinks he has the sole access to the shared resource, and cannot check with the other nodes) would enable you to corrupt all your data, or at least get into an inconsistent (and hard to recover from) state.
Another thing to be aware of: most of these are OS-specific. Obviously VMFS is only ESXi (and I think only if it is connected to VCenter). NTFS CSV is only Windows 2012. Oracle RAC is for database clusters running the Oracle database. I think Veritas is the only application-independant/cross-operating-system solution in the mix.
Veritas Cluster Suite is complex and not cheap. Also, you need to understand service groups, order of bring-up/tear-down and clustering/fencing for it to work well. If you miss the section on distributed locking, contention and forcible lock-breaking (I got pulled into a meeting with other architects just as we were beginning this module), you will regret.
Veritas Cluster Suite creates very tightly-coupled clusters, in which one node can induce symathy-sickness into another node. Symantec (who bought out Veritas recently) has a pair of classes that you should probably attend before taking a cluster based on Vx Cluster Suite into production, since it is both powerful and dangerous (like a car or a chainsaw or a side-arm).
Best Answer
You could use
scsi_id
to send the INQUIRY command to the device to get its identifiers.The following example is based on the old
scsi_id
syntax that is used in RHEL 5.In the new syntax as in RHEL/CentOS 6 the long option format is used.
Here the first digit indicates a NAA identifier (
3
), the second digit indicates the IEEE Registered extended format (6
), next00:60:16
is the 24-bit vendor ID. In this example we have a vendor ID that maps to EMC Corporation's CLARIION OUI. The next 9 digits are the vendor specific id:018202a00
. The remaining 16 digits are the specific naa ID520d 0d1e a99d e111
.This would correspond to 128-bit NAA identifier
naa.6006016018202a00520d0d1ea99de111
The
-g
or--whitelisted
option is needed since by default scsi_id blacklists all devices.