Tuesday, April 10, 2012

Red Hat 5, iSCSI and multipath

So you setup multipath with iSCSI on Red Hat 5 but noticing traffic is only going out 1 interface?

The problem is iscsiadm seems to ignore the physical interface you are trying to bond to.  I think you can manually force the iface when setting up each node but when you have a storage array with 5 adapters, and your server has 3 adapters you are using, do you really want to enter 15 commands per volume?  If you are as lazy as I am, the quick fix is to edit each iface entry in /var/lib/iscsi/ifaces and add the line:
"iface.net_ifacename = eth0" where eth0 is the physical interface you are bonding.

Then its simple a matter of discovering the volumes:
 iscsiadm -m discovery -t st -p <iscsi discovery IP>

Add the node to all available ifaces in 1 shot:
 iscsiadm -m node iqn.veryveryverylongname000000666.feedge --login

Check multipath:
multipath -ll

mpath10 (2bfc5148f7267432c5d7ce900ed0e9ff4) dm-2 Nimble,Server
[size=800G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=15][active]
 \_ 147:0:0:0 sdef       128:112 [active][ready]
 \_ 149:0:0:0 sdeg       128:128 [active][ready]
 \_ 148:0:0:0 sdeh       128:144 [active][ready]
 \_ 151:0:0:0 sdei       128:160 [active][ready]
 \_ 153:0:0:0 sdel       128:208 [active][ready]
 \_ 150:0:0:0 sdej       128:176 [active][ready]
 \_ 152:0:0:0 sdek       128:192 [active][ready]
 \_ 154:0:0:0 sdem       128:224 [active][ready]
 \_ 156:0:0:0 sden       128:240 [active][ready]
 \_ 158:0:0:0 sdeq       129:32  [active][ready]
 \_ 155:0:0:0 sdeo       129:0   [active][ready]
 \_ 157:0:0:0 sdep       129:16  [active][ready]
 \_ 159:0:0:0 sder       129:48  [active][ready]
 \_ 160:0:0:0 sdes       129:64  [active][ready]
 \_ 161:0:0:0 sdet       129:80  [active][ready]

and mount (or format) your volume:
mount /dev/mpath/mpath10 /myvolume

You can check ifconfig to confirm all the ethernet adapters bound to iSCSI have equal amounts of traffic or use iptraf to check the packets.

No comments:

Post a Comment