From f7cea2502b8da64e7b5b64d15433012670f078a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Wed, 4 Mar 2015 12:51:42 +0100 Subject: [PATCH] Disable notifications in Nova and Glance without Ceilometer Currently, even if Ceilomemter isn't enabled, notifications for the Nova and Glance services on the controller nodes are enabled. The notification.* queues are being filled up, but no consumer reads from them. Glance changes are taken from I3f2c29adbfb605ef288962f72ba81c11811cb35 Change-Id: I00db51ceb4121e73bfe7e256b895e4fae122a496 Closes-Bug: 1425982 --- deployment/puppet/glance/manifests/notify/rabbitmq.pp | 8 +++++++- .../glance/spec/classes/glance_notify_rabbitmq_spec.rb | 2 +- deployment/puppet/openstack/manifests/nova/controller.pp | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/deployment/puppet/glance/manifests/notify/rabbitmq.pp b/deployment/puppet/glance/manifests/notify/rabbitmq.pp index a3c4810d21..81ebbd20d5 100644 --- a/deployment/puppet/glance/manifests/notify/rabbitmq.pp +++ b/deployment/puppet/glance/manifests/notify/rabbitmq.pp @@ -51,6 +51,7 @@ class glance::notify::rabbitmq( $rabbit_notification_topic = 'notifications', $rabbit_durable_queues = false, $amqp_durable_queues = false, + $ceilometer = false, ) { if $rabbit_durable_queues { @@ -75,7 +76,6 @@ class glance::notify::rabbitmq( } glance_api_config { - 'DEFAULT/notification_driver': value => 'messaging'; 'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host; 'DEFAULT/rabbit_password': value => $rabbit_password; 'DEFAULT/rabbit_userid': value => $rabbit_userid; @@ -85,6 +85,12 @@ class glance::notify::rabbitmq( 'DEFAULT/amqp_durable_queues': value => $amqp_durable_queues_real; } + if $ceilometer { + glance_api_config { 'DEFAULT/notification_driver': value => 'messaging' } + } else { + glance_api_config { 'DEFAULT/notification_driver': ensure => absent } + } + if $rabbit_use_ssl { glance_api_config { 'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version } diff --git a/deployment/puppet/glance/spec/classes/glance_notify_rabbitmq_spec.rb b/deployment/puppet/glance/spec/classes/glance_notify_rabbitmq_spec.rb index d5d1d38ed6..26d61b88a3 100644 --- a/deployment/puppet/glance/spec/classes/glance_notify_rabbitmq_spec.rb +++ b/deployment/puppet/glance/spec/classes/glance_notify_rabbitmq_spec.rb @@ -14,7 +14,7 @@ describe 'glance::notify::rabbitmq' do let :params do {:rabbit_password => 'pass'} end - it { should contain_glance_api_config('DEFAULT/notification_driver').with_value('messaging') } + it { should contain_glance_api_config('DEFAULT/notification_driver').with_ensure('absent') } it { should contain_glance_api_config('DEFAULT/rabbit_password').with_value('pass') } it { should contain_glance_api_config('DEFAULT/rabbit_userid').with_value('guest') } it { should contain_glance_api_config('DEFAULT/rabbit_host').with_value('localhost') } diff --git a/deployment/puppet/openstack/manifests/nova/controller.pp b/deployment/puppet/openstack/manifests/nova/controller.pp index 77b7806ad6..529f118335 100644 --- a/deployment/puppet/openstack/manifests/nova/controller.pp +++ b/deployment/puppet/openstack/manifests/nova/controller.pp @@ -91,6 +91,7 @@ class openstack::nova::controller ( $nova_report_interval = '10', $nova_service_down_time = '60', $cinder = true, + $ceilometer = false, # SQLAlchemy backend $idle_timeout = '3600', $max_pool_size = '10', @@ -243,8 +244,10 @@ class openstack::nova::controller ( $memcached_addresses = suffix($cache_server_ip, inline_template(":<%= @cache_server_port %>")) # From legacy ceilometer notifications for nova - $notify_on_state_change = 'vm_and_task_state' - $notification_driver = 'messaging' + if ($ceilometer) { + $notify_on_state_change = 'vm_and_task_state' + $notification_driver = 'messaging' + } class { 'nova': install_utilities => false,