Merge "Remove LBaaS support from devstack"
This commit is contained in:
commit
81dcb64b0d
@ -1601,6 +1601,25 @@ function enable_plugin {
|
|||||||
GITBRANCH[$name]=$branch
|
GITBRANCH[$name]=$branch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# is_plugin_enabled
|
||||||
|
#
|
||||||
|
# Has a particular plugin been enabled?
|
||||||
|
function is_plugin_enabled {
|
||||||
|
local plugins=$@
|
||||||
|
local plugin
|
||||||
|
local enabled=1
|
||||||
|
|
||||||
|
# short circuit if nothing to do
|
||||||
|
if [[ -z ${DEVSTACK_PLUGINS} ]]; then
|
||||||
|
return $enabled
|
||||||
|
fi
|
||||||
|
|
||||||
|
for plugin in ${plugins}; do
|
||||||
|
[[ ,${DEVSTACK_PLUGINS}, =~ ,${plugin}, ]] && enabled=0
|
||||||
|
done
|
||||||
|
return $enabled
|
||||||
|
}
|
||||||
|
|
||||||
# fetch_plugins
|
# fetch_plugins
|
||||||
#
|
#
|
||||||
# clones all plugins
|
# clones all plugins
|
||||||
|
53
lib/neutron
53
lib/neutron
@ -100,10 +100,8 @@ IPV6_ROUTER_GW_IP=${IPV6_ROUTER_GW_IP:-fe80:cafe:cafe::1}
|
|||||||
# Set up default directories
|
# Set up default directories
|
||||||
GITDIR["python-neutronclient"]=$DEST/python-neutronclient
|
GITDIR["python-neutronclient"]=$DEST/python-neutronclient
|
||||||
|
|
||||||
|
|
||||||
NEUTRON_DIR=$DEST/neutron
|
NEUTRON_DIR=$DEST/neutron
|
||||||
NEUTRON_FWAAS_DIR=$DEST/neutron-fwaas
|
NEUTRON_FWAAS_DIR=$DEST/neutron-fwaas
|
||||||
NEUTRON_LBAAS_DIR=$DEST/neutron-lbaas
|
|
||||||
NEUTRON_VPNAAS_DIR=$DEST/neutron-vpnaas
|
NEUTRON_VPNAAS_DIR=$DEST/neutron-vpnaas
|
||||||
NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
|
NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/var/cache/neutron}
|
||||||
|
|
||||||
@ -116,6 +114,7 @@ fi
|
|||||||
|
|
||||||
NEUTRON_CONF_DIR=/etc/neutron
|
NEUTRON_CONF_DIR=/etc/neutron
|
||||||
NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf
|
NEUTRON_CONF=$NEUTRON_CONF_DIR/neutron.conf
|
||||||
|
|
||||||
export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"}
|
export NEUTRON_TEST_CONFIG_FILE=${NEUTRON_TEST_CONFIG_FILE:-"$NEUTRON_CONF_DIR/debug.ini"}
|
||||||
|
|
||||||
# Agent binaries. Note, binary paths for other agents are set in per-service
|
# Agent binaries. Note, binary paths for other agents are set in per-service
|
||||||
@ -326,12 +325,6 @@ ENABLE_METADATA_NETWORK=${ENABLE_METADATA_NETWORK:-False}
|
|||||||
# Please refer to ``lib/neutron_plugins/README.md`` for details.
|
# Please refer to ``lib/neutron_plugins/README.md`` for details.
|
||||||
source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
|
source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
|
||||||
|
|
||||||
# Agent loadbalancer service plugin functions
|
|
||||||
# -------------------------------------------
|
|
||||||
|
|
||||||
# Hardcoding for 1 service plugin for now
|
|
||||||
source $TOP_DIR/lib/neutron_plugins/services/loadbalancer
|
|
||||||
|
|
||||||
# Agent metering service plugin functions
|
# Agent metering service plugin functions
|
||||||
# -------------------------------------------
|
# -------------------------------------------
|
||||||
|
|
||||||
@ -358,6 +351,17 @@ fi
|
|||||||
TEMPEST_SERVICES+=,neutron
|
TEMPEST_SERVICES+=,neutron
|
||||||
|
|
||||||
|
|
||||||
|
# For backward compatibility, if q-lbaas service is enabled, make sure to load the
|
||||||
|
# neutron-lbaas plugin. This hook should be removed in a future release, perhaps
|
||||||
|
# as early as Liberty.
|
||||||
|
|
||||||
|
if is_service_enabled q-lbaas; then
|
||||||
|
if ! is_plugin_enabled neutron-lbaas; then
|
||||||
|
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."
|
||||||
|
enable_plugin "neutron-lbaas" ${NEUTRON_LBAAS_REPO} ${NEUTRON_LBAAS_BRANCH}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Save trace setting
|
# Save trace setting
|
||||||
XTRACE=$(set +o | grep xtrace)
|
XTRACE=$(set +o | grep xtrace)
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
@ -425,9 +429,7 @@ function configure_neutron {
|
|||||||
iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT
|
iniset_rpc_backend neutron $NEUTRON_CONF DEFAULT
|
||||||
|
|
||||||
# goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
|
# goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
|
||||||
if is_service_enabled q-lbaas; then
|
|
||||||
_configure_neutron_lbaas
|
|
||||||
fi
|
|
||||||
if is_service_enabled q-metering; then
|
if is_service_enabled q-metering; then
|
||||||
_configure_neutron_metering
|
_configure_neutron_metering
|
||||||
fi
|
fi
|
||||||
@ -605,7 +607,8 @@ function init_neutron {
|
|||||||
recreate_database $Q_DB_NAME
|
recreate_database $Q_DB_NAME
|
||||||
# Run Neutron db migrations
|
# Run Neutron db migrations
|
||||||
$NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head
|
$NEUTRON_BIN_DIR/neutron-db-manage --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE upgrade head
|
||||||
for svc in fwaas lbaas vpnaas; do
|
|
||||||
|
for svc in fwaas vpnaas; do
|
||||||
if [ "$svc" = "vpnaas" ]; then
|
if [ "$svc" = "vpnaas" ]; then
|
||||||
q_svc="q-vpn"
|
q_svc="q-vpn"
|
||||||
else
|
else
|
||||||
@ -625,10 +628,6 @@ function install_neutron {
|
|||||||
git_clone $NEUTRON_FWAAS_REPO $NEUTRON_FWAAS_DIR $NEUTRON_FWAAS_BRANCH
|
git_clone $NEUTRON_FWAAS_REPO $NEUTRON_FWAAS_DIR $NEUTRON_FWAAS_BRANCH
|
||||||
setup_develop $NEUTRON_FWAAS_DIR
|
setup_develop $NEUTRON_FWAAS_DIR
|
||||||
fi
|
fi
|
||||||
if is_service_enabled q-lbaas; then
|
|
||||||
git_clone $NEUTRON_LBAAS_REPO $NEUTRON_LBAAS_DIR $NEUTRON_LBAAS_BRANCH
|
|
||||||
setup_develop $NEUTRON_LBAAS_DIR
|
|
||||||
fi
|
|
||||||
if is_service_enabled q-vpn; then
|
if is_service_enabled q-vpn; then
|
||||||
git_clone $NEUTRON_VPNAAS_REPO $NEUTRON_VPNAAS_DIR $NEUTRON_VPNAAS_BRANCH
|
git_clone $NEUTRON_VPNAAS_REPO $NEUTRON_VPNAAS_DIR $NEUTRON_VPNAAS_BRANCH
|
||||||
setup_develop $NEUTRON_VPNAAS_DIR
|
setup_develop $NEUTRON_VPNAAS_DIR
|
||||||
@ -672,10 +671,6 @@ function install_neutron_agent_packages {
|
|||||||
if is_service_enabled q-agt q-dhcp q-l3; then
|
if is_service_enabled q-agt q-dhcp q-l3; then
|
||||||
neutron_plugin_install_agent_packages
|
neutron_plugin_install_agent_packages
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_service_enabled q-lbaas; then
|
|
||||||
neutron_agent_lbaas_install_agent_packages
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Start running processes, including screen
|
# Start running processes, including screen
|
||||||
@ -735,10 +730,6 @@ function start_neutron_agents {
|
|||||||
run_process q-domua "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
|
run_process q-domua "python $AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$Q_PLUGIN_CONF_FILE.domU"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if is_service_enabled q-lbaas; then
|
|
||||||
run_process q-lbaas "python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if is_service_enabled q-metering; then
|
if is_service_enabled q-metering; then
|
||||||
run_process q-metering "python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
|
run_process q-metering "python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
|
||||||
fi
|
fi
|
||||||
@ -762,9 +753,6 @@ function stop_neutron {
|
|||||||
|
|
||||||
stop_process q-agt
|
stop_process q-agt
|
||||||
|
|
||||||
if is_service_enabled q-lbaas; then
|
|
||||||
neutron_lbaas_stop
|
|
||||||
fi
|
|
||||||
if is_service_enabled q-fwaas; then
|
if is_service_enabled q-fwaas; then
|
||||||
neutron_fwaas_stop
|
neutron_fwaas_stop
|
||||||
fi
|
fi
|
||||||
@ -792,12 +780,11 @@ function cleanup_neutron {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# delete all namespaces created by neutron
|
# delete all namespaces created by neutron
|
||||||
for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|qlbaas|fip|snat)-[0-9a-f-]*'); do
|
for ns in $(sudo ip netns list | grep -o -E '(qdhcp|qrouter|fip|snat)-[0-9a-f-]*'); do
|
||||||
sudo ip netns delete ${ns}
|
sudo ip netns delete ${ns}
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function _create_neutron_conf_dir {
|
function _create_neutron_conf_dir {
|
||||||
# Put config files in ``NEUTRON_CONF_DIR`` for everyone to find
|
# Put config files in ``NEUTRON_CONF_DIR`` for everyone to find
|
||||||
if [[ ! -d $NEUTRON_CONF_DIR ]]; then
|
if [[ ! -d $NEUTRON_CONF_DIR ]]; then
|
||||||
@ -967,14 +954,6 @@ function _configure_neutron_ceilometer_notifications {
|
|||||||
iniset $NEUTRON_CONF DEFAULT notification_driver messaging
|
iniset $NEUTRON_CONF DEFAULT notification_driver messaging
|
||||||
}
|
}
|
||||||
|
|
||||||
function _configure_neutron_lbaas {
|
|
||||||
if [ -f $NEUTRON_LBAAS_DIR/etc/neutron_lbaas.conf ]; then
|
|
||||||
cp $NEUTRON_LBAAS_DIR/etc/neutron_lbaas.conf $NEUTRON_CONF_DIR
|
|
||||||
fi
|
|
||||||
neutron_agent_lbaas_configure_common
|
|
||||||
neutron_agent_lbaas_configure_agent
|
|
||||||
}
|
|
||||||
|
|
||||||
function _configure_neutron_metering {
|
function _configure_neutron_metering {
|
||||||
neutron_agent_metering_configure_common
|
neutron_agent_metering_configure_common
|
||||||
neutron_agent_metering_configure_agent
|
neutron_agent_metering_configure_agent
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
# Neutron loadbalancer plugin
|
|
||||||
# ---------------------------
|
|
||||||
|
|
||||||
# Save trace setting
|
|
||||||
LB_XTRACE=$(set +o | grep xtrace)
|
|
||||||
set +o xtrace
|
|
||||||
|
|
||||||
|
|
||||||
AGENT_LBAAS_BINARY="$NEUTRON_BIN_DIR/neutron-lbaas-agent"
|
|
||||||
LBAAS_PLUGIN=neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPlugin
|
|
||||||
|
|
||||||
function neutron_agent_lbaas_install_agent_packages {
|
|
||||||
if is_ubuntu || is_fedora || is_suse; then
|
|
||||||
install_package haproxy
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function neutron_agent_lbaas_configure_common {
|
|
||||||
_neutron_service_plugin_class_add $LBAAS_PLUGIN
|
|
||||||
_neutron_deploy_rootwrap_filters $NEUTRON_LBAAS_DIR
|
|
||||||
}
|
|
||||||
|
|
||||||
function neutron_agent_lbaas_configure_agent {
|
|
||||||
LBAAS_AGENT_CONF_PATH=/etc/neutron/services/loadbalancer/haproxy
|
|
||||||
mkdir -p $LBAAS_AGENT_CONF_PATH
|
|
||||||
|
|
||||||
LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
|
|
||||||
|
|
||||||
cp $NEUTRON_LBAAS_DIR/etc/lbaas_agent.ini $LBAAS_AGENT_CONF_FILENAME
|
|
||||||
|
|
||||||
# ovs_use_veth needs to be set before the plugin configuration
|
|
||||||
# occurs to allow plugins to override the setting.
|
|
||||||
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT ovs_use_veth $Q_OVS_USE_VETH
|
|
||||||
|
|
||||||
neutron_plugin_setup_interface_driver $LBAAS_AGENT_CONF_FILENAME
|
|
||||||
|
|
||||||
if is_fedora; then
|
|
||||||
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
|
|
||||||
iniset $LBAAS_AGENT_CONF_FILENAME haproxy user_group "nobody"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function neutron_lbaas_stop {
|
|
||||||
pids=$(ps aux | awk '/haproxy/ { print $2 }')
|
|
||||||
[ ! -z "$pids" ] && sudo kill $pids
|
|
||||||
}
|
|
||||||
|
|
||||||
# Restore xtrace
|
|
||||||
$LB_XTRACE
|
|
3
stackrc
3
stackrc
@ -198,6 +198,9 @@ NEUTRON_FWAAS_REPO=${NEUTRON_FWAAS_REPO:-${GIT_BASE}/openstack/neutron-fwaas.git
|
|||||||
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-master}
|
NEUTRON_FWAAS_BRANCH=${NEUTRON_FWAAS_BRANCH:-master}
|
||||||
|
|
||||||
# neutron lbaas service
|
# neutron lbaas service
|
||||||
|
# The neutron-lbaas specific entries are deprecated and replaced by the neutron-lbaas
|
||||||
|
# devstack plugin and should be removed in a future release, possibly as soon as Liberty.
|
||||||
|
|
||||||
NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
|
NEUTRON_LBAAS_REPO=${NEUTRON_LBAAS_REPO:-${GIT_BASE}/openstack/neutron-lbaas.git}
|
||||||
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-master}
|
NEUTRON_LBAAS_BRANCH=${NEUTRON_LBAAS_BRANCH:-master}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user