Browse code

Merge "Add DVR support to DevStack"

Jenkins authored on 2014/07/24 18:59:06
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
 
... ...
@@ -303,6 +314,10 @@ function configure_neutron {
303 303
     if is_service_enabled q-meta; then
304 304
         _configure_neutron_metadata_agent
305 305
     fi
306
+
307
+    if [[ "$Q_DVR_MODE" != "legacy" ]]; then
308
+        _configure_dvr
309
+    fi
306 310
     if is_service_enabled ceilometer; then
307 311
         _configure_neutron_ceilometer_notifications
308 312
     fi
... ...
@@ -574,7 +589,7 @@ function cleanup_neutron {
574 574
     fi
575 575
 
576 576
     # delete all namespaces created by neutron
577
-    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas)-[0-9a-f-]*'); do
577
+    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas|fip|snat)-[0-9a-f-]*'); do
578 578
         sudo ip netns delete ${ns}
579 579
     done
580 580
 }
... ...
@@ -756,6 +771,12 @@ function _configure_neutron_vpn {
756 756
     neutron_vpn_configure_common
757 757
 }
758 758
 
759
+function _configure_dvr {
760
+    iniset $NEUTRON_CONF DEFAULT router_distributed True
761
+    iniset $Q_L3_CONF_FILE DEFAULT agent_mode $Q_DVR_MODE
762
+}
763
+
764
+
759 765
 # _configure_neutron_plugin_agent() - Set config files for neutron plugin agent
760 766
 # It is called when q-agt is enabled.
761 767
 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 {