Merge "Implements blueprint quantum-lbaas-plugin-support"

This commit is contained in:
Jenkins 2013-03-06 22:58:27 +00:00 committed by Gerrit Code Review
commit fd6aa547f0
2 changed files with 69 additions and 0 deletions

View File

@ -176,6 +176,11 @@ fi
# Please refer to lib/quantum_plugins/README.md for details. # Please refer to lib/quantum_plugins/README.md for details.
source $TOP_DIR/lib/quantum_plugins/$Q_PLUGIN source $TOP_DIR/lib/quantum_plugins/$Q_PLUGIN
# Agent loadbalancer service plugin functions
# -------------------------------------------
# Hardcoding for 1 service plugin for now
source $TOP_DIR/lib/quantum_plugins/agent_loadbalancer
# Entry Points # Entry Points
# ------------ # ------------
@ -185,6 +190,10 @@ function configure_quantum() {
_configure_quantum_common _configure_quantum_common
iniset_rpc_backend quantum $QUANTUM_CONF DEFAULT iniset_rpc_backend quantum $QUANTUM_CONF DEFAULT
# goes before q-svc to init Q_SERVICE_PLUGIN_CLASSES
if is_service_enabled q-lbaas; then
_configure_quantum_lbaas
fi
if is_service_enabled q-svc; then if is_service_enabled q-svc; then
_configure_quantum_service _configure_quantum_service
fi fi
@ -362,6 +371,10 @@ function start_quantum_agents() {
screen_it q-dhcp "python $AGENT_DHCP_BINARY --config-file $QUANTUM_CONF --config-file=$Q_DHCP_CONF_FILE" screen_it q-dhcp "python $AGENT_DHCP_BINARY --config-file $QUANTUM_CONF --config-file=$Q_DHCP_CONF_FILE"
screen_it q-meta "python $AGENT_META_BINARY --config-file $QUANTUM_CONF --config-file=$Q_META_CONF_FILE" screen_it q-meta "python $AGENT_META_BINARY --config-file $QUANTUM_CONF --config-file=$Q_META_CONF_FILE"
screen_it q-l3 "python $AGENT_L3_BINARY --config-file $QUANTUM_CONF --config-file=$Q_L3_CONF_FILE" screen_it q-l3 "python $AGENT_L3_BINARY --config-file $QUANTUM_CONF --config-file=$Q_L3_CONF_FILE"
if is_service_enabled q-lbaas; then
screen_it q-lbaas "python $AGENT_LBAAS_BINARY --config-file $QUANTUM_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
fi
} }
# stop_quantum() - Stop running processes (non-screen) # stop_quantum() - Stop running processes (non-screen)
@ -483,6 +496,13 @@ function _configure_quantum_metadata_agent() {
_quantum_setup_keystone $Q_META_CONF_FILE DEFAULT set_auth_url _quantum_setup_keystone $Q_META_CONF_FILE DEFAULT set_auth_url
} }
function _configure_quantum_lbaas()
{
quantum_agent_lbaas_install_agent_packages
quantum_agent_lbaas_configure_common
quantum_agent_lbaas_configure_agent
}
# _configure_quantum_plugin_agent() - Set config files for quantum plugin agent # _configure_quantum_plugin_agent() - Set config files for quantum plugin agent
# It is called when q-agt is enabled. # It is called when q-agt is enabled.
function _configure_quantum_plugin_agent() { function _configure_quantum_plugin_agent() {
@ -512,6 +532,10 @@ function _configure_quantum_service() {
# Update either configuration file with plugin # Update either configuration file with plugin
iniset $QUANTUM_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS iniset $QUANTUM_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
if [[ $Q_SERVICE_PLUGIN_CLASSES != '' ]]; then
iniset $QUANTUM_CONF DEFAULT service_plugins $Q_SERVICE_PLUGIN_CLASSES
fi
iniset $QUANTUM_CONF DEFAULT verbose True iniset $QUANTUM_CONF DEFAULT verbose True
iniset $QUANTUM_CONF DEFAULT debug True iniset $QUANTUM_CONF DEFAULT debug True
iniset $QUANTUM_CONF DEFAULT state_path $DATA_DIR/quantum iniset $QUANTUM_CONF DEFAULT state_path $DATA_DIR/quantum

View File

@ -0,0 +1,45 @@
# Quantum loadbalancer plugin
# ---------------------------
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
AGENT_LBAAS_BINARY="$QUANTUM_DIR/bin/quantum-lbaas-agent"
function quantum_agent_lbaas_install_agent_packages() {
if is_ubuntu || is_fedora; then
install_package haproxy
fi
}
function quantum_agent_lbaas_configure_common() {
if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
Q_SERVICE_PLUGIN_CLASSES="quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin"
else
Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin"
fi
}
function quantum_agent_lbaas_configure_agent() {
LBAAS_AGENT_CONF_PATH=/etc/quantum/plugins/services/agent_loadbalancer
mkdir -p $LBAAS_AGENT_CONF_PATH
LBAAS_AGENT_CONF_FILENAME="$LBAAS_AGENT_CONF_PATH/lbaas_agent.ini"
cp $QUANTUM_DIR/etc/lbaas_agent.ini /$LBAAS_AGENT_CONF_FILENAME
if [[ $Q_PLUGIN == 'linuxbridge' || $Q_PLUGIN == 'brocade' ]]; then
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.BridgeInterfaceDriver"
else
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT interface_driver "quantum.agent.linux.interface.OVSInterfaceDriver"
fi
if is_fedora; then
iniset $LBAAS_AGENT_CONF_FILENAME DEFAULT user_group "nobody"
fi
}
# Restore xtrace
$MY_XTRACE