Skip to content

Commit 93e682c

Browse files
committed
Revert change to remove lbaas from devstack; it breaks grenade.
Change-Id: Ie2adaeb7f27d6d646ca2e6e575fb430b9b74b276
1 parent aff8fb9 commit 93e682c

4 files changed

Lines changed: 86 additions & 38 deletions

File tree

functions-common

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,25 +1601,6 @@ function enable_plugin {
16011601
GITBRANCH[$name]=$branch
16021602
}
16031603

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-
16231604
# fetch_plugins
16241605
#
16251606
# clones all plugins

lib/neutron

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ IPV6_ROUTER_GW_IP=${IPV6_ROUTER_GW_IP:-fe80:cafe:cafe::1}
100100
# Set up default directories
101101
GITDIR["python-neutronclient"]=$DEST/python-neutronclient
102102

103+
103104
NEUTRON_DIR=$DEST/neutron
104105
NEUTRON_FWAAS_DIR=$DEST/neutron-fwaas
106+
NEUTRON_LBAAS_DIR=$DEST/neutron-lbaas
105107
NEUTRON_VPNAAS_DIR=$DEST/neutron-vpnaas
106108
NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
107109

@@ -114,7 +116,6 @@ fi
114116

115117
NEUTRON_CONF_DIR=/etc/neutron
116118
NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf
117-
118119
export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"}
119120

120121
# Agent binaries. Note, binary paths for other agents are set in per-service
@@ -325,6 +326,12 @@ ENABLE_METADATA_NETWORK=${ENABLE_METADATA_NETWORK:-False}
325326
# Please refer to ``lib/neutron_plugins/README.md`` for details.
326327
source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
327328

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+
328335
# Agent metering service plugin functions
329336
# -------------------------------------------
330337

@@ -351,17 +358,6 @@ fi
351358
TEMPEST_SERVICES+=,neutron
352359

353360

354-
# For backward compatibility, if q-lbaas service is enabled, make sure to load the
355-
# neutron-lbaas plugin. This hook should be removed in a future release, perhaps
356-
# as early as Liberty.
357-
358-
if is_service_enabled q-lbaas; then
359-
if ! is_plugin_enabled neutron-lbaas; then
360-
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."
361-
enable_plugin "neutron-lbaas" ${NEUTRON_LBAAS_REPO} ${NEUTRON_LBAAS_BRANCH}
362-
fi
363-
fi
364-
365361
# Save trace setting
366362
XTRACE=$(set +o | grep xtrace)
367363
set +o xtrace
@@ -429,7 +425,9 @@ function configure_neutron {
429425
iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT
430426

431427
# goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
432-
428+
if is_service_enabled q-lbaas; then
429+
_configure_neutron_lbaas
430+
fi
433431
if is_service_enabled q-metering; then
434432
_configure_neutron_metering
435433
fi
@@ -607,8 +605,7 @@ function init_neutron {
607605
recreate_database $Q_DB_NAME
608606
# Run Neutron db migrations
609607
$NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head
610-
611-
for svc in fwaas vpnaas; do
608+
for svc in fwaas lbaas vpnaas; do
612609
if [ "$svc" = "vpnaas" ]; then
613610
q_svc="q-vpn"
614611
else
@@ -628,6 +625,10 @@ function install_neutron {
628625
git_clone $NEUTRON_FWAAS_REPO $NEUTRON_FWAAS_DIR $NEUTRON_FWAAS_BRANCH
629626
setup_develop $NEUTRON_FWAAS_DIR
630627
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
631632
if is_service_enabled q-vpn; then
632633
git_clone $NEUTRON_VPNAAS_REPO $NEUTRON_VPNAAS_DIR $NEUTRON_VPNAAS_BRANCH
633634
setup_develop $NEUTRON_VPNAAS_DIR
@@ -671,6 +672,10 @@ function install_neutron_agent_packages {
671672
if is_service_enabled q-agt q-dhcp q-l3; then
672673
neutron_plugin_install_agent_packages
673674
fi
675+
676+
if is_service_enabled q-lbaas; then
677+
neutron_agent_lbaas_install_agent_packages
678+
fi
674679
}
675680

676681
# Start running processes, including screen
@@ -730,6 +735,10 @@ function start_neutron_agents {
730735
run_process q-domua "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
731736
fi
732737

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+
733742
if is_service_enabled q-metering; then
734743
run_process q-metering "python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
735744
fi
@@ -753,6 +762,9 @@ function stop_neutron {
753762

754763
stop_process q-agt
755764

765+
if is_service_enabled q-lbaas; then
766+
neutron_lbaas_stop
767+
fi
756768
if is_service_enabled q-fwaas; then
757769
neutron_fwaas_stop
758770
fi
@@ -780,11 +792,12 @@ function cleanup_neutron {
780792
fi
781793

782794
# delete all namespaces created by neutron
783-
for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|fip|snat)-[0-9a-f-]*'); do
795+
for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas|fip|snat)-[0-9a-f-]*'); do
784796
sudo ip netns delete ${ns}
785797
done
786798
}
787799

800+
788801
function _create_neutron_conf_dir {
789802
# Put config files in ``NEUTRON_CONF_DIR`` for everyone to find
790803
if [[ ! -d $NEUTRON_CONF_DIR ]]; then
@@ -954,6 +967,14 @@ function _configure_neutron_ceilometer_notifications {
954967
iniset $NEUTRON_CONF DEFAULT notification_driver messaging
955968
}
956969

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+
957978
function _configure_neutron_metering {
958979
neutron_agent_metering_configure_common
959980
neutron_agent_metering_configure_agent
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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

stackrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ NEUTRON_FWAAS_REPO=${NEUTRON_FWAAS_REPO:-${GIT_BASE}/openstack/neutron-fwaas.git
198198
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-master}
199199

200200
# 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-
204201
NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
205202
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-master}
206203

0 commit comments

Comments
 (0)