iSCSI and multipath

This is a small description of open-iscsi and multipath on a Debian Linux node. In this example I'm using a Dell powervault md3200i as iSCSI target.

installation of the software

Debian and Ubuntu:

aptitude install open-iscsi open-iscsi-utils multipath-tools

configuration of open-iscsi

First discover the target 192.168.1.1

iscsiadm -m discovery -t st -p 192.168.1.1

Then login (no auth configured):

iscsiadm -m node --targetname "iqn.1984-05.com.dell:powervault.md3200i.12345cb0001234b1000000001ece123e" --portal "192.168.1.1:3260" --login

To rescan the target for LUN changes use the following command instead of restarting open-iscsi because the last command will remove open iSCSI connections (e.g. mounted LUNs)

iscsiadm -m node --targetname "iqn.1984-05.com.dell:powervault.md3200i.12345cb0001234b1000000001ece123e" --portal "192.168.1.1:3260" --rescan

Enable iscsi at startup: /etc/iscsi/iscsid.conf

...
#*****************
# Startup settings
#*****************

# To request that the iscsi initd scripts startup a session set to "automatic".
# node.startup = automatic
#
# To manually startup the session set to "manual". The default is manual.
node.startup = automatic
...

information about the iSCSI status

iscsiadm -m node

iscsiadm -m session -i

configuration multipath

multipath bonds the differnt ways from the iscsi node to the iscsi target.

/etc/multipath.conf

defaults {
        udev_dir                /dev
        polling_interval        10
        selector                "round-robin 0"
        path_grouping_policy    multibus
        getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
        prio_callout            /bin/true
        path_checker            directio
        prio                    const
        rr_min_io               100
        rr_weight               priorities
        failback                immediate
        no_path_retry           fail
        user_friendly_name      yes
}
blacklist {
        devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
        devnode "^hd[a-z][[0-9]*]"
        devnode "^vd[a-z]"
        devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
        device {
                vendor "DELL"
                product "PERC 6/i"
        }
}
multipaths {
        multipath {
                wwid 31234bcb0001234b1000003204ef013d4
                alias test
        }
...
}

multipath -ll

test (31234bcb0001234b1000003204ef013d4) dm-2 DELL,MD32xxi
size=10G features='3 queue_if_no_path pg_init_retries 50' hwhandler='1 rdac' wp=rw
|-+- policy='round-robin 0' prio=6 status=active
| |- 9:0:0:0  sdd  8:48   active ready running
| |- 4:0:0:0  sdc  8:32   active ready running
| |- 10:0:0:0 sde  8:64   active ready running
| `- 6:0:0:0  sdb  8:16   active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  |- 7:0:0:0  sdf  8:80   active ghost running
  |- 5:0:0:0  sdg  8:96   active ghost running
  |- 8:0:0:0  sdi  8:128  active ghost running
  `- 3:0:0:0  sdh  8:112  active ghost running
...

In this output you can get the wwid for adding it to multipath.conf