Browse code

Add DVR support to DevStack

This patch introduces a new Neutron config option: Q_DVR_MODE.

The possible values are:

- legacy : No DVR functionality
- dvr_snat: Controller/single node DVR
- dvr : Compute node in multi-node DVR

When DVR is enabled the following configuration changes will be
in place:

- neutron.conf
- router_distributed=True

- l3_agent.ini
- agent_mode=$Q_DVR_MODE

- ovs_neutron_plugin.ini:
- enable_distributed_routing=True
- l2_population=True
- tunnel_types=vxlan

Supports-blueprint: neutron-ovs-dvr

Change-Id: I669e054a8489fe7ac7f5c00df6535349d477e8c4

Brian Haley authored on 2014/06/28 00:45:50
Showing 2 changed files
... ...
@@ -143,6 +143,17 @@ else
143 143
     Q_RR_COMMAND="sudo $NEUTRON_ROOTWRAP $Q_RR_CONF_FILE"
144 144
 fi
145 145
 
146
+
147
+# Distributed Virtual Router (DVR) configuration
148
+# Can be:
149
+#     legacy   - No DVR functionality
150
+#     dvr_snat - Controller or single node DVR
151
+#     dvr      - Compute node in multi-node DVR
152
+Q_DVR_MODE=${Q_DVR_MODE:-legacy}
153
+if [[ "$Q_DVR_MODE" != "legacy" ]]; then
154
+    Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch,linuxbridge,l2population
155
+fi
156
+
146 157
 # Provider Network Configurations
147 158
 # --------------------------------
148 159
 
... ...
@@ -304,6 +315,10 @@ function configure_neutron {
304 304
         _configure_neutron_metadata_agent
305 305
     fi
306 306
 
307
+    if [[ "$Q_DVR_MODE" != "legacy" ]]; then
308
+        _configure_dvr
309
+    fi
310
+
307 311
     _configure_neutron_debug_command
308 312
 }
309 313
 
... ...
@@ -571,7 +586,7 @@ function cleanup_neutron {
571 571
     fi
572 572
 
573 573
     # delete all namespaces created by neutron
574
-    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas)-[0-9a-f-]*'); do
574
+    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas|fip|snat)-[0-9a-f-]*'); do
575 575
         sudo ip netns delete ${ns}
576 576
     done
577 577
 }
... ...
@@ -749,6 +764,12 @@ function _configure_neutron_vpn {
749 749
     neutron_vpn_configure_common
750 750
 }
751 751
 
752
+function _configure_dvr {
753
+    iniset $NEUTRON_CONF DEFAULT router_distributed True
754
+    iniset $Q_L3_CONF_FILE DEFAULT agent_mode $Q_DVR_MODE
755
+}
756
+
757
+
752 758
 # _configure_neutron_plugin_agent() - Set config files for neutron plugin agent
753 759
 # It is called when q-agt is enabled.
754 760
 function _configure_neutron_plugin_agent {
... ...
@@ -112,6 +112,12 @@ function neutron_plugin_configure_service {
112 112
     populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vxlan $Q_ML2_PLUGIN_VXLAN_TYPE_OPTIONS
113 113
 
114 114
     populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_vlan $Q_ML2_PLUGIN_VLAN_TYPE_OPTIONS
115
+
116
+    if [[ "$Q_DVR_MODE" != "legacy" ]]; then
117
+        populate_ml2_config /$Q_PLUGIN_CONF_FILE agent l2_population=True
118
+        populate_ml2_config /$Q_PLUGIN_CONF_FILE agent tunnel_types=vxlan
119
+        populate_ml2_config /$Q_PLUGIN_CONF_FILE agent enable_distributed_routing=True
120
+    fi
115 121
 }
116 122
 
117 123
 function has_neutron_plugin_security_group {