From 4de9ee3f54cb47059f02773c9a35e664efa075ef Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 3 Jul 2018 16:48:36 +0200 Subject: [PATCH] Expose power sync parameters A busy environment is likely to tune these parameters, let's expose them. Conflicts: manifests/conductor.pp Change-Id: Ide6de7f7a147e15b2941706f282455baa9d8f671 (cherry picked from commit 5310a06d4611ede31980e08cf1662ef1beaaad6f) --- manifests/conductor.pp | 14 ++++++++++++++ .../power-sync-parameters-d168a56a376b9c1e.yaml | 5 +++++ spec/classes/ironic_conductor_spec.rb | 8 +++++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/power-sync-parameters-d168a56a376b9c1e.yaml diff --git a/manifests/conductor.pp b/manifests/conductor.pp index 25b2d199..419b0703 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -140,6 +140,16 @@ # so that the baremetal node is in the desired new power state. # Defaults to $::os_service_default # +# [*sync_power_state_interval*] +# (optional) Interval between syncing the node power state to the database, +# in seconds. +# Defaults to $::os_service_default +# +# [*power_state_sync_max_retries*] +# (optional) The number of times Ironic should try syncing the hardware node +# power state with the node power state in the database. +# Defaults to $::os_service_default +# # DEPRECATED # # [*cleaning_network_uuid*] @@ -190,6 +200,8 @@ class ironic::conductor ( $provisioning_network_name = undef, $rescuing_network_name = undef, $power_state_change_timeout = $::os_service_default, + $sync_power_state_interval = $::os_service_default, + $power_state_sync_max_retries = $::os_service_default, # DEPRECATED $cleaning_network_uuid = undef, $provisioning_network_uuid = undef, @@ -293,6 +305,8 @@ moved to ironic::glance manifest") 'deploy/default_boot_option': value => $default_boot_option; 'neutron/port_setup_delay': value => $port_setup_delay; 'conductor/power_state_change_timeout': value => $power_state_change_timeout; + 'conductor/sync_power_state_interval': value => $sync_power_state_interval; + 'conductor/power_state_sync_max_retries': value => $power_state_sync_max_retries; } if $cleaning_network_name { diff --git a/releasenotes/notes/power-sync-parameters-d168a56a376b9c1e.yaml b/releasenotes/notes/power-sync-parameters-d168a56a376b9c1e.yaml new file mode 100644 index 00000000..ec60b02a --- /dev/null +++ b/releasenotes/notes/power-sync-parameters-d168a56a376b9c1e.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Expose the ``sync_power_state_interval`` and + ``power_state_sync_max_retries`` parametes in ``ironic::conductor``. diff --git a/spec/classes/ironic_conductor_spec.rb b/spec/classes/ironic_conductor_spec.rb index 86371cce..52938563 100644 --- a/spec/classes/ironic_conductor_spec.rb +++ b/spec/classes/ironic_conductor_spec.rb @@ -81,6 +81,8 @@ describe 'ironic::conductor' do is_expected.to contain_ironic_config('deploy/default_boot_option').with(:value => '') is_expected.to contain_ironic_config('neutron/port_setup_delay').with(:value => '') is_expected.to contain_ironic_config('conductor/power_state_change_timeout').with(:value => '') + is_expected.to contain_ironic_config('conductor/sync_power_state_interval').with(:value => '') + is_expected.to contain_ironic_config('conductor/power_state_sync_max_retries').with(:value => '') end context 'when overriding parameters' do @@ -102,7 +104,9 @@ describe 'ironic::conductor' do :configdrive_swift_container => 'cont', :default_boot_option => 'local', :port_setup_delay => '15', - :power_state_change_timeout => '300' + :power_state_change_timeout => '300', + :sync_power_state_interval => 120, + :power_state_sync_max_retries => 5, ) end it 'should replace default parameter with new value' do @@ -124,6 +128,8 @@ describe 'ironic::conductor' do is_expected.to contain_ironic_config('deploy/default_boot_option').with_value(p[:default_boot_option]) is_expected.to contain_ironic_config('neutron/port_setup_delay').with_value(p[:port_setup_delay]) is_expected.to contain_ironic_config('conductor/power_state_change_timeout').with_value(p[:power_state_change_timeout]) + is_expected.to contain_ironic_config('conductor/sync_power_state_interval').with_value(p[:sync_power_state_interval]) + is_expected.to contain_ironic_config('conductor/power_state_sync_max_retries').with_value(p[:power_state_sync_max_retries]) end end