You need to get the pifs again (or ideally, find the lines you used to change the mode in your bash history) – see here for getting pifs.
Then use the following:
xe pif-param-set uuid=bd26334f-f7ff-3206-e5b2-4c017c51907c other-config:bond-mode=balance-slb other-config:bond-updelay=200
This will set your bond back to balance-slb, and reduce the up-delay time (see here for the issue – although I can’t actually confirm right now that the issue still exists in XenServer 5.6, will try and find out and post here if I do*).
*ps, just doing cat /proc/net/bonding/bond0 will tell you.
By default, the NIC bonding in XenServer is load balancing (SLB); apparently every 10-30 seconds it switches the NIC it’s using, and the default setting is an up-delay of 3.1 seconds** (see here).
To change to active-backup, you need to do the following (this requires a reboot by the way):
- Have your bonds set up in XenServer (use the XenCenter GUI)
- Find the UUID of the bond (something like: bd25429f-f7ff-3206-e5b2-4c027c51947c)
- Get the network UUID of your bond: xe network-list
- Get the pif UUID by matching the network-uuid parameter with the one you found in the step above: xe pif-list
- Run the following command: xe pif-param-set uuid=<bond_pif_uuid> other-config:bond-mode=active-backup
- Reboot the XenServer
- Check your bond settings: cat /proc/net/bonding/bond0; the Bonding Mode should say “fault-tolerance (active-backup)”
I’ve not yet figured out how to set a primary NIC for the bond (it’s not officially supported*), will report back when have done.
*UPDATED: found this “Can be configured with one fast path, and one slow path for cost savings; in this scenario, the slow path should only be used if there is a failure on the fast path” – but that’s the only documentation I can find about it, so it may or may not be officially supported…Ref: http://support.citrix.com/article/CTX124421
**UPDATED: in the admin manual, they say this about the up-delay:
“Bonding is set up with an Up Delay of 31000ms and a Down Delay of 200ms. The seemingly
long Up Delay is purposeful because of the time taken by some switches to actually start
routing traffic. Without it, when a link comes back after failing, the bond might rebalance
traffic onto it before the switch is ready to pass traffic. If you want to move both connections
to a different switch, move one, then wait 31 seconds for it to be used again before moving
It also says that XenServer supports Active-Passive NIC bonding which is derived from active-backup (ie, they state that it’s not actually active-backup), and that a fast path and slow path can be configured. However, the steps to configure active-passive state to use “other-config:bond-mode=active-backup” (so the steps above are correct, only they set the server to XenServer’s implementation of active-backup which they call active-passive). The manual also doesn’t mention how to configure the fast and slow paths, and while it lists PIF commands, it doesn’t even mention the other-config:bond-mode command…
If you get the following error in Wireshark:
SIOCGIFFLAGS: bonding_masters: No such device
It can be fixed by manually setting the interface. Go to Capture > Options, OK on the error message (it might not appear, but check the taskbar), and after that you should be able to put your bond interface name in the Interface box at the top. (I’m using version 1.4.6 of Wireshark)
UPDATE: having deleted the bonded interface I’m still getting Wireshark errors. I’ll post if I find a fix.