From 8b6d68d13fab7cf28388d7e48f2b89be2c8932e8 Mon Sep 17 00:00:00 2001 From: David Hill Date: Thu, 1 Aug 2019 22:52:59 -0400 Subject: [PATCH] Set notification driver to noop when enable_telemetry=false Actually, enable_telemetry=false doesn't do anything because the notification_drivers values are hardcoded to messaging. This commit changes this behavior by setting notification_drivers to noop if enable_telemetry is set to false. Change-Id: I75441352c29b0421358fc0c87f8708355e7fbb2a Closes-bug: #1838828 Co-Authored-By: Alex Schultz --- .../puppet-stack-config/puppet-stack-config.pp | 4 ---- .../puppet-stack-config.yaml.template | 14 +++++++++++--- instack_undercloud/undercloud.py | 12 ++++++++++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index 9cc27b1ef..9b2236c97 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -422,10 +422,6 @@ class { '::neutron::agents::ml2::ovs': bridge_mappings => split(hiera('neutron_bridge_mappings'), ','), } -neutron_config { - 'DEFAULT/notification_driver': value => 'messaging'; -} - # swift proxy include ::memcached include ::swift::proxy diff --git a/elements/puppet-stack-config/puppet-stack-config.yaml.template b/elements/puppet-stack-config/puppet-stack-config.yaml.template index 7c7b13690..922849983 100644 --- a/elements/puppet-stack-config/puppet-stack-config.yaml.template +++ b/elements/puppet-stack-config/puppet-stack-config.yaml.template @@ -3,6 +3,8 @@ keystone_auth_uri: {{UNDERCLOUD_ENDPOINT_KEYSTONE_PUBLIC}}/v3 keystone_region: 'regionOne' keystone_default_domain: 'Default' +notification_driver: {{NOTIFICATION_DRIVER}} + debug: {{UNDERCLOUD_DEBUG}} controller_host: {{LOCAL_IP}} #local-ipv4 #local-ipv4 similar to the same hiera key in the overcloud @@ -192,7 +194,7 @@ heat::keystone::auth_cfn::admin_url: {{UNDERCLOUD_ENDPOINT_HEAT_CFN_ADMIN}} heat::cron::purge_deleted::age: 1 heat::cron::purge_deleted::age_type: 'days' heat::cron::purge_deleted::destination: '/dev/null' -heat::notification_driver: 'messaging' +heat::notification_driver: "%{hiera('notification_driver')}" heat::yaql_memory_quota: 100000 heat::yaql_limit_iterators: 1000 heat::max_json_body_size: 4194304 @@ -224,7 +226,7 @@ keystone::endpoint::region: "%{hiera('keystone_region')}" keystone::endpoint::version: '' keystone::wsgi::apache::ssl: false keystone::wsgi::apache::bind_host: {{LOCAL_IP}} -keystone::notification_driver: messaging +keystone::notification_driver: "%{hiera('notification_driver')}" keystone::notification_topics: notifications keystone::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" keystone::enable_credential_setup: true @@ -254,6 +256,7 @@ neutron::core_plugin: ml2 neutron::service_plugins: ['router', 'segments'] neutron::dhcp_agents_per_network: 2 neutron::dns_domain: {{OVERCLOUD_DOMAIN_NAME}} +neutron::notification_driver: "%{hiera('notification_driver')}" neutron::server::api_workers: "%{::os_workers}" neutron::server::rpc_workers: "%{::os_workers}" neutron::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" @@ -297,6 +300,7 @@ neutron::agents::ml2::networking_baremetal::region_name: "%{hiera('keystone_regi ceilometer::debug: "%{hiera('debug')}" ceilometer::metering_secret: {{UNDERCLOUD_CEILOMETER_METERING_SECRET}} ceilometer::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" +ceilometer::notification_driver: "%{hiera('notification_driver')}" ceilometer::keystone::authtoken::password: {{UNDERCLOUD_CEILOMETER_PASSWORD}} ceilometer::keystone::authtoken::www_authenticate_uri: "%{hiera('keystone_auth_uri')}" ceilometer::keystone::authtoken::auth_url: "%{hiera('keystone_identity_uri')}" @@ -325,6 +329,7 @@ ceilometer::agent::notification::manage_event_pipeline: true # Aodh aodh::debug: "%{hiera('debug')}" aodh::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" +aodh::notification_driver: "%{hiera('notification_driver')}" aodh::api::host: {{LOCAL_IP}} aodh::keystone::authtoken::password: {{UNDERCLOUD_AODH_PASSWORD}} aodh::keystone::authtoken::www_authenticate_uri: "%{hiera('keystone_auth_uri')}" @@ -400,7 +405,7 @@ panko::keystone::authtoken::project_name: 'service' # Nova nova::debug: "%{hiera('debug')}" nova::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" -nova::notification_driver: messaging +nova::notification_driver: "%{hiera('notification_driver')}" nova::rpc_response_timeout: '600' nova::keystone::authtoken::www_authenticate_uri: "%{hiera('keystone_auth_uri')}" nova::keystone::authtoken::auth_url: "%{hiera('keystone_identity_uri')}" @@ -487,6 +492,7 @@ nova::db::sync_api::db_sync_timeout: 900 ironic::debug: "%{hiera('debug')}" ironic::my_ip: {{LOCAL_IP}} ironic::db_online_data_migrations: true +ironic::notification_driver: "%{hiera('notification_driver')}" # TODO(dtantsur): remove when support for classic drivers is removed ironic::db::online_data_migrations::migration_params: "--option migrate_to_hardware_types.reset_unsupported_interfaces=true" ironic::rpc_response_timeout: 600 @@ -653,6 +659,7 @@ horizon::openstack_endpoint_type: internalURL # Mistral mistral::debug: "%{hiera('debug')}" +mistral::notification_driver: "%{hiera('notification_driver')}" mistral::api::bind_host: {{LOCAL_IP}} mistral::api::api_workers: "%{::os_workers}" mistral::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" @@ -746,6 +753,7 @@ cinder::keystone::authtoken::password: {{UNDERCLOUD_CINDER_PASSWORD}} cinder::keystone::authtoken::user_domain_name: "%{hiera('keystone_default_domain')}" cinder::keystone::authtoken::project_domain_name: "%{hiera('keystone_default_domain')}" cinder::default_transport_url: "rabbit://{{UNDERCLOUD_RABBIT_USERNAME}}:{{UNDERCLOUD_RABBIT_PASSWORD}}@{{LOCAL_IP_WRAPPED}}//" +cinder::notification_driver: "%{hiera('notification_driver')}" cinder::scheduler::scheduler_driver: cinder.scheduler.filter_scheduler.FilterScheduler cinder::setup_test_volume::size: '10280M' cinder::wsgi::apache::bind_host: {{LOCAL_IP}} diff --git a/instack_undercloud/undercloud.py b/instack_undercloud/undercloud.py index c1a3503e1..32a41dbac 100644 --- a/instack_undercloud/undercloud.py +++ b/instack_undercloud/undercloud.py @@ -314,7 +314,9 @@ _opts = [ cfg.BoolOpt('enable_telemetry', default=False, help=('Whether to install Telemetry services ' - '(ceilometer, gnocchi, aodh, panko ) in the Undercloud.') + '(ceilometer, gnocchi, aodh, panko ) in the Undercloud. ' + 'If this is set to False, the notification drivers for ' + 'the OpenStack services will be set to noop.') ), cfg.BoolOpt('enable_ui', default=True, @@ -1171,7 +1173,7 @@ class InstackEnvironment(dict): 'LOCAL_IP_WRAPPED', 'ENABLE_ARCHITECTURE_PPC64LE', 'INSPECTION_SUBNETS', 'SUBNETS_CIDR_NAT_RULES', 'SUBNETS_STATIC_ROUTES', 'MASQUERADE_NETWORKS', - 'UNDERCLOUD_PUBLIC_HOST_WRAPPED'} + 'UNDERCLOUD_PUBLIC_HOST_WRAPPED', 'NOTIFICATION_DRIVER'} """The variables we calculate in _generate_environment call.""" PUPPET_KEYS = DYNAMIC_KEYS | {opt.name.upper() for _, group in list_opts() @@ -1395,6 +1397,12 @@ def _generate_environment(instack_root): inspection_kernel_args.append('ipa-inspection-dhcp-all-interfaces=1') inspection_kernel_args.append('ipa-collect-lldp=1') + # set notification driver based on if we're using telemetry or not + if CONF.enable_telemetry: + instack_env['NOTIFICATION_DRIVER'] = 'messaging' + else: + instack_env['NOTIFICATION_DRIVER'] = 'noop' + instack_env['INSPECTION_KERNEL_ARGS'] = ' '.join(inspection_kernel_args) _process_drivers_and_hardware_types(instack_env)