Description of problem: When the engine makes a call to "Host.getCapabilities", vdsm returns an incorrect value for bonding opts, when a bond in mode 0 is present. The value in the GetCaps reply of a bond in mode 0 is: bond0={ipv4addrs=[Ljava.lang.Object;@32efd948, addr=, cfg={IPV6INIT=no, HOTPLUG=no, NM_CONTROLLED=no, BOOTPROTO=none, BONDING_OPTS=mode=0 miimon=100, DEVICE=bond0, ONBOOT=yes}, ipv6addrs=[Ljava.lang.Object;@12eaa312, active_slave=, mtu=1500, dhcpv4=false, netmask=, dhcpv6=false, slaves=[Ljava.lang.Object;@1ff456ea, hwaddr=52:54:00:d1:3d:c8, ipv6gateway=::, gateway=, opts={miimon=100}} where a bond with mode 2 is: bond1={ipv4addrs=[Ljava.lang.Object;@32efd948, addr=, cfg={BRIDGE=vmnet, IPV6INIT=no, HOTPLUG=no, MTU=1500, NM_CONTROLLED=no, BOOTPROTO=none, BONDING_OPTS=mode=2 miimon=100, DEVICE=bond1, ONBOOT=yes}, ipv6addrs=[Ljava.lang.Object;@76feb366, active_slave=, mtu=1500, dhcpv4=false, netmask=, dhcpv6=false, slaves=[Ljava.lang.Object;@2f92d7da, hwaddr=52:54:00:ad:a5:f6, ipv6gateway=::, gateway=, opts={miimon=100, mode=2}} The values for BONDING_OPTS in ifcfg files for the bonds: bond0: BONDING_OPTS='mode=0 miimon=100' bond1: BONDING_OPTS='mode=2 miimon=100' The values for the opts parameters in the GetCaps replies is: bond0: opts={miimon=100} bond1: opts={miimon=100, mode=2} This caues a problem on the engine when the bonding options are updated. Notice that GetCaps also retrieves BONDING_OPTS, which is correct in both cases. This allows for an easy work around in the engine, as this can be used. If so, maybe the 'opts' can be dropped to avoid sending duplicated values.
The symptom here is that "mode=0" is not reported in the 'opts' map/dictionary because "0" is the default value for the bonding mode. How does this affect the engine?
The engine is trying to parse the mode. If it detects a mode, it sets the the bond options as one of the 7 defined modes. If there is no mode information, the bond options as custom (which we do not want).
RHEV build 3.6.2-3 released http://bob.eng.lab.tlv.redhat.com/builds/3.6/3.6.2-3/
Verified on - vdsm-4.17.18-0.el7ev.noarch