[ovs-discuss] ifup-ovs not configuring bridge devices at boot
Lars Kellogg-Stedman
lars at redhat.com
Sat May 24 12:35:59 UTC 2014
I spent some time earlier this week tracking down a problem I've
experienced under both Fedora 19 and 20: upon a reboot, br-ex would
not be configured with an ip address despite a valid configuration in
/etc/sysconfig/network-scripts/ifcfg-br-ex. I've seen a few other
people report this problem as well.
It turns out this was due to the following logic in ifup-ovs:
if check_device_down "${DEVICE}"; then
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIO
${OVS_EXTRA+-- $OVS_EXTRA} \
${STP+-- set bridge "$DEVICE" stp_enable="${STP}"}
else
OVSBRIDGECONFIGURED="yes"
fi
The call to check_device_down was always returning false, setting
OVSBRIDGECONFIGURED=yes, so the call to ifup-eth later in the script
never happens:
# When dhcp is not enabled, it is possible that someone may want
# a standalone bridge (i.e it may not have any ports). Configure it.
if [ "${OVSBOOTPROTO}" != "dhcp" ] && [ -z "${OVSINTF}" ] && \
[ "${OVSBRIDGECONFIGURED}" != "yes" ]; then
${OTHERSCRIPT} ${CONFIG}
fi
I think this is happening because OVS devices are persistent, so when the
system starts up ovs, br-ex is (a) created and (b) has the link state
set to "up".
I've fixed this locally by simply removing the "else" component of
that first if statement, so that it looks like:
if check_device_down "${DEVICE}"; then
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-br "$DEVICE" $OVS_OPTIO
${OVS_EXTRA+-- $OVS_EXTRA} \
${STP+-- set bridge "$DEVICE" stp_enable="${STP}"}
fi
Does that seem reasonable? The only consequence of this is that
$OTHERSCRIPT will be called every time one runs "ifup
<bridge-device>".
Also, just to be explicit, this is only a problem with "standalone"
bridges -- bridge devices that don't have any ports configured through
ifcfg-... scripts.
Cheers,
--
Lars Kellogg-Stedman <lars at redhat.com> | larsks @ irc
Cloud Engineering / OpenStack | " " @ twitter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20140524/fc41334c/attachment-0002.sig>
More information about the discuss
mailing list