From a3c3ab160775f9554f5dd8b6ead5c226f91021d3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 19 Jul 2022 18:05:31 +0900 Subject: [PATCH] conductor: Support tuning of heartbeats This change adds support for the following parameters so that users can tune heart beats in the ironic-conductor service. - [conductor] heartbeat_interval - [conductor] heartbeat_timeout Conflicts: manifests/conductor.pp spec/classes/ironic_conductor_spec.rb (to xena) Conflicts: manifests/conductor.pp spec/classes/ironic_conductor_spec.rb Depends-on: https://review.opendev.org/850298 Change-Id: Ic4ceaf703b897c7266d802f5394ae065ef2d11a1 (cherry picked from commit 05a1a039609a5f686a025bbbe96afe6e65bc5b68) (cherry picked from commit 899e7e8bfc12e025edb4e5bbd60488c9bd684966) (cherry picked from commit 1fcfe39536e04e5693b2abc0d86cc3bec9317cbe) (cherry picked from commit d80f2bfd7b2e6b35f855d7656bb4b2f90c8a2af1) --- manifests/conductor.pp | 13 +++++++++++++ .../notes/conductor-heartbeat-d92790f3e6a59c4b.yaml | 8 ++++++++ spec/classes/ironic_conductor_spec.rb | 6 ++++++ 3 files changed, 27 insertions(+) create mode 100644 releasenotes/notes/conductor-heartbeat-d92790f3e6a59c4b.yaml diff --git a/manifests/conductor.pp b/manifests/conductor.pp index bf1bdce0..0dd7c459 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -193,6 +193,15 @@ # after the next heartbeat. # Defaults to $::os_service_default # +# [*heartbeat_interval*] +# (optional) Seconds between conductor heart beats. +# Defaults to $::os_service_default +# +# [*heartbeat_timeout*] +# (optional) Maximum time (in seconds) since the last check-in of +# a conductor. +# Defaults to $::os_service_default +# # DEPRECATED PARAMETERS # # [*max_time_interval*] @@ -249,6 +258,8 @@ class ironic::conductor ( $rescue_kernel = $::os_service_default, $rescue_ramdisk = $::os_service_default, $allow_provisioning_in_maintenance = $::os_service_default, + $heartbeat_interval = $::os_service_default, + $heartbeat_timeout = $::os_service_default, # DEPRECATED PARAMETERS $max_time_interval = undef, $api_url = undef, @@ -374,6 +385,8 @@ Use inspect_wait_timeout instead') 'conductor/rescue_kernel': value => $rescue_kernel; 'conductor/rescue_ramdisk': value => $rescue_ramdisk; 'conductor/allow_provisioning_in_maintenance': value => $allow_provisioning_in_maintenance; + 'conductor/heartbeat_interval': value => $heartbeat_interval; + 'conductor/heartbeat_timeout': value => $heartbeat_timeout; } if $cleaning_network_name { diff --git a/releasenotes/notes/conductor-heartbeat-d92790f3e6a59c4b.yaml b/releasenotes/notes/conductor-heartbeat-d92790f3e6a59c4b.yaml new file mode 100644 index 00000000..898bd41f --- /dev/null +++ b/releasenotes/notes/conductor-heartbeat-d92790f3e6a59c4b.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The ``ironic::conductor`` class now supports the following two new + parameters. + + - ``heartbeat_interval`` + - ``heartbeat_timeout`` diff --git a/spec/classes/ironic_conductor_spec.rb b/spec/classes/ironic_conductor_spec.rb index 732ce0b0..00a7b03f 100644 --- a/spec/classes/ironic_conductor_spec.rb +++ b/spec/classes/ironic_conductor_spec.rb @@ -83,6 +83,8 @@ describe 'ironic::conductor' do is_expected.to contain_ironic_config('conductor/power_state_sync_max_retries').with(:value => '') is_expected.to contain_ironic_config('conductor/power_failure_recovery_interval').with(:value => '') is_expected.to contain_ironic_config('conductor/conductor_group').with(:value => '') + is_expected.to contain_ironic_config('conductor/heartbeat_interval').with(:value => '') + is_expected.to contain_ironic_config('conductor/heartbeat_timeout').with(:value => '') end context 'when overriding parameters' do @@ -116,6 +118,8 @@ describe 'ironic::conductor' do :rescue_kernel => 'http://host/rescue.kernel', :rescue_ramdisk => 'http://host/rescue.ramdisk', :allow_provisioning_in_maintenance => false, + :heartbeat_interval => 10, + :heartbeat_timeout => 60, ) end it 'should replace default parameter with new value' do @@ -148,6 +152,8 @@ describe 'ironic::conductor' do is_expected.to contain_ironic_config('conductor/rescue_kernel').with_value(p[:rescue_kernel]) is_expected.to contain_ironic_config('conductor/rescue_ramdisk').with_value(p[:rescue_ramdisk]) is_expected.to contain_ironic_config('conductor/allow_provisioning_in_maintenance').with_value(p[:allow_provisioning_in_maintenance]) + is_expected.to contain_ironic_config('conductor/heartbeat_interval').with_value(p[:heartbeat_interval]) + is_expected.to contain_ironic_config('conductor/heartbeat_timeout').with_value(p[:heartbeat_timeout]) end end