Browse code

Remove LBaaS support from devstack

Devstack support for LBaaS is being migrated to an external
plugin in the neutron-lbaas repository. The only LBaaS-
specific code that remains in devstack is a hook to support
existing configs that enable q-lbaas. In that case, load
the external plugin if necessary.

Change-Id: I592f64407ccf1e722b8d9788917879d0236acf0b
Depends-On: I64a94aeeabe6357b5ea7796e34c9306c55c9ae67

Al Miller authored on 2015/02/04 13:18:42
Showing 4 changed files
... ...
@@ -1601,6 +1601,25 @@ function enable_plugin {
1601 1601
     GITBRANCH[$name]=$branch
1602 1602
 }
1603 1603
 
1604
+# is_plugin_enabled
1605
+#
1606
+# Has a particular plugin been enabled?
1607
+function is_plugin_enabled {
1608
+    local plugins=$@
1609
+    local plugin
1610
+    local enabled=1
1611
+
1612
+    # short circuit if nothing to do
1613
+    if [[ -z ${DEVSTACK_PLUGINS} ]]; then
1614
+        return $enabled
1615
+    fi
1616
+
1617
+    for plugin in ${plugins}; do
1618
+        [[ ,${DEVSTACK_PLUGINS}, =~ ,${plugin}, ]] && enabled=0
1619
+    done
1620
+    return $enabled
1621
+}
1622
+
1604 1623
 # fetch_plugins
1605 1624
 #
1606 1625
 # clones all plugins
... ...
@@ -100,10 +100,8 @@ IPV6_ROUTER_GW_IP=${IPV6_ROUTER_GW_IP:-fe80:cafe:cafe::1}
100 100
 # Set up default directories
101 101
 GITDIR["python-neutronclient"]=$DEST/python-neutronclient
102 102
 
103
-
104 103
 NEUTRON_DIR=$DEST/neutron
105 104
 NEUTRON_FWAAS_DIR=$DEST/neutron-fwaas
106
-NEUTRON_LBAAS_DIR=$DEST/neutron-lbaas
107 105
 NEUTRON_VPNAAS_DIR=$DEST/neutron-vpnaas
108 106
 NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
109 107
 
... ...
@@ -116,6 +114,7 @@ fi
116 116
 
117 117
 NEUTRON_CONF_DIR=/etc/neutron
118 118
 NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf
119
+
119 120
 export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"}
120 121
 
121 122
 # Agent binaries.  Note, binary paths for other agents are set in per-service
... ...
@@ -326,12 +325,6 @@ ENABLE_METADATA_NETWORK=${ENABLE_METADATA_NETWORK:-False}
326 326
 # Please refer to ``lib/neutron_plugins/README.md`` for details.
327 327
 source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
328 328
 
329
-# Agent loadbalancer service plugin functions
330
-# -------------------------------------------
331
-
332
-# Hardcoding for 1 service plugin for now
333
-source $TOP_DIR/lib/neutron_plugins/services/loadbalancer
334
-
335 329
 # Agent metering service plugin functions
336 330
 # -------------------------------------------
337 331
 
... ...
@@ -358,6 +351,17 @@ fi
358 358
 TEMPEST_SERVICES+=,neutron
359 359
 
360 360
 
361
+# For backward compatibility, if q-lbaas service is enabled, make sure to load the
362
+# neutron-lbaas plugin.  This hook should be removed in a future release, perhaps
363
+# as early as Liberty.
364
+
365
+if is_service_enabled q-lbaas; then
366
+    if ! is_plugin_enabled neutron-lbaas; then
367
+        DEPRECATED_TEXT+="External plugin neutron-lbaas has been automatically activated, please add the appropriate enable_plugin to your local.conf. This will be removed in the Liberty cycle."
368
+        enable_plugin "neutron-lbaas" ${NEUTRON_LBAAS_REPO} ${NEUTRON_LBAAS_BRANCH}
369
+    fi
370
+fi
371
+
361 372
 # Save trace setting
362 373
 XTRACE=$(set +o | grep xtrace)
363 374
 set +o xtrace
... ...
@@ -425,9 +429,7 @@ function configure_neutron {
425 425
     iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT
426 426
 
427 427
     # goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
428
-    if is_service_enabled q-lbaas; then
429
-        _configure_neutron_lbaas
430
-    fi
428
+
431 429
     if is_service_enabled q-metering; then
432 430
         _configure_neutron_metering
433 431
     fi
... ...
@@ -605,7 +607,8 @@ function init_neutron {
605 605
     recreate_database $Q_DB_NAME
606 606
     # Run Neutron db migrations
607 607
     $NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head
608
-    for svc in fwaas lbaas vpnaas; do
608
+
609
+    for svc in fwaas vpnaas; do
609 610
         if [ "$svc" = "vpnaas" ]; then
610 611
             q_svc="q-vpn"
611 612
         else
... ...
@@ -625,10 +628,6 @@ function install_neutron {
625 625
         git_clone $NEUTRON_FWAAS_REPO $NEUTRON_FWAAS_DIR $NEUTRON_FWAAS_BRANCH
626 626
         setup_develop $NEUTRON_FWAAS_DIR
627 627
     fi
628
-    if is_service_enabled q-lbaas; then
629
-        git_clone $NEUTRON_LBAAS_REPO $NEUTRON_LBAAS_DIR $NEUTRON_LBAAS_BRANCH
630
-        setup_develop $NEUTRON_LBAAS_DIR
631
-    fi
632 628
     if is_service_enabled q-vpn; then
633 629
         git_clone $NEUTRON_VPNAAS_REPO $NEUTRON_VPNAAS_DIR $NEUTRON_VPNAAS_BRANCH
634 630
         setup_develop $NEUTRON_VPNAAS_DIR
... ...
@@ -672,10 +671,6 @@ function install_neutron_agent_packages {
672 672
     if is_service_enabled q-agt q-dhcp q-l3; then
673 673
         neutron_plugin_install_agent_packages
674 674
     fi
675
-
676
-    if is_service_enabled q-lbaas; then
677
-        neutron_agent_lbaas_install_agent_packages
678
-    fi
679 675
 }
680 676
 
681 677
 # Start running processes, including screen
... ...
@@ -735,10 +730,6 @@ function start_neutron_agents {
735 735
         run_process q-domua "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
736 736
     fi
737 737
 
738
-    if is_service_enabled q-lbaas; then
739
-        run_process q-lbaas "python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
740
-    fi
741
-
742 738
     if is_service_enabled q-metering; then
743 739
         run_process q-metering "python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
744 740
     fi
... ...
@@ -762,9 +753,6 @@ function stop_neutron {
762 762
 
763 763
     stop_process q-agt
764 764
 
765
-    if is_service_enabled q-lbaas; then
766
-        neutron_lbaas_stop
767
-    fi
768 765
     if is_service_enabled q-fwaas; then
769 766
         neutron_fwaas_stop
770 767
     fi
... ...
@@ -792,12 +780,11 @@ function cleanup_neutron {
792 792
     fi
793 793
 
794 794
     # delete all namespaces created by neutron
795
-    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas|fip|snat)-[0-9a-f-]*'); do
795
+    for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|fip|snat)-[0-9a-f-]*'); do
796 796
         sudo ip netns delete ${ns}
797 797
     done
798 798
 }
799 799
 
800
-
801 800
 function _create_neutron_conf_dir {
802 801
     # Put config files in ``NEUTRON_CONF_DIR`` for everyone to find
803 802
     if [[ ! -d $NEUTRON_CONF_DIR ]]; then
... ...
@@ -967,14 +954,6 @@ function _configure_neutron_ceilometer_notifications {
967 967
     iniset $NEUTRON_CONF DEFAULT notification_driver messaging
968 968
 }
969 969
 
970
-function _configure_neutron_lbaas {
971
-    if [ -f $NEUTRON_LBAAS_DIR/etc/neutron_lbaas.conf ]; then
972
-        cp $NEUTRON_LBAAS_DIR/etc/neutron_lbaas.conf $NEUTRON_CONF_DIR
973
-    fi
974
-    neutron_agent_lbaas_configure_common
975
-    neutron_agent_lbaas_configure_agent
976
-}
977
-
978 970
 function _configure_neutron_metering {
979 971
     neutron_agent_metering_configure_common
980 972
     neutron_agent_metering_configure_agent
981 973
deleted file mode 100644
... ...
@@ -1,49 +0,0 @@
1
-# Neutron loadbalancer plugin
2
-# ---------------------------
3
-
4
-# Save trace setting
5
-LB_XTRACE=$(set +o | grep xtrace)
6
-set +o xtrace
7
-
8
-
9
-AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
10
-LBAAS_PLUGIN=neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPlugin
11
-
12
-function neutron_agent_lbaas_install_agent_packages {
13
-    if is_ubuntu || is_fedora || is_suse; then
14
-        install_package haproxy
15
-    fi
16
-}
17
-
18
-function neutron_agent_lbaas_configure_common {
19
-    _neutron_service_plugin_class_add $LBAAS_PLUGIN
20
-    _neutron_deploy_rootwrap_filters $NEUTRON_LBAAS_DIR
21
-}
22
-
23
-function neutron_agent_lbaas_configure_agent {
24
-    LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
25
-    mkdir -p $LBAAS_AGENT_CONF_PATH
26
-
27
-    LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
28
-
29
-    cp $NEUTRON_LBAAS_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME
30
-
31
-    # ovs_use_veth needs to be set before the plugin configuration
32
-    # occurs to allow plugins to override the setting.
33
-    iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT ovs_use_veth $Q_OVS_USE_VETH
34
-
35
-    neutron_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME
36
-
37
-    if is_fedora; then
38
-        iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
39
-        iniset $LBAAS_AGENT_CONF_FILENAME haproxy user_group "nobody"
40
-    fi
41
-}
42
-
43
-function neutron_lbaas_stop {
44
-    pids=$(ps aux | awk '/haproxy/ { print $2 }')
45
-    [ ! -z "$pids" ] && sudo kill $pids
46
-}
47
-
48
-# Restore xtrace
49
-$LB_XTRACE
... ...
@@ -198,6 +198,9 @@ NEUTRON_FWAAS_REPO=${NEUTRON_FWAAS_REPO:-${GIT_BASE}/openstack/neutron-fwaas.git
198 198
 NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-master}
199 199
 
200 200
 # neutron lbaas service
201
+# The neutron-lbaas specific entries are deprecated and replaced by the neutron-lbaas
202
+# devstack plugin and should be removed in a future release, possibly as soon as Liberty.
203
+
201 204
 NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
202 205
 NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-master}
203 206