ifcfg: don't set VLAN=yes if is an ovs_port
When using the ifcfg provider vlans on bridges (or bonds) fail to startup correctly. This is because VLANs on an OVS bridge are configured as internal ports and these should not have the VLAN=yes or PHYSDEV ifcfg settings specified. Change-Id: Ieb743eda8f0a25cdaca43bdea767af26bf504f15 Closes-bug: #1453904
This commit is contained in:
parent
6f2f62b73b
commit
90f15e38f1
|
@ -74,9 +74,11 @@ class IfcfgNetConfig(os_net_config.NetConfig):
|
|||
data += "HOTPLUG=no\n"
|
||||
data += "NM_CONTROLLED=no\n"
|
||||
if isinstance(base_opt, objects.Vlan):
|
||||
data += "VLAN=yes\n"
|
||||
if base_opt.device:
|
||||
data += "PHYSDEV=%s\n" % base_opt.device
|
||||
if not base_opt.ovs_port:
|
||||
# vlans on OVS bridges are internal ports (no device, etc)
|
||||
data += "VLAN=yes\n"
|
||||
if base_opt.device:
|
||||
data += "PHYSDEV=%s\n" % base_opt.device
|
||||
if base_opt.ovs_port:
|
||||
data += "DEVICETYPE=ovs\n"
|
||||
if base_opt.bridge_name:
|
||||
|
|
|
@ -91,14 +91,21 @@ VLAN=yes
|
|||
PHYSDEV=em1
|
||||
"""
|
||||
|
||||
# vlans on an OVS bridge do not set VLAN=yes or PHYSDEV
|
||||
_BASE_VLAN_OVS = """# This file is autogenerated by os-net-config
|
||||
DEVICE=vlan5
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
"""
|
||||
|
||||
_VLAN_NO_IP = _BASE_VLAN + "BOOTPROTO=none\n"
|
||||
|
||||
|
||||
_VLAN_OVS = _BASE_VLAN + "DEVICETYPE=ovs\nBOOTPROTO=none\n"
|
||||
_VLAN_OVS = _BASE_VLAN_OVS + "DEVICETYPE=ovs\nBOOTPROTO=none\n"
|
||||
|
||||
|
||||
_VLAN_OVS_BRIDGE = _BASE_VLAN + """DEVICETYPE=ovs
|
||||
_VLAN_OVS_BRIDGE = _BASE_VLAN_OVS + """DEVICETYPE=ovs
|
||||
TYPE=OVSIntPort
|
||||
OVS_BRIDGE=br-ctlplane
|
||||
OVS_OPTIONS="tag=5"
|
||||
|
|
Loading…
Reference in New Issue