Allow to set allow_resize_to_same_host in nova-api

To be able to resize a ephemeral node, we need to set
allow_resize_to_same_host to true in nova-api.

By default the value will be set to false as the openstack default.

Co-Author: Cyril Lopez <cylopez@redhat.com>

Change-Id: Idc5710d72c3dcffdd34eb1b7203c47b681b44c53
Closes-bug: #1535606
(cherry picked from commit 455d69ae18)
This commit is contained in:
Matt Fischer 2016-09-20 22:43:09 -06:00 committed by Tobias Urdin
parent ba8001822a
commit 58bf484a13
4 changed files with 25 additions and 5 deletions

View File

@ -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 })
}

View File

@ -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
#
# [*resize_confirm_window*]
# (optional) Automatically confirm resizes after N seconds.
@ -252,7 +253,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/resize_confirm_window': value => $resize_confirm_window;
'DEFAULT/vcpu_pin_set': value => $vcpu_pin_set_real;
@ -263,6 +263,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

View File

@ -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.

View File

@ -80,6 +80,7 @@ describe 'nova::api' do
is_expected.to contain_nova_config('DEFAULT/enable_network_quota').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/enable_instance_password').with('value' => '<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/password_length').with('value' => '<SERVICE DEFAULT>')
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