Browse code

Support enable_tunneling openvswitch configuration variable

Adds support for setting the new openvswitch configuration variable
added in https://review.openstack.org/#/c/12686/.

Change-Id: Ic599de0fbdc922160580189b94c666a597abe182

Bob Kukura authored on 2012/09/10 13:59:24
Showing 1 changed files
... ...
@@ -1196,6 +1196,12 @@ if is_service_enabled quantum; then
1196 1196
     # Example: LB_PHYSICAL_INTERFACE=eth1
1197 1197
     LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-}
1198 1198
 
1199
+    # With the openvswitch plugin, set to True in localrc to enable
1200
+    # provider GRE tunnels when ENABLE_TENANT_TUNNELS is False.
1201
+    #
1202
+    # Example: OVS_ENABLE_TUNNELING=True
1203
+    OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
1204
+
1199 1205
     # Put config files in ``/etc/quantum`` for everyone to find
1200 1206
     if [[ ! -d /etc/quantum ]]; then
1201 1207
         sudo mkdir -p /etc/quantum
... ...
@@ -1272,6 +1278,11 @@ if is_service_enabled q-svc; then
1272 1272
         if [[ "$OVS_VLAN_RANGES" != "" ]]; then
1273 1273
             iniset /$Q_PLUGIN_CONF_FILE OVS network_vlan_ranges $OVS_VLAN_RANGES
1274 1274
         fi
1275
+
1276
+        # Enable tunnel networks if selected
1277
+        if [[ $OVS_ENABLE_TUNNELING = "True" ]]; then
1278
+            iniset /$Q_PLUGIN_CONF_FILE OVS enable_tunneling True
1279
+        fi
1275 1280
     elif [[ "$Q_PLUGIN" = "linuxbridge" ]]; then
1276 1281
         if [[ "$ENABLE_TENANT_VLANS" = "True" ]]; then
1277 1282
             iniset /$Q_PLUGIN_CONF_FILE VLANS tenant_network_type vlan
... ...
@@ -1302,7 +1313,7 @@ if is_service_enabled q-agt; then
1302 1302
         quantum_setup_ovs_bridge $OVS_BRIDGE
1303 1303
 
1304 1304
         # Setup agent for tunneling
1305
-        if [[ "$ENABLE_TENANT_TUNNELS" = "True" ]]; then
1305
+        if [[ "$OVS_ENABLE_TUNNELING" = "True" ]]; then
1306 1306
             # Verify tunnels are supported
1307 1307
             # REVISIT - also check kernel module support for GRE and patch ports
1308 1308
             OVS_VERSION=`ovs-vsctl --version | head -n 1 | awk '{print $4;}'`
... ...
@@ -1311,6 +1322,7 @@ if is_service_enabled q-agt; then
1311 1311
                 echo "OVS 1.4+ is required for tunneling between multiple hosts."
1312 1312
                 exit 1
1313 1313
             fi
1314
+            iniset /$Q_PLUGIN_CONF_FILE OVS enable_tunneling True
1314 1315
             iniset /$Q_PLUGIN_CONF_FILE OVS local_ip $HOST_IP
1315 1316
         fi
1316 1317