1 == Setup a new iscsi initiator ==
3 giustini is our storage, i.e. the target in iscsi terminology.
4 The initiator, i.e. the machine that wants to access iscsi
5 block devices, we will simply call host.
7 === host preparations ===
9 * On the host install open-iscsi
11 apt-get install open-iscsi
14 * Then run discovery once so that giustini knows it already. Saves
15 some copy/pasting later on:
17 iscsiadm -m discovery -t st -p 10.0.0.17
20 * You should now see two lines in the output of
24 corresponding to the two addresses that controller A has:
26 dijkstra:~# iscsiadm -m node
27 10.0.0.17:3260,1 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
28 10.0.0.18:3260,2 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
31 === Meanwhile on Melee Islan^W^WGiustini ===
33 * Log into the web config interface (see dsa-passwords for details)
34 * Go to **Manage** -> **General Config** -> **Manage Host List** and give
35 the new host a nice nickname (i.e. its name). If you did the
36 discovery above it should already be listed in the global host
37 list and you just need to set its name. Else you would also need to
38 manually set the host's iqn (iscsi qualifiled name) which you can
39 find on the host in {{{/etc/iscsi/initiatorname.iscsi}}}.
40 * Go to **Manage** -> **General Config** -> **Manage CHAP** to add a new
41 entry for the new host. Pick the correct node name, and set a
42 secret for it (N.B.: the maximum is 15, not 16 chars -
43 the interface and documentation lies). Also setup mutual chap:
44 As name use giustini's base iqn {{{iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda}}}
45 and again pick a secret (same constraints as above).
46 * Go to **Manage** -> **Volume Management** -> **volume menu** -> **add volume** to add
47 a new volume. Choose volume size and name as you wish (our policy for name
48 appears to be "//<targethost>//-//<mountpoint or purpose>//.
49 Leave LUN empty (i.e. NONE).
50 * Go to **Manage** -> **Volume Management** -> **volume mapping** and map the
51 new volume to a free LUN on the new host.
53 === Back on the host ===
55 * edit /etc/iscsi/iscsid.conf:
56 ** set {{{node.session.auth.authmethod = CHAP}}}
57 ** set {{{node.session.auth.username}}} to own initiatorname (again, see {{{/etc/iscsi/initiatorname.iscsi}}})
58 ** set {{{node.session.auth.password}}}
59 ** set {{{node.session.auth.username_in = iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda}}}
60 ** set {{{node.session.auth.password_in}}}
62 * stop and start iscsi:
64 /etc/init.d/open-iscsi stop &&
66 (cd / && env -i /etc/init.d/open-iscsi start)
69 * not sure if this is necessary again:
71 iscsiadm -m discovery -t st -p 10.0.0.17
74 * and just for fun, run this again.
78 The output should be the same as above:
80 dijkstra:~# iscsiadm -m node
81 10.0.0.17:3260,1 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
82 10.0.0.18:3260,2 iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
85 * moment of truth. Login:
87 iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --login
90 * cat /proc/scsi/scsi, dmsg, the logs should show it having detected new block devices as sdX.
91 You should have gotten each volume twice (once via .17 and once via .18).
92 * more pretty status stuff, if you care:
94 dijkstra:~# iscsiadm -m session -P 1
95 Target: iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a
96 Current Portal: 10.0.0.17:3260,1
97 Persistent Portal: 10.0.0.17:3260,1
103 Iface Initiatorname: iqn.1993-08.org.debian:01:dea714656496
104 Iface IPaddress: 10.0.0.218
105 Iface HWaddress: default
106 Iface Netdev: default
108 iSCSI Connection State: LOGGED IN
109 iSCSI Session State: LOGGED_IN
110 Internal iscsid Session State: NO CHANGE
111 Current Portal: 10.0.0.18:3260,2
112 Persistent Portal: 10.0.0.18:3260,2
118 Iface Initiatorname: iqn.1993-08.org.debian:01:dea714656496
119 Iface IPaddress: 10.0.0.218
120 Iface HWaddress: default
121 Iface Netdev: default
123 iSCSI Connection State: LOGGED IN
124 iSCSI Session State: LOGGED_IN
125 Internal iscsid Session State: NO CHANGE
129 * next, install and configure multipath-tools
131 cat > /etc/multipath.conf << EOF
135 selector "round-robin 0"
136 path_grouping_policy multibus
137 getuid_callout "/lib/udev/scsi_id -g -u -s /block/%n"
138 prio_callout /bin/true
139 path_checker readsector0
144 user_friendly_name yes
147 devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
148 devnode "^hd[a-z][[0-9]*]"
150 devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]"
158 wwid 3600c0ff000d5f6bde2d4cf4901000000
164 apt-get install multipath-tools
167 * look at the topology
169 echo show topology | multipathd -k
172 * for the wwid thing in there create an entry in multipath.conf with a proper name, then reload multipathd
174 vi /etc/multipath.conf
175 /etc/init.d/multipath-tools reload
176 echo show topology | multipathd -k
180 * If you are happy with what you have, change node.startup to automatic in iscsid.conf
182 vi /etc/iscsi/iscsid.conf
185 * see if it works out of the box after a reboot.
192 iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --rescan
193 iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --login
194 iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2012i.0834d5ecda.a" --logout