* 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: Ansgar Jazdzewski <a.jazdzewski@googlemail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
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)
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
}