During a recent ONTAP upgrade, I ran into an issue with XenServer and iSCSI multipathing. I’m not an expert in Xen, so this was my first time.
The Xen UI was showing multi-pathing 2/4. This needed some digging, normally used to working with VMware products and you can get a bit blind since its handled so very nice compared to how Xen does it.
mpathutil status could show there were two paths active, sda and sdb, backing dm-0
[root@xen1 ~]# mpathutil status
show topology
3600a098038314a74433f5546696e626b dm-0 NETAPP ,LUN C-Mode
size=100G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=active
|- 8:0:0:0 sda 8:0 active ready running
`- 9:0:0:0 sdb 8:16 active ready runningiscsiadm -m session showed a bit more of where the paths were connected to target IPs. The setup is a NetApp A220, so it has two nodes. Each node has one IP iscsi IP on two VLANs or subnets. NetApp node1 holding .10 addresses and node2 holding .11 addresses. So, in this view, you can see that the Xen server is only connected to one NetApp node, which would have been a problem for our Ontap upgrade.
[root@lxen1 ~]# iscsiadm -m session
tcp: [1] 172.16.28.11:3260,1033 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 (non-flash)
tcp: [2] 172.16.29.11:3260,1035 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 (non-flash)The fix was to try to discover the .10 addresses. Here we got the return on all targets from the NetApp
[root@xen1 ~]# iscsiadm -m discovery -t sendtargets -p 172.16.28.10
172.16.28.10:3260,1032 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4
172.16.29.11:3260,1035 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4
172.16.28.11:3260,1033 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4
172.16.29.10:3260,1034 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4So now we can log in and add targets using the iscsiadm commands.
[root@xen1 ~]# iscsiadm -m node -T iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 -p 172.16.28.10 -l
Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4, portal: 172.16.28.10,3260] (multiple)
Login to [iface: default, target: iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4, portal: 172.16.28.10,3260] successful.
[root@ltp1xen1 ~]# iscsiadm -m node -T iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 -p 172.16.29.10 -l
Logging in to [iface: default, target: iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4, portal: 172.16.29.10,3260] (multiple)
Login to [iface: default, target: iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4, portal: 172.16.29.10,3260] successful.Listing the iSCSI sessions, and we can now see sessions to all targets
[root@xen1 ~]# iscsiadm -m session
tcp: [1] 172.16.28.11:3260,1033 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 (non-flash)
tcp: [2] 172.16.29.11:3260,1035 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 (non-flash)
tcp: [3] 172.16.28.10:3260,1032 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 (non-flash)
tcp: [4] 172.16.29.10:3260,1034 iqn.1992-08.com.netapp:sn.b8b89e3f660411edb07dd039ea9d8cc2:vs.4 (non-flash)showing paths again and we can see two extra paths
[root@xen1 ~]# mpathutil status
show topology
3600a098038314a74433f5546696e626a dm-0 NETAPP ,LUN C-Mode
size=100G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 8:0:0:0 sda 8:0 active ready running
| `- 9:0:0:0 sdb 8:16 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 10:0:0:0 sdc 8:32 active ready running
`- 11:0:0:0 sdd 8:48 active ready runningTesting
To be sure that the new iscsi paths are working we can offline the old paths and we should be able to see storage trafic move over on the .10 IPs on the NetApp system, whiched is the unoptimzed paths.
echo offline > /sys/block/sda/device/state
echo offline > /sys/block/sdb/device/stateYou could now see the paths as “Faulty” in the mpathutil status output.
[root@xen4 tmp]# mpathutil status
show topology
3600a098038314a74433f5546696e626e dm-0 NETAPP ,LUN C-Mode
size=100G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw
|-+- policy='service-time 0' prio=0 status=enabled
| |- 10:0:0:0 sda 8:0 failed faulty offline
| `- 11:0:0:0 sdb 8:16 failed faulty offline
`-+- policy='service-time 0' prio=10 status=active
|- 12:0:0:0 sdc 8:32 active ready running
`- 13:0:0:0 sdd 8:48 active ready runningNext step is to check storage is still working, if it didnt you would by now probally see the system become slow and inresponsible. In my case it worked, and i could run a dd test and see trafic on the .10 interfaces from the NetApp UI.
cd /tmp or /run/sr-mount/<VOLUMEUUID>
time dd if=/dev/zero of=testfile bs=1M count=512 oflag=direct
rm -f testfileLastly we can enable the other paths again
echo running > /sys/block/sda/device/state
echo running > /sys/block/sdb/device/stateConslusion
Surely learned something new today. Found the most of the documentation for how to do in on Citrix own side, one link was very helpfull https://support.citrix.com/external/article/CTX140118/helpful-iscsi-commands.html

















































