Add support for [libvirt] wait_soft_reboot_seconds

Change-Id: I68b81ef44f3c6f6c92d9bdb2b2a18091706ff99b
This commit is contained in:
Takashi Kajinami 2022-09-04 23:09:07 +09:00
parent ba583fadf4
commit 9fb6c87378
3 changed files with 18 additions and 0 deletions

View File

@ -213,6 +213,13 @@
# run concurrently on this compute host. # run concurrently on this compute host.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*wait_soft_reboot_seconds*]
# (optional) Number of seconds to wait for instance to shut down after soft
# reboot request is made.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETRS
#
# [*log_outputs*] # [*log_outputs*]
# (optional) Defines log outputs, as specified in # (optional) Defines log outputs, as specified in
# https://libvirt.org/logging.html # https://libvirt.org/logging.html
@ -276,6 +283,7 @@ class nova::compute::libvirt (
$swtpm_group = $::os_service_default, $swtpm_group = $::os_service_default,
$max_queues = $::os_service_default, $max_queues = $::os_service_default,
$num_memory_encrypted_guests = $::os_service_default, $num_memory_encrypted_guests = $::os_service_default,
$wait_soft_reboot_seconds = $::os_service_default,
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$log_outputs = undef, $log_outputs = undef,
$log_filters = undef, $log_filters = undef,
@ -387,6 +395,7 @@ class nova::compute::libvirt (
'libvirt/swtpm_group': value => $swtpm_group; 'libvirt/swtpm_group': value => $swtpm_group;
'libvirt/max_queues': value => $max_queues; 'libvirt/max_queues': value => $max_queues;
'libvirt/num_memory_encrypted_guests': value => $num_memory_encrypted_guests; 'libvirt/num_memory_encrypted_guests': value => $num_memory_encrypted_guests;
'libvirt/wait_soft_reboot_seconds': value => $wait_soft_reboot_seconds;
} }
validate_legacy(Array, 'validate_array', $cpu_models) validate_legacy(Array, 'validate_array', $cpu_models)

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``nova::compute::libvirt::wait_soft_reboot_seconds`` parameter has
been added.

View File

@ -75,6 +75,7 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('libvirt/swtpm_group').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_nova_config('libvirt/swtpm_group').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/max_queues').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_nova_config('libvirt/max_queues').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/num_memory_encrypted_guests').with_value('<SERVICE DEFAULT>')} it { is_expected.to contain_nova_config('libvirt/num_memory_encrypted_guests').with_value('<SERVICE DEFAULT>')}
it { is_expected.to contain_nova_config('libvirt/wait_soft_reboot_seconds').with_value('<SERVICE DEFAULT>')}
end end
describe 'with params' do describe 'with params' do
@ -117,6 +118,7 @@ describe 'nova::compute::libvirt' do
:max_queues => 4, :max_queues => 4,
:num_memory_encrypted_guests => 255, :num_memory_encrypted_guests => 255,
:modular_libvirt => true, :modular_libvirt => true,
:wait_soft_reboot_seconds => 120,
} }
end end
@ -153,6 +155,8 @@ describe 'nova::compute::libvirt' do
it { is_expected.to contain_nova_config('libvirt/swtpm_group').with_value('libvirt')} it { is_expected.to contain_nova_config('libvirt/swtpm_group').with_value('libvirt')}
it { is_expected.to contain_nova_config('libvirt/max_queues').with_value(4)} it { is_expected.to contain_nova_config('libvirt/max_queues').with_value(4)}
it { is_expected.to contain_nova_config('libvirt/num_memory_encrypted_guests').with_value(255)} it { is_expected.to contain_nova_config('libvirt/num_memory_encrypted_guests').with_value(255)}
it { is_expected.to contain_nova_config('libvirt/wait_soft_reboot_seconds').with_value(120)}
it { it {
is_expected.to contain_service('libvirt').with( is_expected.to contain_service('libvirt').with(
:name => 'custom_service', :name => 'custom_service',