In last post of AHV Networking series, we learnt the basics of the various bond modes that are available with OVS in AHV. In this post we will learn how to change the bond mode configuration.
Lets jump into lab and start firing some commands.
1: Verify current bond mode.
SSH to any of the AHV host in cluster and run command: ovs-appctl bond/show
This command shows the current bond mode that is configured and the member interfaces that are present in the bond.
Alternatively you can connect to a CVM and run command: allssh ssh root@192.168.5.1 ovs-vsctl show to fetch more information about a bond.
2: Change Bond Mode from Active/Backup to Balance-SLB
To change bond from active/backup to balance-slb, we can use the allssh command to update bond configuration on all AHV host (that are part of a cluster) in one shot. Command to do this is : allssh ssh root@192.168.5.1ovs-vsctl set port br0-up bond_mode=balance-slb
3: Verify that bond mode has changed
Command: allssh ssh root@192.168.5.1ovs-vsctl show
4: Change Rebalance Interval
In balance-slb mode, default rebalance interval is 10 secs which is too short. Traffic will be moved often from one interface to another when load imbalance is detected. To change this to a higher value we can use command: allssh ssh root@192.168.5.1ovs-vsctl set port br0-up other_configuration:bond-rebalance-interval=
In below example I set the balance interval to 30 seconds.
and verified that it has been changed
5: Change bond mode from Active/Backup to Balance TCP
Before changing bond mode to balance-tcp in AHV, make sure you have lacp configured at your upstream switches. Once that is configured, you can use below commands to make changes on AHV
Activate LACP:
$ allssh ssh root@192.168.5.1 ovs-vsctl setport br0-up lacp=active
Set the bond mode to Balance-TCP:
$ allssh ssh root@192.168.5.1 ovs-vsctl set port br0-up bond_mode=balance-tcp
Allow Fallback
In LACP mode, in case of upstream LACP negotiation failure, the default configuration is to disable the bond, which would block all traffic. To counter this situation we need to specify the fallback parameter.
Using this parameter we are basically asking OVS to fallback to default Active/Backup mode if LACP negotiation fails with upstream switches. Use below command to do so:
allssh ssh root@192.168.5.1 ovs-vsctl set port br0-up other_config:lacp-fallback-ab=true
Additional Learning
Below YouTube video by Jason Burns explains more on load balancing in Nutanix.
https://www.youtube.com/watch?v=gziYnsvsCdQ
And that’s it for this post.
I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing