From a47853c485a13c30800170fc133f0aa6a6c78acb Mon Sep 17 00:00:00 2001 From: Oliver Walsh Date: Thu, 17 Oct 2019 21:43:43 +0100 Subject: [PATCH] Include nova::availability_zone in nova::api and nova::conductor For some reason this was included in nova::compute and nova::scheduler but never included in nova::api eventhough bug #1529065 specifically calls out the fact that it is missing. Looking at the code - nova-api definitely requires it. E.g the server create request handler sets the target AZ to CONF.default_schedule_zone if none https://github.com/openstack/nova/blob/stable/queens/nova/api/openstack/compute/servers.py#L486 and the az request handler skips the internal_service_availabily_zone when listing AZs https://github.com/openstack/nova/blob/stable/queens/nova/api/openstack/compute/availability_zone.py#L38 nova-conductor also requires it as it calls availability_zones.get_host_availability_zone which defaults to CONF.default_availability_zone Change-Id: If4d6a4a8f4cc1e7066cacb00da67d5433acd6ac5 Closes-bug: #1529065 (cherry picked from commit d7eb253e4de03c05eb6597db0959e4137831ad91) (cherry picked from commit 57ff2a154c0e50da4a833ffabfef27a8d0db4fb6) (cherry picked from commit 75d67bd6c8ff0fd147e1ac7516ede2bc60d960b2) (cherry picked from commit effda25202c9270b843e113c12edef5b80130559) --- manifests/api.pp | 1 + manifests/conductor.pp | 1 + spec/classes/nova_api_spec.rb | 2 ++ spec/classes/nova_compute_spec.rb | 6 +----- spec/classes/nova_conductor_spec.rb | 2 ++ spec/classes/nova_scheduler_spec.rb | 2 ++ 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index e6bfdcd0c..268ce44c9 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -341,6 +341,7 @@ class nova::api( include ::nova::db include ::nova::policy include ::nova::keystone::authtoken + include ::nova::availability_zone if $install_cinder_client { include ::cinder::client diff --git a/manifests/conductor.pp b/manifests/conductor.pp index bc7d8c6bf..a8e835d30 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -39,6 +39,7 @@ class nova::conductor( include ::nova::db include ::nova::params include ::nova::workarounds + include ::nova::availability_zone nova::generic_service { 'conductor': enabled => $enabled, diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index 3a87c1aff..130d83dd6 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -44,6 +44,8 @@ describe 'nova::api' do it { is_expected.to contain_nova_config('DEFAULT/instance_name_template').with_ensure('absent')} + it { is_expected.to contain_class('nova::availability_zone') } + it 'configures various stuff' do is_expected.to contain_nova_config('wsgi/api_paste_config').with('value' => 'api-paste.ini') is_expected.to contain_nova_config('DEFAULT/osapi_compute_listen').with('value' => '0.0.0.0') diff --git a/spec/classes/nova_compute_spec.rb b/spec/classes/nova_compute_spec.rb index c0ea5c27d..f82ad257b 100644 --- a/spec/classes/nova_compute_spec.rb +++ b/spec/classes/nova_compute_spec.rb @@ -46,11 +46,7 @@ describe 'nova::compute' do it { is_expected.to contain_nova_config('DEFAULT/force_raw_images').with(:value => true) } - it 'configures availability zones' do - is_expected.to contain_nova_config('DEFAULT/default_availability_zone').with_value('') - is_expected.to contain_nova_config('DEFAULT/default_schedule_zone').with_value('') - is_expected.to contain_nova_config('DEFAULT/internal_service_availability_zone').with_value('') - end + it { is_expected.to contain_class('nova::availability_zone') } it { is_expected.to contain_nova_config('DEFAULT/heal_instance_info_cache_interval').with_value('60') } diff --git a/spec/classes/nova_conductor_spec.rb b/spec/classes/nova_conductor_spec.rb index a0f4cfead..8008ba457 100644 --- a/spec/classes/nova_conductor_spec.rb +++ b/spec/classes/nova_conductor_spec.rb @@ -20,6 +20,8 @@ describe 'nova::conductor' do :ensure => 'running' )} + it { is_expected.to contain_class('nova::availability_zone') } + context 'with manage_service as false' do let :params do { :enabled => true, diff --git a/spec/classes/nova_scheduler_spec.rb b/spec/classes/nova_scheduler_spec.rb index c058ffd7c..4a5c9f5c4 100644 --- a/spec/classes/nova_scheduler_spec.rb +++ b/spec/classes/nova_scheduler_spec.rb @@ -23,6 +23,8 @@ describe 'nova::scheduler' do it { is_expected.to contain_nova_config('scheduler/driver').with_value('filter_scheduler') } it { is_expected.to contain_nova_config('scheduler/discover_hosts_in_cells_interval').with_value('') } + it { is_expected.to contain_class('nova::availability_zone') } + context 'with manage_service as false' do let :params do { :enabled => true,