| ... | ... |
@@ -171,6 +171,7 @@ following settings in your `localrc` section: |
| 171 | 171 |
enable_service q-dhcp |
| 172 | 172 |
enable_service q-l3 |
| 173 | 173 |
enable_service q-meta |
| 174 |
+ enable_service q-metering |
|
| 174 | 175 |
enable_service neutron |
| 175 | 176 |
# Optional, to enable tempest configuration as part of DevStack |
| 176 | 177 |
enable_service tempest |
| ... | ... |
@@ -207,6 +207,12 @@ source $TOP_DIR/lib/neutron_plugins/$Q_PLUGIN |
| 207 | 207 |
# Hardcoding for 1 service plugin for now |
| 208 | 208 |
source $TOP_DIR/lib/neutron_plugins/services/loadbalancer |
| 209 | 209 |
|
| 210 |
+# Agent metering service plugin functions |
|
| 211 |
+# ------------------------------------------- |
|
| 212 |
+ |
|
| 213 |
+# Hardcoding for 1 service plugin for now |
|
| 214 |
+source $TOP_DIR/lib/neutron_plugins/services/metering |
|
| 215 |
+ |
|
| 210 | 216 |
# VPN service plugin functions |
| 211 | 217 |
# ------------------------------------------- |
| 212 | 218 |
# Hardcoding for 1 service plugin for now |
| ... | ... |
@@ -236,6 +242,9 @@ function configure_neutron() {
|
| 236 | 236 |
if is_service_enabled q-lbaas; then |
| 237 | 237 |
_configure_neutron_lbaas |
| 238 | 238 |
fi |
| 239 |
+ if is_service_enabled q-metering; then |
|
| 240 |
+ _configure_neutron_metering |
|
| 241 |
+ fi |
|
| 239 | 242 |
if is_service_enabled q-vpn; then |
| 240 | 243 |
_configure_neutron_vpn |
| 241 | 244 |
fi |
| ... | ... |
@@ -457,6 +466,10 @@ function start_neutron_agents() {
|
| 457 | 457 |
if is_service_enabled q-lbaas; then |
| 458 | 458 |
screen_it q-lbaas "cd $NEUTRON_DIR && python $AGENT_LBAAS_BINARY --config-file $NEUTRON_CONF --config-file=$LBAAS_AGENT_CONF_FILENAME" |
| 459 | 459 |
fi |
| 460 |
+ |
|
| 461 |
+ if is_service_enabled q-metering; then |
|
| 462 |
+ screen_it q-metering "cd $NEUTRON_DIR && python $AGENT_METERING_BINARY --config-file $NEUTRON_CONF --config-file $METERING_AGENT_CONF_FILENAME" |
|
| 463 |
+ fi |
|
| 460 | 464 |
} |
| 461 | 465 |
|
| 462 | 466 |
# stop_neutron() - Stop running processes (non-screen) |
| ... | ... |
@@ -637,6 +650,11 @@ function _configure_neutron_lbaas() {
|
| 637 | 637 |
neutron_agent_lbaas_configure_agent |
| 638 | 638 |
} |
| 639 | 639 |
|
| 640 |
+function _configure_neutron_metering() {
|
|
| 641 |
+ neutron_agent_metering_configure_common |
|
| 642 |
+ neutron_agent_metering_configure_agent |
|
| 643 |
+} |
|
| 644 |
+ |
|
| 640 | 645 |
function _configure_neutron_fwaas() {
|
| 641 | 646 |
neutron_fwaas_configure_common |
| 642 | 647 |
neutron_fwaas_configure_driver |
| 643 | 648 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,30 @@ |
| 0 |
+# Neutron metering plugin |
|
| 1 |
+# --------------------------- |
|
| 2 |
+ |
|
| 3 |
+# Save trace setting |
|
| 4 |
+MY_XTRACE=$(set +o | grep xtrace) |
|
| 5 |
+set +o xtrace |
|
| 6 |
+ |
|
| 7 |
+ |
|
| 8 |
+AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent" |
|
| 9 |
+METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin" |
|
| 10 |
+ |
|
| 11 |
+function neutron_agent_metering_configure_common() {
|
|
| 12 |
+ if [[ $Q_SERVICE_PLUGIN_CLASSES == '' ]]; then |
|
| 13 |
+ Q_SERVICE_PLUGIN_CLASSES=$METERING_PLUGIN |
|
| 14 |
+ else |
|
| 15 |
+ Q_SERVICE_PLUGIN_CLASSES="$Q_SERVICE_PLUGIN_CLASSES,$METERING_PLUGIN" |
|
| 16 |
+ fi |
|
| 17 |
+} |
|
| 18 |
+ |
|
| 19 |
+function neutron_agent_metering_configure_agent() {
|
|
| 20 |
+ METERING_AGENT_CONF_PATH=/etc/neutron/services/metering |
|
| 21 |
+ mkdir -p $METERING_AGENT_CONF_PATH |
|
| 22 |
+ |
|
| 23 |
+ METERING_AGENT_CONF_FILENAME="$METERING_AGENT_CONF_PATH/metering_agent.ini" |
|
| 24 |
+ |
|
| 25 |
+ cp $NEUTRON_DIR/etc/metering_agent.ini $METERING_AGENT_CONF_FILENAME |
|
| 26 |
+} |
|
| 27 |
+ |
|
| 28 |
+# Restore xtrace |
|
| 29 |
+$MY_XTRACE |