From 896fc6b8d2f7dc6e976595220d3c4827c914f9e0 Mon Sep 17 00:00:00 2001 From: Hyunsun Moon Date: Fri, 6 Apr 2018 17:56:01 +0900 Subject: [PATCH] ovs,neutron: use auto_bridge_add for external bridge and interface Also changed ovs-agent-init to take care of configuring default external bridge and interface for cosistency with lb-agent. Change-Id: I1d893b73a784f55594c30f17ef022348d68f0f1b --- .../_neutron-linuxbridge-agent-init.sh.tpl | 14 ------------- neutron/values.yaml | 21 ++++++++----------- .../bin/_openvswitch-vswitchd.sh.tpl | 12 ----------- openvswitch/values.yaml | 7 +------ .../backends/networking/compute-kit-sr-iov.sh | 1 + 5 files changed, 11 insertions(+), 44 deletions(-) diff --git a/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl b/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl index 9054c8aa28..2cfc2e2ac5 100644 --- a/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl +++ b/neutron/templates/bin/_neutron-linuxbridge-agent-init.sh.tpl @@ -18,20 +18,6 @@ limitations under the License. set -ex -# configure external bridge -external_bridge="{{- .Values.network.external_bridge -}}" -external_interface="{{- .Values.network.interface.external -}}" -if [ -n "${external_bridge}" ] ; then - # adding existing bridge would break out the script when -e is set - set +e - ip link add name $external_bridge type bridge - set -e - ip link set dev $external_bridge up - if [ -n "$external_interface" ] ; then - ip link set dev $external_interface master $external_bridge - fi -fi - # configure all bridge mappings defined in config {{- range $br, $phys := .Values.network.auto_bridge_add }} if [ -n "{{- $br -}}" ] ; then diff --git a/neutron/values.yaml b/neutron/values.yaml index 7e32d51d5a..c7b440bb5e 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -90,18 +90,7 @@ network: # allowing agents to be restarted without packet loss and simpler # debugging. This feature requires mount propagation support. share_namespaces: true - external_bridge: br-ex - ip_address: 0.0.0.0 - interface: - # External interface will be automatically added to external_bridge. - # Tunnel interface will be used for VXLAN tunneling. If null - # (default) there is a fallback mechanism to search for interface - # with default routing. - external: null - tunnel: null - # auto_bridge_add is a table of "bridge: interface" pairs, by - # default empty - auto_bridge_add: {} + # auto_bridge_add is a table of "bridge: interface" pairs # To automatically add a physical interfaces to a specific bridges, # for example eth3 to bridge br-physnet1, if0 to br0 and iface_two # to br1 do something like: @@ -110,6 +99,14 @@ network: # br-physnet1: eth3 # br0: if0 # br1: iface_two + # br-ex will be added by default + auto_bridge_add: + br-ex: null + interface: + # Tunnel interface will be used for VXLAN tunneling. If null + # (default) there is a fallback mechanism to search for interface + # with default routing. + tunnel: null sriov: # To perform setup of network interfaces using the SR-IOV init # container you can use a section similar to: diff --git a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl index 36fe51fdc8..94d937ce10 100644 --- a/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl @@ -36,18 +36,6 @@ function start () { ovs-vsctl --no-wait show - external_bridge="{{- .Values.network.external_bridge -}}" - external_interface="{{- .Values.network.interface.external -}}" - if [ -n "${external_bridge}" ] ; then - # create bridge device - ovs-vsctl --no-wait --may-exist add-br $external_bridge - if [ -n "$external_interface" ] ; then - # add external interface to the bridge - ovs-vsctl --no-wait --may-exist add-port $external_bridge $external_interface - ip link set dev $external_interface up - fi - fi - # handle any bridge mappings {{- range $br, $phys := .Values.network.auto_bridge_add }} if [ -n "{{- $br -}}" ] ; then diff --git a/openvswitch/values.yaml b/openvswitch/values.yaml index 111f5f1005..dd2ff659f0 100644 --- a/openvswitch/values.yaml +++ b/openvswitch/values.yaml @@ -38,14 +38,8 @@ labels: node_selector_value: enabled network: - external_bridge: br-ex - ip_address: 0.0.0.0 - interface: - # External interface will be automatically added to external_bridge. Default is null. - external: null # auto_bridge_add is a table of "bridge: interface" pairs, by # default empty - auto_bridge_add: {} # To automatically add a physical interfaces to a specific bridges, # for example eth3 to bridge br-physnet1, if0 to br0 and iface_two # to br1 do something like: @@ -54,6 +48,7 @@ network: # br-physnet1: eth3 # br0: if0 # br1: iface_two + auto_bridge_add: {} pod: lifecycle: diff --git a/tools/overrides/backends/networking/compute-kit-sr-iov.sh b/tools/overrides/backends/networking/compute-kit-sr-iov.sh index 4f672debac..f6555bfe21 100755 --- a/tools/overrides/backends/networking/compute-kit-sr-iov.sh +++ b/tools/overrides/backends/networking/compute-kit-sr-iov.sh @@ -81,6 +81,7 @@ network: num_vfs: 32 promisc: false auto_bridge_add: + br-ex: null br-physnet3: ${OVSBR} conf: neutron: