When ifdown isn't executed (system didn't shut down properly),
bond interfaces remain in the openvswitch's database.  In that
case, an inconsitency is left behind when the ifcfg was modified
because ovs-vsctl won't do anything to update existing bond's
configuration in the database.

The ifup/ifdown will operate only on configured interfaces, so
this patch fixes the issue by deleting the bond from the database
before attempt to configure it with fresh configuration.

Signed-off-by: Flavio Leitner <f...@redhat.com>
---
 rhel/etc_sysconfig_network-scripts_ifup-ovs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs 
b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index f3fc05e..150b264 100755
--- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
+++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
@@ -143,7 +143,9 @@ case "$TYPE" in
                for _iface in $BOND_IFACES; do
                        /sbin/ifup ${_iface}
                done
-               ovs-vsctl -t ${TIMEOUT} -- --may-exist add-bond "$OVS_BRIDGE" 
"$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
+               ovs-vsctl -t ${TIMEOUT} \
+                       -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" \
+                       -- add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} 
$OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
                OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE"
                ;;
        OVSTunnel)
-- 
2.7.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to