From 1fcc6a1fc9e58cda0501c2bc99d9cc996ce8681a Mon Sep 17 00:00:00 2001 From: Eoghan Glynn Date: Thu, 25 Oct 2012 14:57:14 +0000 Subject: [PATCH] Modify nova config for ceilometer if enabled If ceilometer is enabled, nova instance usage auditing and the appropriate notification drivers should be automatically enabled, as opposed to relying on manual reconfiguration and service restart. Change-Id: I41643a1418a87942be7b2b7979797ff5eb7e5479 --- lib/nova | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/nova b/lib/nova index 297a338057..95d5d87cff 100644 --- a/lib/nova +++ b/lib/nova @@ -341,6 +341,13 @@ function create_nova_conf() { # Show user_name and project_name instead of user_id and project_id add_nova_opt "logging_context_format_string=%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_name)s %(project_name)s] %(instance)s%(message)s" fi + if is_service_enabled ceilometer; then + add_nova_opt "instance_usage_audit=True" + add_nova_opt "instance_usage_audit_period=hour" + add_nova_opt "notification_driver=nova.openstack.common.notifier.rabbit_notifier" + add_nova_opt "notification_driver=ceilometer.compute.nova_notifier" + fi + # Provide some transition from ``EXTRA_FLAGS`` to ``EXTRA_OPTS`` if [[ -z "$EXTRA_OPTS" && -n "$EXTRA_FLAGS" ]]; then