Merge "Add Neutron Metering Agent support"

This commit is contained in:
Jenkins 2013-11-22 15:14:46 +00:00 committed by Gerrit Code Review
commit cdf722cc09
3 changed files with 49 additions and 0 deletions

View File

@ -171,6 +171,7 @@ following settings in your `localrc` section:
enable_service q-dhcp enable_service q-dhcp
enable_service q-l3 enable_service q-l3
enable_service q-meta enable_service q-meta
enable_service q-metering
enable_service neutron enable_service neutron
# Optional, to enable tempest configuration as part of DevStack # Optional, to enable tempest configuration as part of DevStack
enable_service tempest enable_service tempest

View File

@ -207,6 +207,12 @@ source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
# Hardcoding for 1 service plugin for now # Hardcoding for 1 service plugin for now
source $TOP_DIR/lib/neutron_plugins/services/loadbalancer source $TOP_DIR/lib/neutron_plugins/services/loadbalancer
# Agent metering service plugin functions
# -------------------------------------------
# Hardcoding for 1 service plugin for now
source $TOP_DIR/lib/neutron_plugins/services/metering
# VPN service plugin functions # VPN service plugin functions
# ------------------------------------------- # -------------------------------------------
# Hardcoding for 1 service plugin for now # Hardcoding for 1 service plugin for now
@ -236,6 +242,9 @@ function configure_neutron() {
if is_service_enabled q-lbaas; then if is_service_enabled q-lbaas; then
_configure_neutron_lbaas _configure_neutron_lbaas
fi fi
if is_service_enabled q-metering; then
_configure_neutron_metering
fi
if is_service_enabled q-vpn; then if is_service_enabled q-vpn; then
_configure_neutron_vpn _configure_neutron_vpn
fi fi
@ -457,6 +466,10 @@ function start_neutron_agents() {
if is_service_enabled q-lbaas; then if is_service_enabled q-lbaas; then
screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME" screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME"
fi fi
if is_service_enabled q-metering; then
screen_it q-metering "cd $NEUTRON_DIR && python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME"
fi
} }
# stop_neutron() - Stop running processes (non-screen) # stop_neutron() - Stop running processes (non-screen)
@ -637,6 +650,11 @@ function _configure_neutron_lbaas() {
neutron_agent_lbaas_configure_agent neutron_agent_lbaas_configure_agent
} }
function _configure_neutron_metering() {
neutron_agent_metering_configure_common
neutron_agent_metering_configure_agent
}
function _configure_neutron_fwaas() { function _configure_neutron_fwaas() {
neutron_fwaas_configure_common neutron_fwaas_configure_common
neutron_fwaas_configure_driver neutron_fwaas_configure_driver

View File

@ -0,0 +1,30 @@
# Neutron metering plugin
# ---------------------------
# Save trace setting
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent"
METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin"
function neutron_agent_metering_configure_common() {
if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then
Q_SERVICE_PLUGIN_CLASSES=$METERING_PLUGIN
else
Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$METERING_PLUGIN"
fi
}
function neutron_agent_metering_configure_agent() {
METERING_AGENT_CONF_PATH=/etc/neutron/services/metering
mkdir -p $METERING_AGENT_CONF_PATH
METERING_AGENT_CONF_FILENAME="$METERING_AGENT_CONF_PATH/metering_agent.ini"
cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME
}
# Restore xtrace
$MY_XTRACE