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.
# 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*]
# (optional) The working mode for the agent.
# 'legacy': default behavior (without DVR)
@@ -133,34 +142,36 @@
# Defaults to undef
#
class neutron::agents::l3 (
$package_ensure = 'present',
Boolean $enabled = true,
Boolean $manage_service = true,
$debug = $facts['os_service_default'],
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$handle_internal_only_routers = $facts['os_service_default'],
$metadata_port = $facts['os_service_default'],
$periodic_interval = $facts['os_service_default'],
$periodic_fuzzy_delay = $facts['os_service_default'],
$enable_metadata_proxy = $facts['os_service_default'],
$ha_vrrp_auth_type = $facts['os_service_default'],
$ha_vrrp_auth_password = $facts['os_service_default'],
$ha_vrrp_advert_int = $facts['os_service_default'],
$agent_mode = $facts['os_service_default'],
$availability_zone = $facts['os_service_default'],
$extensions = $facts['os_service_default'],
$report_interval = $facts['os_service_default'],
$rpc_response_max_timeout = $facts['os_service_default'],
$radvd_user = $facts['os_service_default'],
$ovs_integration_bridge = $facts['os_service_default'],
$ovsdb_connection = $facts['os_service_default'],
$ovsdb_timeout = $facts['os_service_default'],
$network_log_rate_limit = $facts['os_service_default'],
$network_log_burst_limit = $facts['os_service_default'],
$network_log_local_output_log_base = $facts['os_service_default'],
Boolean $purge_config = false,
$package_ensure = 'present',
Boolean $enabled = true,
Boolean $manage_service = true,
$debug = $facts['os_service_default'],
$interface_driver = 'neutron.agent.linux.interface.OVSInterfaceDriver',
$handle_internal_only_routers = $facts['os_service_default'],
$metadata_port = $facts['os_service_default'],
$periodic_interval = $facts['os_service_default'],
$periodic_fuzzy_delay = $facts['os_service_default'],
$enable_metadata_proxy = $facts['os_service_default'],
$ha_vrrp_auth_type = $facts['os_service_default'],
$ha_vrrp_auth_password = $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'],
$availability_zone = $facts['os_service_default'],
$extensions = $facts['os_service_default'],
$report_interval = $facts['os_service_default'],
$rpc_response_max_timeout = $facts['os_service_default'],
$radvd_user = $facts['os_service_default'],
$ovs_integration_bridge = $facts['os_service_default'],
$ovsdb_connection = $facts['os_service_default'],
$ovsdb_timeout = $facts['os_service_default'],
$network_log_rate_limit = $facts['os_service_default'],
$network_log_burst_limit = $facts['os_service_default'],
$network_log_local_output_log_base = $facts['os_service_default'],
Boolean $purge_config = false,
# DEPRECATED PARAMETERS
Optional[Boolean] $ha_enabled = undef,
Optional[Boolean] $ha_enabled = undef,
) {
include neutron::deps
@@ -175,28 +186,30 @@ class neutron::agents::l3 (
}
neutron_l3_agent_config {
'DEFAULT/debug': value => $debug;
'DEFAULT/interface_driver': value => $interface_driver;
'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers;
'DEFAULT/metadata_port': value => $metadata_port;
'DEFAULT/periodic_interval': value => $periodic_interval;
'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay;
'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy;
'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_advert_int': value => $ha_vrrp_advert_int;
'DEFAULT/agent_mode': value => $agent_mode;
'DEFAULT/radvd_user': value => $radvd_user;
'ovs/integration_bridge': value => $ovs_integration_bridge;
'ovs/ovsdb_connection': value => $ovsdb_connection;
'ovs/ovsdb_timeout': value => $ovsdb_timeout;
'agent/availability_zone': value => $availability_zone;
'agent/extensions': value => join(any2array($extensions), ',');
'agent/report_interval': value => $report_interval;
'DEFAULT/rpc_response_max_timeout': value => $rpc_response_max_timeout;
'network_log/rate_limit': value => $network_log_rate_limit;
'network_log/burst_limit': value => $network_log_burst_limit;
'network_log/local_output_log_base': value => $network_log_local_output_log_base;
'DEFAULT/debug': value => $debug;
'DEFAULT/interface_driver': value => $interface_driver;
'DEFAULT/handle_internal_only_routers': value => $handle_internal_only_routers;
'DEFAULT/metadata_port': value => $metadata_port;
'DEFAULT/periodic_interval': value => $periodic_interval;
'DEFAULT/periodic_fuzzy_delay': value => $periodic_fuzzy_delay;
'DEFAULT/enable_metadata_proxy': value => $enable_metadata_proxy;
'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_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/radvd_user': value => $radvd_user;
'ovs/integration_bridge': value => $ovs_integration_bridge;
'ovs/ovsdb_connection': value => $ovsdb_connection;
'ovs/ovsdb_timeout': value => $ovsdb_timeout;
'agent/availability_zone': value => $availability_zone;
'agent/extensions': value => join(any2array($extensions), ',');
'agent/report_interval': value => $report_interval;
'DEFAULT/rpc_response_max_timeout': value => $rpc_response_max_timeout;
'network_log/rate_limit': value => $network_log_rate_limit;
'network_log/burst_limit': value => $network_log_burst_limit;
'network_log/local_output_log_base': value => $network_log_local_output_log_base;
}
if $::neutron::params::l3_agent_package {

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_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_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/radvd_user').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
context 'with HA routers' do
context 'with HA options' do
before :each do
params.merge!({
:ha_vrrp_auth_type => 'PASS',
:ha_vrrp_auth_password => 'secrete',
:ha_vrrp_advert_int => 3,
:ha_vrrp_auth_type => 'PASS',
:ha_vrrp_auth_password => 'secrete',
:ha_vrrp_advert_int => 3,
:ha_keepalived_state_change_server_threads => 2,
:ha_vrrp_health_check_interval => 0,
})
end
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_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_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