Browse code

Merge "Automate OVS bridge creation for multiple mappings"

Jenkins authored on 2016/02/11 09:55:15
Showing 2 changed files
... ...
@@ -536,3 +536,19 @@ setup, with small modifications for the interface mappings.
536 536
     LB_PHYSICAL_INTERFACE=eth0
537 537
     PUBLIC_PHYSICAL_NETWORK=default
538 538
     LB_INTERFACE_MAPPINGS=default:eth0
539
+
540
+Creating specific OVS bridges for physical networks
541
+---------------------------------------------------
542
+
543
+When using the Open vSwitch ML2 mechanism driver, it is possible to
544
+have multiple Open vSwitch bridges meant for physical networking be
545
+automatically created by setting the ``OVS_BRIDGE_MAPPINGS`` to a list of
546
+physical network to bridge name associations with the following syntax:
547
+
548
+::
549
+    OVS_BRIDGE_MAPPINGS=net1name:bridge1name,net2name:bridge2name,<...>
550
+
551
+Also, ``OVS_BRIDGE_MAPPINGS`` has precedence over ``PHYSICAL_NETWORK`` and
552
+``OVS_PHYSICAL_BRIDGE``, meaning that if the former is set, the latter
553
+ones will be ignored. When ``OVS_BRIDGE_MAPPINGS`` is not set, the other
554
+variables will still be evaluated.
... ...
@@ -37,6 +37,7 @@ function neutron_plugin_configure_l3_agent {
37 37
 }
38 38
 
39 39
 function neutron_plugin_configure_plugin_agent {
40
+    local mappings_array mapping phys_bridge
40 41
     # Setup integration bridge
41 42
     _neutron_ovs_base_setup_bridge $OVS_BRIDGE
42 43
     _neutron_ovs_base_configure_firewall_driver
... ...
@@ -58,9 +59,15 @@ function neutron_plugin_configure_plugin_agent {
58 58
     # complex physical network configurations.
59 59
     if [[ "$OVS_BRIDGE_MAPPINGS" == "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$OVS_PHYSICAL_BRIDGE" != "" ]]; then
60 60
         OVS_BRIDGE_MAPPINGS=$PHYSICAL_NETWORK:$OVS_PHYSICAL_BRIDGE
61
+    fi
61 62
 
62
-        # Configure bridge manually with physical interface as port for multi-node
63
-        _neutron_ovs_base_add_bridge $OVS_PHYSICAL_BRIDGE
63
+    if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then
64
+        IFS=',' read -a mappings_array <<< "$OVS_BRIDGE_MAPPINGS"
65
+        for mapping in "${mappings_array[@]}"; do
66
+            phys_bridge=`echo $mapping | cut -f 2 -d ":"`
67
+            # Configure bridge manually with physical interface as port for multi-node
68
+            _neutron_ovs_base_add_bridge $phys_bridge
69
+        done
64 70
     fi
65 71
     if [[ "$OVS_BRIDGE_MAPPINGS" != "" ]]; then
66 72
         iniset /$Q_PLUGIN_CONF_FILE ovs bridge_mappings $OVS_BRIDGE_MAPPINGS