diff --git a/deployment/puppet/openstack_tasks/manifests/ironic/ironic_compute.pp b/deployment/puppet/openstack_tasks/manifests/ironic/ironic_compute.pp index 8f84f9db03..e7d7492ede 100644 --- a/deployment/puppet/openstack_tasks/manifests/ironic/ironic_compute.pp +++ b/deployment/puppet/openstack_tasks/manifests/ironic/ironic_compute.pp @@ -77,6 +77,8 @@ class openstack_tasks::ironic::ironic_compute { $neutron_protocol = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'protocol', 'http') $neutron_endpoint = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'hostname', $neutron_endpoint_default) + $region_name = hiera('region', 'RegionOne') + if $nova_hash['notification_driver'] { $nova_notification_driver = $nova_hash['notification_driver'] } else { @@ -89,31 +91,32 @@ class openstack_tasks::ironic::ironic_compute { } class { '::nova': - ensure_package => installed, - database_connection => $db_connection, - rpc_backend => 'nova.openstack.common.rpc.impl_kombu', - #FIXME(bogdando) we have to split amqp_hosts until all modules synced - rabbit_hosts => split($amqp_hosts, ','), - rabbit_userid => $rabbit_hash['user'], - rabbit_password => $rabbit_hash['password'], - image_service => 'nova.image.glance.GlanceImageService', - glance_api_servers => $glance_api_servers, - verbose => $verbose, - debug => $debug, - use_syslog => $use_syslog, - use_stderr => $use_stderr, - notification_driver => $nova_notification_driver, - cinder_catalog_info => pick($nova_hash['cinder_catalog_info'], 'volumev2:cinderv2:internalURL'), - database_max_overflow => $max_overflow, - database_idle_timeout => $idle_timeout, - database_max_retries => $max_retries, - database_max_pool_size => $max_pool_size, - log_facility => $syslog_log_facility_nova, - state_path => $nova_hash['state_path'], - report_interval => $nova_report_interval, - service_down_time => $nova_service_down_time, - notify_on_state_change => $notify_on_state_change, - memcached_servers => $memcached_servers, + ensure_package => installed, + database_connection => $db_connection, + rpc_backend => 'nova.openstack.common.rpc.impl_kombu', + #FIXME(bogdando) we have to split amqp_hosts until all modules synced + rabbit_hosts => split($amqp_hosts, ','), + rabbit_userid => $rabbit_hash['user'], + rabbit_password => $rabbit_hash['password'], + image_service => 'nova.image.glance.GlanceImageService', + glance_api_servers => $glance_api_servers, + verbose => $verbose, + debug => $debug, + use_syslog => $use_syslog, + use_stderr => $use_stderr, + notification_driver => $nova_notification_driver, + cinder_catalog_info => pick($nova_hash['cinder_catalog_info'], 'volumev2:cinderv2:internalURL'), + database_max_overflow => $max_overflow, + database_idle_timeout => $idle_timeout, + database_max_retries => $max_retries, + database_max_pool_size => $max_pool_size, + log_facility => $syslog_log_facility_nova, + state_path => $nova_hash['state_path'], + report_interval => $nova_report_interval, + service_down_time => $nova_service_down_time, + notify_on_state_change => $notify_on_state_change, + memcached_servers => $memcached_servers, + os_region_name => $region_name, } class { '::nova::compute': diff --git a/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp b/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp index e4d7b45415..ff2d2d4a90 100644 --- a/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp +++ b/deployment/puppet/openstack_tasks/manifests/openstack_controller/openstack_controller.pp @@ -59,7 +59,7 @@ class openstack_tasks::openstack_controller::openstack_controller { $keystone_user = pick($nova_hash['user'], 'nova') $keystone_tenant = pick($nova_hash['tenant'], 'services') - $region = hiera('region', 'RegionOne') + $region_name = hiera('region', 'RegionOne') $workers_max = hiera('workers_max', 16) $service_workers = pick($nova_hash['workers'], min(max($::processorcount, 2), $workers_max)) @@ -209,6 +209,7 @@ class openstack_tasks::openstack_controller::openstack_controller { kombu_compression => $kombu_compression, rabbit_heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, rabbit_heartbeat_rate => $rabbit_heartbeat_rate, + os_region_name => $region_name, } # TODO(aschultz): this is being removed in M, do we need it? diff --git a/deployment/puppet/openstack_tasks/manifests/roles/compute.pp b/deployment/puppet/openstack_tasks/manifests/roles/compute.pp index 0e970e3ab4..9bccbb4905 100644 --- a/deployment/puppet/openstack_tasks/manifests/roles/compute.pp +++ b/deployment/puppet/openstack_tasks/manifests/roles/compute.pp @@ -50,6 +50,7 @@ class openstack_tasks::roles::compute { $libvirt_type = hiera('libvirt_type', undef) $kombu_compression = hiera('kombu_compression', $::os_service_default) $nova_cache = pick($nova_hash['use_cache'], true) + $region_name = hiera('region', 'RegionOne') $dpdk_config = hiera_hash('dpdk', {}) $enable_dpdk = pick($dpdk_config['enabled'], false) @@ -286,6 +287,7 @@ class openstack_tasks::roles::compute { block_device_allocate_retries_interval => $block_device_allocate_retries_interval, rabbit_heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, rabbit_heartbeat_rate => $rabbit_heartbeat_rate, + os_region_name => $region_name, } class { '::nova::cache': diff --git a/tests/noop/spec/hosts/ironic/ironic-compute_spec.rb b/tests/noop/spec/hosts/ironic/ironic-compute_spec.rb index dd7baa626e..62dc9e077f 100644 --- a/tests/noop/spec/hosts/ironic/ironic-compute_spec.rb +++ b/tests/noop/spec/hosts/ironic/ironic-compute_spec.rb @@ -43,6 +43,7 @@ describe manifest do let(:glance_protocol) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'glance','internal','protocol','http' } let(:glance_endpoint) { Noop.puppet_function 'get_ssl_property',ssl_hash,{},'glance','internal','hostname', glance_endpoint_default} let(:glance_api_servers) { Noop.hiera 'glance_api_servers', "#{glance_protocol}://#{glance_endpoint}:9292" } + let(:region_name) { Noop.hiera 'region', 'RegionOne' } if ironic_enabled it 'nova config should have correct ironic settings' do @@ -55,7 +56,8 @@ describe manifest do should contain_nova_config('DEFAULT/max_concurrent_builds').with(:value => '50') end - it 'nova config should have proper queue settings' do + it 'should configure region name in cinder section' do + should contain_nova_config('cinder/os_region_name').with_value(region_name) end it 'nova config should have reserved_host_memory_mb set to 0' do diff --git a/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb b/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb index f3fcb92244..d92a912928 100644 --- a/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb +++ b/tests/noop/spec/hosts/openstack-controller/openstack-controller_spec.rb @@ -127,6 +127,11 @@ describe manifest do let(:rabbit_heartbeat_timeout_threshold) { Noop.puppet_function 'pick', nova_hash['rabbit_heartbeat_timeout_threshold'], rabbit_hash['heartbeat_timeout_treshold'], 60 } let(:rabbit_heartbeat_rate) { Noop.puppet_function 'pick', nova_hash['rabbit_heartbeat_rate'], rabbit_hash['heartbeat_rate'], 2 } + let(:region_name) { Noop.hiera 'region', 'RegionOne' } + + it 'should configure region name in cinder section' do + should contain_nova_config('cinder/os_region_name').with_value(region_name) + end it 'should configure RabbitMQ Heartbeat parameters' do should contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value(rabbit_heartbeat_timeout_threshold) diff --git a/tests/noop/spec/hosts/roles/compute_spec.rb b/tests/noop/spec/hosts/roles/compute_spec.rb index e4e32c29b5..e41142bf39 100644 --- a/tests/noop/spec/hosts/roles/compute_spec.rb +++ b/tests/noop/spec/hosts/roles/compute_spec.rb @@ -80,6 +80,12 @@ describe manifest do let(:rabbit_heartbeat_timeout_threshold) { Noop.puppet_function 'pick', nova_hash['rabbit_heartbeat_timeout_threshold'], rabbit_hash['heartbeat_timeout_treshold'], 60 } let(:rabbit_heartbeat_rate) { Noop.puppet_function 'pick', nova_hash['rabbit_heartbeat_rate'], rabbit_hash['heartbeat_rate'], 2 } + let(:region_name) { Noop.hiera 'region', 'RegionOne' } + + it 'should configure region name in cinder section' do + should contain_nova_config('cinder/os_region_name').with_value(region_name) + end + it 'should configure RabbitMQ Heartbeat parameters' do should contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value(rabbit_heartbeat_timeout_threshold) should contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value(rabbit_heartbeat_rate)