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

openvswitch fix

 * fix unhandled nic.mode in
   "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 <>
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarKlaus Aehlig <>
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
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
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