diff --git a/manifests/api.pp b/manifests/api.pp index 82a3c92ba..479972378 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -199,6 +199,12 @@ # (optional) Whether the cinder::client class should be used to install the cinder client. # Defaults to true # +# [*allow_resize_to_same_host*] +# (optional) Allow destination machine to match source for resize. Note that this +# is also settable in the compute class. In some sitautions you need it set here +# and in others you need it set there. +# Defaults to false +# # DEPRECATED # # [*keystone_ec2_url*] @@ -298,6 +304,7 @@ class nova::api( $enable_instance_password = $::os_service_default, $password_length = $::os_service_default, $install_cinder_client = true, + $allow_resize_to_same_host = false, # DEPRECATED PARAMETER $conductor_workers = undef, $ec2_listen_port = undef, @@ -532,4 +539,6 @@ as a standalone service, or httpd for being run by a httpd server") $validation_options_hash = merge ($defaults, $validation_options) create_resources('openstacklib::service_validation', $validation_options_hash, {'subscribe' => 'Service[nova-api]'}) } + + ensure_resource('nova_config', 'DEFAULT/allow_resize_to_same_host', { value => $allow_resize_to_same_host }) } diff --git a/manifests/compute.pp b/manifests/compute.pp index 3710947b9..4368ae65b 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -95,9 +95,10 @@ # Defaults to undef # # [*allow_resize_to_same_host*] -# (optional) Allow destination machine to match source for resize. -# Useful when testing in single-host environments. -# Defaults to false +# (optional) Allow destination machine to match source for resize. +# Useful when testing in single-host environments. Note that this +# can also be set in the api.pp class. +# Defaults to false # # [*vcpu_pin_set*] # (optional) A list or range of physical CPU cores to reserve @@ -233,7 +234,6 @@ is used. It will be removed once Nova removes it.") 'DEFAULT/reserved_host_memory_mb': value => $reserved_host_memory; 'DEFAULT/compute_manager': value => $compute_manager; 'DEFAULT/heal_instance_info_cache_interval': value => $heal_instance_info_cache_interval; - 'DEFAULT/allow_resize_to_same_host': value => $allow_resize_to_same_host; 'DEFAULT/pci_passthrough_whitelist': value => $pci_passthrough_real; 'DEFAULT/vcpu_pin_set': value => $vcpu_pin_set_real; 'key_manager/api_class': value => $keymgr_api_class; @@ -242,6 +242,8 @@ is used. It will be removed once Nova removes it.") 'barbican/barbican_api_version': value => $barbican_api_version; } + ensure_resource('nova_config', 'DEFAULT/allow_resize_to_same_host', { value => $allow_resize_to_same_host }) + if ($vnc_enabled) { include ::nova::vncproxy::common diff --git a/releasenotes/notes/allow_resize_to_same_host_in_nova_api-b9c171d80404e009.yaml b/releasenotes/notes/allow_resize_to_same_host_in_nova_api-b9c171d80404e009.yaml new file mode 100644 index 000000000..7d216fb1c --- /dev/null +++ b/releasenotes/notes/allow_resize_to_same_host_in_nova_api-b9c171d80404e009.yaml @@ -0,0 +1,6 @@ +--- +features: + - allow_resize_to_same_host can now be set in nova-api. + For ephemeral nodes, this needs to only be set + in nova-api and so including the other classes is + overkill. diff --git a/spec/classes/nova_api_spec.rb b/spec/classes/nova_api_spec.rb index 26303473c..ce83fa175 100644 --- a/spec/classes/nova_api_spec.rb +++ b/spec/classes/nova_api_spec.rb @@ -80,6 +80,7 @@ describe 'nova::api' do is_expected.to contain_nova_config('DEFAULT/enable_network_quota').with('value' => '') is_expected.to contain_nova_config('DEFAULT/enable_instance_password').with('value' => '') is_expected.to contain_nova_config('DEFAULT/password_length').with('value' => '') + is_expected.to contain_nova_config('DEFAULT/allow_resize_to_same_host').with('value' => false) end it 'unconfigures neutron_metadata proxy' do @@ -124,7 +125,8 @@ describe 'nova::api' do :enable_network_quota => false, :enable_instance_password => true, :password_length => 12, - :pci_alias => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]" + :pci_alias => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\",\"name\":\"graphic_card\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"name\":\"network_card\"}]", + :allow_resize_to_same_host => true, }) end @@ -185,6 +187,7 @@ describe 'nova::api' do is_expected.to contain_nova_config('DEFAULT/enable_network_quota').with('value' => false) is_expected.to contain_nova_config('DEFAULT/enable_instance_password').with('value' => true) is_expected.to contain_nova_config('DEFAULT/password_length').with('value' => '12') + is_expected.to contain_nova_config('DEFAULT/allow_resize_to_same_host').with('value' => true) end it 'configures nova pci_alias entries' do