Posted by
Dealing with a customer issue, setting up a XenServer pool to connect via the software iSCSI initiator to a pair of partnered synchronously replicated Datacore SanMelody iSCSI servers. It setup fine following the datacore guidelines, we could shut down one of the SAN nodes fine and XenServers would failover to the secondary path quickly and vm’s would continue running without a blip. The issue was that on reboots of the XenServers they would only attach to the SR via the lun path mapped in the gui, also when you went in and did your sendtargets to the secondary path and logged on to the second SAN node from the cli, the XenCenter gui would still reflect only 1 of 1 paths connected, when clearly “multipath -l” showed both paths.
The resolution to both issues was editing /etc/rc.local and adding the following to the end of the script. The mpathcount.py seems to trigger after the XenServers are up so they come up as 1 of 1 paths, and then switch to 2 of 2 paths around 10 seconds later, you could tweak the second sleep counter down if your uptight about those things
sleep 30
iscsiadm –m discovery –t st –p
iscsiadm –m node –L all
service multipathd restart
sleep 30
/opt/xensource/sm/mpathcount.py