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

Depends-on: https://review.opendev.org/850298
Change-Id: Ic4ceaf703b897c7266d802f5394ae065ef2d11a1
This commit is contained in:
Takashi Kajinami 2022-07-19 18:05:31 +09:00
parent df93450262
commit 05a1a03960
3 changed files with 27 additions and 0 deletions

View File

@ -198,6 +198,15 @@
# ramdisk. Set to 0 to disable timeout. (integer value)
# 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
#
# [*cleaning_network_name*]
@ -260,6 +269,8 @@ class ironic::conductor (
$allow_provisioning_in_maintenance = $::os_service_default,
$image_download_concurrency = $::os_service_default,
$deploy_callback_timeout = $::os_service_default,
$heartbeat_interval = $::os_service_default,
$heartbeat_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$cleaning_network_name = undef,
$provisioning_network_name = undef,
@ -349,6 +360,8 @@ class ironic::conductor (
'conductor/allow_provisioning_in_maintenance': value => $allow_provisioning_in_maintenance;
'DEFAULT/image_download_concurrency': value => $image_download_concurrency;
'conductor/deploy_callback_timeout': value => $deploy_callback_timeout;
'conductor/heartbeat_interval': value => $heartbeat_interval;
'conductor/heartbeat_timeout': value => $heartbeat_timeout;
}
if $cleaning_network_name {

View File

@ -0,0 +1,8 @@
---
features:
- |
The ``ironic::conductor`` class now supports the following two new
parameters.
- ``heartbeat_interval``
- ``heartbeat_timeout``

View File

@ -91,6 +91,8 @@ describe 'ironic::conductor' do
is_expected.to contain_ironic_config('conductor/bootloader').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('DEFAULT/image_download_concurrency').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/deploy_callback_timeout').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/heartbeat_interval').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('conductor/heartbeat_timeout').with(:value => '<SERVICE DEFAULT>')
end
context 'when overriding parameters' do
@ -128,6 +130,8 @@ describe 'ironic::conductor' do
:allow_provisioning_in_maintenance => false,
:image_download_concurrency => 20,
:deploy_callback_timeout => 1800,
:heartbeat_interval => 10,
:heartbeat_timeout => 60,
)
end
it 'should replace default parameter with new value' do
@ -164,6 +168,8 @@ describe 'ironic::conductor' do
is_expected.to contain_ironic_config('conductor/allow_provisioning_in_maintenance').with_value(p[:allow_provisioning_in_maintenance])
is_expected.to contain_ironic_config('DEFAULT/image_download_concurrency').with_value(p[:image_download_concurrency])
is_expected.to contain_ironic_config('conductor/deploy_callback_timeout').with_value(p[:deploy_callback_timeout])
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