Add Neutron Metering Agent support

In Havana, Neutron has now a Metering Agent which gets meters from
virtual routers.

This patchs aims to allow devstack using this new service.

Change-Id: I17ad83799d60384247b98cc8a93ac032f641c721
Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
Emilien Macchi 2013-09-24 15:10:25 +02:00
parent 4c2870b64a
commit 40546f79e0
3 changed files with 49 additions and 0 deletions

View File

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

View File

@ -202,6 +202,12 @@ source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN
# Hardcoding for 1 service plugin for now
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
# -------------------------------------------
# Hardcoding for 1 service plugin for now
@ -231,6 +237,9 @@ function configure_neutron() {
if is_service_enabled q-lbaas; then
_configure_neutron_lbaas
fi
if is_service_enabled q-metering; then
_configure_neutron_metering
fi
if is_service_enabled q-vpn; then
_configure_neutron_vpn
fi
@ -451,6 +460,10 @@ function start_neutron_agents() {
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"
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)
@ -630,6 +643,11 @@ function _configure_neutron_lbaas() {
neutron_agent_lbaas_configure_agent
}
function _configure_neutron_metering() {
neutron_agent_metering_configure_common
neutron_agent_metering_configure_agent
}
function _configure_neutron_fwaas() {
neutron_fwaas_configure_common
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