Skip to content

Commit

Permalink
Add the resume_guests_state_on_host_boot option to nova::compute
Browse files Browse the repository at this point in the history
Adds the resume_guests_state_on_host_boot parameter to the
nova::compute class. When a compute node is restarted and having
this option set to true will ensure that any guests that were running
when the node was rebooted will be started up again.

Default value for the resume_guests_state_on_host_boot in the nova
code is False.

Change-Id: I8b7ba48c68aefa9e1fd7092e9e64b9567d138dcf
  • Loading branch information
Tobias Urdin committed Dec 23, 2016
1 parent 58ff414 commit f9a8599
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions manifests/compute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@
# for virtual machine processes
# Defaults to $::os_service_default
#
# [*resume_guests_state_on_host_boot*]
# (optional) This option specifies whether to start guests that were running before the
# host rebooted. It ensures that all of the instances on a Nova compute node
# resume their state each time the compute node boots or restarts.
# Defaults to $::os_service_default
#
# [*keymgr_api_class*]
# (optional) Key Manager service.
# Example of valid value: castellan.key_manager.barbican_key_manager.BarbicanKeyManager
Expand Down Expand Up @@ -182,6 +188,7 @@
$allow_resize_to_same_host = false,
$resize_confirm_window = $::os_service_default,
$vcpu_pin_set = $::os_service_default,
$resume_guests_state_on_host_boot = $::os_service_default,
$keymgr_api_class = $::os_service_default,
$barbican_auth_endpoint = $::os_service_default,
$barbican_endpoint = $::os_service_default,
Expand Down Expand Up @@ -245,6 +252,7 @@
'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;
'DEFAULT/resume_guests_state_on_host_boot': value => $resume_guests_state_on_host_boot;
'key_manager/api_class': value => $keymgr_api_class;
'barbican/auth_endpoint': value => $barbican_auth_endpoint;
'barbican/barbican_endpoint': value => $barbican_endpoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
features:
- Adds the resume_guests_state_on_host_boot config parameter to nova compute
6 changes: 6 additions & 0 deletions spec/classes/nova_compute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
it { is_expected.to contain_nova_config('DEFAULT/allow_resize_to_same_host').with(:value => 'false') }
it { is_expected.to contain_nova_config('DEFAULT/resize_confirm_window').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('DEFAULT/vcpu_pin_set').with(:value => '<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with_value('<SERVICE DEFAULT>') }
it { is_expected.to_not contain_nova_config('vnc/novncproxy_base_url') }
it { is_expected.to contain_nova_config('key_manager/api_class').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_nova_config('barbican/barbican_endpoint').with_value('<SERVICE DEFAULT>') }
Expand Down Expand Up @@ -76,6 +77,7 @@
:config_drive_format => 'vfat',
:resize_confirm_window => '3',
:vcpu_pin_set => ['4-12','^8','15'],
:resume_guests_state_on_host_boot => true,
:keymgr_api_class => 'castellan.key_manager.barbican_key_manager.BarbicanKeyManager',
:barbican_endpoint => 'http://localhost',
:barbican_api_version => 'v1',
Expand Down Expand Up @@ -137,11 +139,14 @@

it { is_expected.to contain_nova_config('DEFAULT/max_concurrent_live_migrations').with_value('4') }

it { is_expected.to contain_nova_config('DEFAULT/resume_guests_state_on_host_boot').with_value(true) }

it 'configures nova pci_passthrough_whitelist entries' do
is_expected.to contain_nova_config('DEFAULT/pci_passthrough_whitelist').with(
'value' => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"physical_network\":\"physnet1\"}]"
)
end

it 'configures nova config_drive_format to vfat' do
is_expected.to contain_nova_config('DEFAULT/config_drive_format').with_value('vfat')
is_expected.to_not contain_package('genisoimage').with(
Expand Down Expand Up @@ -252,6 +257,7 @@
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit').with_value(true) }
it { is_expected.to contain_nova_config('DEFAULT/instance_usage_audit_period').with_value('year') }
end

context 'with vnc_keymap set to fr' do
let :params do
{ :vnc_keymap => 'fr', }
Expand Down

0 comments on commit f9a8599

Please sign in to comment.