l3: Support more tunable options for HA feature

Change-Id: If45b1cea45db7ac8a7c9c5cc17c800775c34b55e
This commit is contained in:
Takashi Kajinami
2024-09-16 00:06:53 +09:00
parent f40c3138f6
commit 7491cf6abe
3 changed files with 81 additions and 53 deletions

View File

@@ -58,6 +58,15 @@
# (optional) The advertisement interval in seconds. # (optional) The advertisement interval in seconds.
# Defaults to $facts['os_service_default'] # Defaults to $facts['os_service_default']
# #
# [*ha_vrrp_health_check_interval*]
# (optional) The VRRP health check interval in seconds.
# Defaults to $facts['os_service_default']
#
# [*ha_keepalived_state_change_server_threads*]
# (optional) Number of concurrent threads for keepalived server connection
# requests.
# Defaults to $facts['os_service_default']
#
# [*agent_mode*] # [*agent_mode*]
# (optional) The working mode for the agent. # (optional) The working mode for the agent.
# 'legacy': default behavior (without DVR) # 'legacy': default behavior (without DVR)
@@ -146,6 +155,8 @@ class neutron::agents::l3 (
$ha_vrrp_auth_type = $facts['os_service_default'], $ha_vrrp_auth_type = $facts['os_service_default'],
$ha_vrrp_auth_password = $facts['os_service_default'], $ha_vrrp_auth_password = $facts['os_service_default'],
$ha_vrrp_advert_int = $facts['os_service_default'], $ha_vrrp_advert_int = $facts['os_service_default'],
$ha_keepalived_state_change_server_threads = $facts['os_service_default'],
$ha_vrrp_health_check_interval = $facts['os_service_default'],
$agent_mode = $facts['os_service_default'], $agent_mode = $facts['os_service_default'],
$availability_zone = $facts['os_service_default'], $availability_zone = $facts['os_service_default'],
$extensions = $facts['os_service_default'], $extensions = $facts['os_service_default'],
@@ -185,6 +196,8 @@ class neutron::agents::l3 (
'DEFAULT/ha_vrrp_auth_type': value => $ha_vrrp_auth_type; 'DEFAULT/ha_vrrp_auth_type': value => $ha_vrrp_auth_type;
'DEFAULT/ha_vrrp_auth_password': value => $ha_vrrp_auth_password, secret => true; 'DEFAULT/ha_vrrp_auth_password': value => $ha_vrrp_auth_password, secret => true;
'DEFAULT/ha_vrrp_advert_int': value => $ha_vrrp_advert_int; 'DEFAULT/ha_vrrp_advert_int': value => $ha_vrrp_advert_int;
'DEFAULT/ha_keepalived_state_change_server_threads': value => $ha_keepalived_state_change_server_threads;
'DEFAULT/ha_vrrp_health_check_interval': value => $ha_vrrp_health_check_interval;
'DEFAULT/agent_mode': value => $agent_mode; 'DEFAULT/agent_mode': value => $agent_mode;
'DEFAULT/radvd_user': value => $radvd_user; 'DEFAULT/radvd_user': value => $radvd_user;
'ovs/integration_bridge': value => $ovs_integration_bridge; 'ovs/integration_bridge': value => $ovs_integration_bridge;

View File

@@ -0,0 +1,8 @@
---
features:
- |
The following parameters have been added to the ``neutron::agents::l3``
class.
- ``ha_keepalived_state_change_server_threads``
- ``ha_vrrp_health_check_interval``

View File

@@ -34,6 +34,8 @@ describe 'neutron::agents::l3' do
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_type').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_type').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_password').with_value('<SERVICE DEFAULT>').with_secret(true) should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_password').with_value('<SERVICE DEFAULT>').with_secret(true)
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_advert_int').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_advert_int').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/ha_keepalived_state_change_server_threads').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_health_check_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/agent_mode').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('DEFAULT/agent_mode').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('DEFAULT/radvd_user').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('DEFAULT/radvd_user').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('ovs/integration_bridge').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('ovs/integration_bridge').with_value('<SERVICE DEFAULT>')
@@ -111,18 +113,23 @@ describe 'neutron::agents::l3' do
end end
end end
context 'with HA routers' do context 'with HA options' do
before :each do before :each do
params.merge!({ params.merge!({
:ha_vrrp_auth_type => 'PASS', :ha_vrrp_auth_type => 'PASS',
:ha_vrrp_auth_password => 'secrete', :ha_vrrp_auth_password => 'secrete',
:ha_vrrp_advert_int => 3, :ha_vrrp_advert_int => 3,
:ha_keepalived_state_change_server_threads => 2,
:ha_vrrp_health_check_interval => 0,
}) })
end end
it 'should configure VRRP' do it 'should configure VRRP' do
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_type').with_value(p[:ha_vrrp_auth_type]) should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_type').with_value(p[:ha_vrrp_auth_type])
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_password').with_value(p[:ha_vrrp_auth_password]).with_secret(true) should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_auth_password').with_value(p[:ha_vrrp_auth_password]).with_secret(true)
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_advert_int').with_value(p[:ha_vrrp_advert_int]) should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_advert_int').with_value(p[:ha_vrrp_advert_int])
should contain_neutron_l3_agent_config('DEFAULT/ha_keepalived_state_change_server_threads').with_value(
p[:ha_keepalived_state_change_server_threads])
should contain_neutron_l3_agent_config('DEFAULT/ha_vrrp_health_check_interval').with_value(p[:ha_vrrp_health_check_interval])
end end
end end