Setup a new iscsi initiator

giustini is our storage, i.e. the target in iscsi terminology. The initiator, i.e. the machine that wants to access iscsi block devices, we will simply call host.

host preparations

    apt-get install open-iscsi
    iscsiadm -m discovery -t st -p 10.0.0.17
    iscsiadm -m node

corresponding to the two addresses that controller A has:

	dijkstra:~# iscsiadm -m node
	10.0.0.17:3260,1 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
	10.0.0.18:3260,2 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a

Meanwhile on Melee Islan^W^WGiustini

Meanwhile on Melee Islan^W^WGiustini (telnet version)

Back on the host

	service open-iscsi stop &&
	sleep 3 &&
	service open-iscsi start)
	iscsiadm -m discovery -t st -p 10.0.0.17
	iscsiadm -m node

The output should be the same as above:

	dijkstra:~# iscsiadm -m node
	10.0.0.17:3260,1 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
	10.0.0.18:3260,2 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
	iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --login
dijkstra:~# iscsiadm -m session -P 1
Target: iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
        Current Portal: 10.0.0.17:3260,1
        Persistent Portal: 10.0.0.17:3260,1
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname: iqn.1993-08.org.debian:01:dea714656496
                Iface IPaddress: 10.0.0.218
                Iface HWaddress: default
                Iface Netdev: default
                SID: 1
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE
        Current Portal: 10.0.0.18:3260,2
        Persistent Portal: 10.0.0.18:3260,2
                **********
                Interface:
                **********
                Iface Name: default
                Iface Transport: tcp
                Iface Initiatorname: iqn.1993-08.org.debian:01:dea714656496
                Iface IPaddress: 10.0.0.218
                Iface HWaddress: default
                Iface Netdev: default
                SID: 2
                iSCSI Connection State: LOGGED IN
                iSCSI Session State: LOGGED_IN
                Internal iscsid Session State: NO CHANGE

cat > /etc/multipath.conf << EOF
defaults {
        udev_dir                /dev
        polling_interval        10
        selector                "round-robin 0"
        path_grouping_policy    multibus
        getuid_callout          "/lib/udev/scsi_id -g -u -s /block/%n"
        prio_callout            /bin/true
        path_checker            readsector0
        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 DEC.*
                product MSA[15]00
        }
}
multipaths {
        multipath {
                wwid 3600c0ff000d5f6bde2d4cf4901000000
                alias geo2-boot
        }
}
EOF

apt-get install multipath-tools
	echo show topology | multipathd -k
	vi /etc/multipath.conf
	service multipath-tools reload
	echo show topology | multipathd -k
	ls -l /dev/mapper
	vi /etc/iscsi/iscsid.conf

misc

  iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --rescan
  iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --login
  iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --logout