iscsiadm
List visible iscsi nodes:
iscsiadm -m node -o show
List current iscsi sessions:
iscsiadm -m session -o show
Verbose list current iscsi sessions:
iscsiadm -m session -P3
Login session
iscsiadm -m node --login
Logout session
iscsiadm -m node --logout
Disable an iSCSI target:
iscsiadm --m node -T iqn.2007-06.com.test.cluster1:storage.cluster1 --portal 172.16.48.175:3260 -u
Delete an iSCSI target:
iscsiadm --m node -T iqn.2007-06.com.test.cluster1:storage.cluster1 --portal 172.16.48.175:3260 -u
Rescan an iSCSI target (e.g. you increased size of the LUN):
iscsiadm -m node -T iqn.2007-06.com.test.cluster1:storage.cluster1 -R
Prepare to move your Volume Group to another Host
Use lsof to determine that no processes are using the disk:
lsof | grep compaction
Umount the Drive
umount /srv/compaction
Mark the volume group inactive:
vgchange -an vg_mosura
Export the volume group
vgexport vg_mosura
Unmounting ISCSI Devices
Identify your mounted drive:
% iscsiadm -m session tcp: [1] 192.168.50.37:3260,1 iqn.1992-05.com.emc:apm001414067230000-1-vnxe
At this point you could logout of the node:
iscsiadm -m node --targetname iqn.1992-05.com.emc:apm001414067230000-1-vnxe --logout iscsiadm -m node --targetname iqn.1992-05.com.emc:apm001414067230000-2-vnxe --logout
Turn off iscsi discovery
iscsiadm -m discovery --portal 192.168.50.38 --op=delete iscsiadm -m discovery --portal 192.168.50.37 --op=delete
Finally, on mosura, set noaccess to the devices during reinstallation. We don't want the kickstart to find them and erase them.
Mounting the iSCSI Devices
If you need to make a new trust on mosura, your iqn is here:
cat /etc/iscsi/initiatorname.iscsi
On mosura' management console, make them visible to the host
iscsiadm -m discovery --portal 192.168.50.37 -t st iscsiadm -m discovery --portal 192.168.50.38 -t st
Check that you found your node
iscsiadm -m node
Login to your node
iscsiadm -m node --targetname iqn.1992-05.com.emc:apm001414067230000-1-vnxe --login iscsiadm -m node --targetname iqn.1992-05.com.emc:apm001414067230000-2-vnxe --login
Confirm your session and check available disks:
iscsiadm -m session -P3
Import the Volume Group for Mount
Import
pvscan
Import the Voluem Group
vgimport vg_mosura
Activate the voume group:
vgchange -ay vg_mosura
Mount Your Volume Group
mkdir -p /srv/compaction mount /dev/vg_mosura/compaction /srv/compaction