@@ -100,8 +100,10 @@ IPV6_ROUTER_GW_IP=${IPV6_ROUTER_GW_IP:-fe80:cafe:cafe::1}
100100# Set up default directories
101101GITDIR[" python-neutronclient" ]=$DEST /python-neutronclient
102102
103+
103104NEUTRON_DIR=$DEST /neutron
104105NEUTRON_FWAAS_DIR=$DEST /neutron-fwaas
106+ NEUTRON_LBAAS_DIR=$DEST /neutron-lbaas
105107NEUTRON_VPNAAS_DIR=$DEST /neutron-vpnaas
106108NEUTRON_AUTH_CACHE_DIR=${NEUTRON_AUTH_CACHE_DIR:-/ var/ cache/ neutron}
107109
114116
115117NEUTRON_CONF_DIR=/etc/neutron
116118NEUTRON_CONF=$NEUTRON_CONF_DIR /neutron.conf
117-
118119export 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.
326327source $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
351358TEMPEST_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
366362XTRACE=$( set +o | grep xtrace)
367363set +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+
788801function _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+
957978function _configure_neutron_metering {
958979 neutron_agent_metering_configure_common
959980 neutron_agent_metering_configure_agent
0 commit comments