Help iSCSI initiator commands for linux.
I’ve been doing a lot of work lately with Red Hat Enterprise Virtualization. The hosts that I am using are currently connecting to the SAN using iSCSI. However, in the future they will be connecting with Fiber Channel instead.
I find myself having to remember how to use the iSCSI initiator a lot. Here are some quick notes on how to do the most common tasks.
Discover available targets from a discovery portal
iscsiadm -m discovery -t sendtargets -p ipaddress
Log into a specific target
iscsiadm -m node -T targetname -p ipaddress -l
Log out of a specific target
iscsiadm -m node -T targetname -p ipaddress -uDisplay information about a target
iscsiadm -m node -T targetname -p ipaddressDisplay statistics about a target
iscsiadm -m node -s -T targetname -p ipaddressRemove the portal address to receive information or statistics about all targets.
Display list of all current sessions logged in
iscsiadm -m sessionView iSCSI database regarding discovery
iscsiadm -m discovery -o showView iSCSI database regarding targets to log into
iscsiadm -m node -o showView iSCSI database regarding sessions logged into
iscsiadm -m session -o showView if the targets are multipathed (MPIO)
multipath -llIf it is multipathed, you will see output like below (this is an example of two LUNs, both multipathed). Note that this show the MPIO mode is round-robin:
36000d77100000b117de986015d5d5746 dm-7 FALCON,IPSTOR DISK [size=20G][features=0][hwhandler=0][rw] \_ round-robin 0 [prio=0][active] \_ 12:0:0:0 sdb 8:16 [active][ready] \_ 13:0:0:0 sdd 8:48 [active][ready] 36000d771000002767de9860330139e10 dm-8 FALCON,IPSTOR DISK [size=200G][features=0][hwhandler=0][rw] \_ round-robin 0 [prio=0][active] \_ 12:0:0:1 sdc 8:32 [active][ready] \_ 13:0:0:1 sde 8:64 [active][ready] Here is a very helpful article that covers similar commands, etc. http://kbase.redhat.com/faq/docs/DOC-6388
Rob Kinney said,
May 28, 2010 at 11:07 am
Quite useful! Thanks.
tty0 said,
April 8, 2013 at 7:19 am
Thanks!
Linux iSCSI multipath on NetApp said,
November 4, 2013 at 11:36 am
[…] iSCSI I found this site that explains the iscsiadm commands nicely. I do not want to take credit for this, I just want to […]
Linux iSCSI Multipath on NetApp | ChainRingCircus said,
December 30, 2016 at 11:47 am
[…] iSCSI I found this site that explains the iscsiadm commands nicely. I do not want to take credit for this, I just want to […]