Commit 95ec6e95 authored by Ansgar Jazdzewski's avatar Ansgar Jazdzewski Committed by Klaus Aehlig

openvswitch fix

 * fix unhandled nic.mode in config.py
   "Unhandled Ganeti error: NIC mode 'openvswitch' not handled" (Issue 804)
 * handle link-changes for the virtual NIC
   a instance will readd the tap interface to the openviswitch so that
   changes of the instance-link (VLAN) will be considered.
   "gnt-instance modfy -net 0:link=newlink"
Signed-off-by: default avatarAnsgar Jazdzewski <a.jazdzewski@googlemail.com>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent f4664f19
......@@ -853,6 +853,8 @@ class ConfigWriter(object):
link = "bridge:%s" % nic_link
elif nic_mode == constants.NIC_MODE_ROUTED:
link = "route:%s" % nic_link
elif nic_mode == constants.NIC_MODE_OVS:
link = "ovs:%s" % nic_link
else:
raise errors.ProgrammerError("NIC mode '%s' not handled" % nic_mode)
......
......@@ -60,6 +60,11 @@ function setup_bridge {
function setup_ovs {
if [ "$MODE" = "openvswitch" ]; then
# Remove stale port
ovs-vsctl del-port $INTERFACE || true
# Bring interface up
ip link set $INTERFACE up
# Add port
ovs-vsctl add-port ${LINK} $INTERFACE
fi
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment