Support more agent specific report_interval

This change introduces the report_interval parameters to more agent
classes, so that users can override report interval of a specific
agent more flexibly.

Change-Id: I573d1f9abe201bdd17bf16602218252cc9b7f132
This commit is contained in:
Takashi Kajinami 2021-08-29 14:55:32 +09:00
parent dae33092a1
commit 3307b54610
11 changed files with 57 additions and 1 deletions

View File

@ -104,6 +104,12 @@
# (optional) The SSL CA cert file to use for Neutron agents to connect to OVSDB # (optional) The SSL CA cert file to use for Neutron agents to connect to OVSDB
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*report_interval*]
# (optional) Set the agent report interval. By default the global report
# interval in neutron.conf ([agent]/report_interval) is used. This parameter
# can be used to override the reporting interval for the dhcp-agent.
# Defaults to $::os_service_default
#
class neutron::agents::dhcp ( class neutron::agents::dhcp (
$package_ensure = present, $package_ensure = present,
$enabled = true, $enabled = true,
@ -129,6 +135,7 @@ class neutron::agents::dhcp (
$ovsdb_agent_ssl_key_file = $::os_service_default, $ovsdb_agent_ssl_key_file = $::os_service_default,
$ovsdb_agent_ssl_cert_file = $::os_service_default, $ovsdb_agent_ssl_cert_file = $::os_service_default,
$ovsdb_agent_ssl_ca_file = $::os_service_default, $ovsdb_agent_ssl_ca_file = $::os_service_default,
$report_interval = $::os_service_default,
) { ) {
include neutron::deps include neutron::deps
@ -164,6 +171,7 @@ class neutron::agents::dhcp (
'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv; 'DEFAULT/dnsmasq_local_resolv': value => $dnsmasq_local_resolv;
'DEFAULT/dnsmasq_enable_addr6_list': value => $dnsmasq_enable_addr6_list; 'DEFAULT/dnsmasq_enable_addr6_list': value => $dnsmasq_enable_addr6_list;
'agent/availability_zone': value => $availability_zone; 'agent/availability_zone': value => $availability_zone;
'agent/report_interval': value => $report_interval;
} }
# DEFAULT/ovs_intergation_bridge was deprecated in favor of # DEFAULT/ovs_intergation_bridge was deprecated in favor of

View File

@ -83,6 +83,12 @@
# (optional) List of the L3 agent extensions to enable. # (optional) List of the L3 agent extensions to enable.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*report_interval*]
# (optional) Set the agent report interval. By default the global report
# interval in neutron.conf ([agent]/report_interval) is used. This parameter
# can be used to override the reporting interval for l3-agent.
# Defaults to $::os_service_default
#
# [*radvd_user*] # [*radvd_user*]
# (optional) The username passed to radvd, used to drop root privileges and # (optional) The username passed to radvd, used to drop root privileges and
# change user ID to username and group ID to the primary group of username. # change user ID to username and group ID to the primary group of username.
@ -137,6 +143,7 @@ class neutron::agents::l3 (
$purge_config = false, $purge_config = false,
$availability_zone = $::os_service_default, $availability_zone = $::os_service_default,
$extensions = $::os_service_default, $extensions = $::os_service_default,
$report_interval = $::os_service_default,
$radvd_user = $::os_service_default, $radvd_user = $::os_service_default,
$ovs_integration_bridge = $::os_service_default, $ovs_integration_bridge = $::os_service_default,
$network_log_rate_limit = $::os_service_default, $network_log_rate_limit = $::os_service_default,
@ -182,6 +189,7 @@ class neutron::agents::l3 (
'ovs/integration_bridge': value => $ovs_integration_bridge; 'ovs/integration_bridge': value => $ovs_integration_bridge;
'agent/availability_zone': value => $availability_zone; 'agent/availability_zone': value => $availability_zone;
'agent/extensions': value => join(any2array($extensions), ','); 'agent/extensions': value => join(any2array($extensions), ',');
'agent/report_interval': value => $report_interval;
'network_log/rate_limit': value => $network_log_rate_limit; 'network_log/rate_limit': value => $network_log_rate_limit;
'network_log/burst_limit': value => $network_log_burst_limit; 'network_log/burst_limit': value => $network_log_burst_limit;
'network_log/local_output_log_base': value => $network_log_local_output_log_base; 'network_log/local_output_log_base': value => $network_log_local_output_log_base;

View File

@ -58,6 +58,12 @@
# (optional) Allow to perform insecure SSL (https) requests to nova metadata. # (optional) Allow to perform insecure SSL (https) requests to nova metadata.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*report_interval*]
# (optional) Set the agent report interval. By default the global report
# interval in neutron.conf ([agent]/report_interval) is used. This parameter
# can be used to override the reporting interval for the sriov-agent.
# Defaults to $::os_service_default
#
# [*purge_config*] # [*purge_config*]
# (optional) Whether to set only the specified config options # (optional) Whether to set only the specified config options
# in the metadata config. # in the metadata config.
@ -79,6 +85,7 @@ class neutron::agents::metadata (
$metadata_insecure = $::os_service_default, $metadata_insecure = $::os_service_default,
$nova_client_cert = $::os_service_default, $nova_client_cert = $::os_service_default,
$nova_client_priv_key = $::os_service_default, $nova_client_priv_key = $::os_service_default,
$report_interval = $::os_service_default,
$purge_config = false, $purge_config = false,
) { ) {
@ -101,6 +108,7 @@ class neutron::agents::metadata (
'DEFAULT/metadata_backlog': value => $metadata_backlog; 'DEFAULT/metadata_backlog': value => $metadata_backlog;
'DEFAULT/nova_client_cert': value => $nova_client_cert; 'DEFAULT/nova_client_cert': value => $nova_client_cert;
'DEFAULT/nova_client_priv_key': value => $nova_client_priv_key; 'DEFAULT/nova_client_priv_key': value => $nova_client_priv_key;
'agent/report_interval': value => $report_interval;
} }
if ! is_service_default ($metadata_memory_cache_ttl) and ($metadata_memory_cache_ttl) { if ! is_service_default ($metadata_memory_cache_ttl) and ($metadata_memory_cache_ttl) {

View File

@ -87,6 +87,12 @@
# polling for local device changes. # polling for local device changes.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*report_interval*]
# (optional) Set the agent report interval. By default the global report
# interval in neutron.conf ([agent]/report_interval) is used. This parameter
# can be used to override the reporting interval for the openvswitch-agent.
# Defaults to $::os_service_default
#
# [*l2_population*] # [*l2_population*]
# (optional) Extension to use alongside ml2 plugin's l2population # (optional) Extension to use alongside ml2 plugin's l2population
# mechanism driver. # mechanism driver.
@ -238,6 +244,7 @@ class neutron::agents::ml2::ovs (
$tunnel_bridge = 'br-tun', $tunnel_bridge = 'br-tun',
$vxlan_udp_port = 4789, $vxlan_udp_port = 4789,
$polling_interval = $::os_service_default, $polling_interval = $::os_service_default,
$report_interval = $::os_service_default,
$l2_population = $::os_service_default, $l2_population = $::os_service_default,
$arp_responder = $::os_service_default, $arp_responder = $::os_service_default,
$firewall_driver = 'iptables_hybrid', $firewall_driver = 'iptables_hybrid',
@ -365,6 +372,7 @@ class neutron::agents::ml2::ovs (
neutron_agent_ovs { neutron_agent_ovs {
'agent/polling_interval': value => $polling_interval; 'agent/polling_interval': value => $polling_interval;
'agent/report_interval': value => $report_interval;
'agent/l2_population': value => $l2_population; 'agent/l2_population': value => $l2_population;
'agent/arp_responder': value => $arp_responder; 'agent/arp_responder': value => $arp_responder;
'agent/enable_distributed_routing': value => $enable_distributed_routing; 'agent/enable_distributed_routing': value => $enable_distributed_routing;

View File

@ -43,7 +43,13 @@
# [*polling_interval*] # [*polling_interval*]
# (optional) The number of seconds the agent will wait between # (optional) The number of seconds the agent will wait between
# polling for local device changes. # polling for local device changes.
# Defaults to '2" # Defaults to 2
#
# [*report_interval*]
# (optional) Set the agent report interval. By default the global report
# interval in neutron.conf ([agent]/report_interval) is used. This parameter
# can be used to override the reporting interval for the sriov-agent.
# Defaults to $::os_service_default
# #
# [*exclude_devices*] # [*exclude_devices*]
# (optional) Array of <network_device>:<excluded_devices> mapping # (optional) Array of <network_device>:<excluded_devices> mapping
@ -88,6 +94,7 @@ class neutron::agents::ml2::sriov (
$manage_service = true, $manage_service = true,
$physical_device_mappings = $::os_service_default, $physical_device_mappings = $::os_service_default,
$polling_interval = 2, $polling_interval = 2,
$report_interval = $::os_service_default,
$exclude_devices = $::os_service_default, $exclude_devices = $::os_service_default,
$extensions = $::os_service_default, $extensions = $::os_service_default,
$purge_config = false, $purge_config = false,
@ -109,6 +116,7 @@ class neutron::agents::ml2::sriov (
'sriov_nic/physical_device_mappings': value => pick(join(any2array($physical_device_mappings), ','), $::os_service_default); 'sriov_nic/physical_device_mappings': value => pick(join(any2array($physical_device_mappings), ','), $::os_service_default);
'agent/extensions': value => join(any2array($extensions), ','); 'agent/extensions': value => join(any2array($extensions), ',');
'agent/polling_interval': value => $polling_interval; 'agent/polling_interval': value => $polling_interval;
'agent/report_interval': value => $report_interval;
# As of now security groups are not supported for SR-IOV ports. # As of now security groups are not supported for SR-IOV ports.
# It is required to disable Firewall driver in the SR-IOV agent config. # It is required to disable Firewall driver in the SR-IOV agent config.
'securitygroup/firewall_driver': value => 'noop'; 'securitygroup/firewall_driver': value => 'noop';

View File

@ -0,0 +1,11 @@
---
features:
- |
The following classes now support the ``report_interval`` parameter, to
override the report interval of a specific neutron agents.
- ``neutron::agent::dhcp``
- ``neutron::agent::metadata``
- ``neutron::agent::ml2::ovs``
- ``neutron::agent::ml2::sriov``
- ``neutron::agent::l3``

View File

@ -44,6 +44,7 @@ describe 'neutron::agents::dhcp' do
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value('<SERVICE DEFAULT>'); should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_local_resolv').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list').with_value('<SERVICE DEFAULT>'); should contain_neutron_dhcp_agent_config('DEFAULT/dnsmasq_enable_addr6_list').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('agent/availability_zone').with_value('<SERVICE DEFAULT>'); should contain_neutron_dhcp_agent_config('agent/availability_zone').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('agent/report_interval').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('OVS/ovsdb_connection').with_value('<SERVICE DEFAULT>'); should contain_neutron_dhcp_agent_config('OVS/ovsdb_connection').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('OVS/integration_bridge').with_value('<SERVICE DEFAULT>'); should contain_neutron_dhcp_agent_config('OVS/integration_bridge').with_value('<SERVICE DEFAULT>');
should contain_neutron_dhcp_agent_config('OVS/ssl_key_file').with_value('<SERVICE DEFAULT>'); should contain_neutron_dhcp_agent_config('OVS/ssl_key_file').with_value('<SERVICE DEFAULT>');

View File

@ -41,6 +41,7 @@ describe 'neutron::agents::l3' do
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>')
should contain_neutron_l3_agent_config('agent/availability_zone').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('agent/availability_zone').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('agent/extensions').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('agent/extensions').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('agent/report_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('network_log/rate_limit').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('network_log/rate_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('network_log/burst_limit').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('network_log/burst_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_l3_agent_config('network_log/local_output_log_base').with_value('<SERVICE DEFAULT>') should contain_neutron_l3_agent_config('network_log/local_output_log_base').with_value('<SERVICE DEFAULT>')

View File

@ -58,6 +58,7 @@ describe 'neutron::agents::metadata' do
should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_insecure').with(:value => '<SERVICE DEFAULT>') should contain_neutron_metadata_agent_config('DEFAULT/nova_metadata_insecure').with(:value => '<SERVICE DEFAULT>')
should contain_neutron_metadata_agent_config('DEFAULT/metadata_proxy_shared_secret').with(:value => params[:shared_secret]).with_secret(true) should contain_neutron_metadata_agent_config('DEFAULT/metadata_proxy_shared_secret').with(:value => params[:shared_secret]).with_secret(true)
should contain_neutron_metadata_agent_config('DEFAULT/cache_url').with(:ensure => 'absent') should contain_neutron_metadata_agent_config('DEFAULT/cache_url').with(:ensure => 'absent')
should contain_neutron_metadata_agent_config('agent/report_interval').with(:value => '<SERVICE DEFAULT>')
end end
end end

View File

@ -41,6 +41,7 @@ describe 'neutron::agents::ml2::ovs' do
it 'configures plugins/ml2/openvswitch_agent.ini' do it 'configures plugins/ml2/openvswitch_agent.ini' do
should contain_neutron_agent_ovs('agent/polling_interval').with_value('<SERVICE DEFAULT>') should contain_neutron_agent_ovs('agent/polling_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('agent/report_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('agent/l2_population').with_value('<SERVICE DEFAULT>') should contain_neutron_agent_ovs('agent/l2_population').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('agent/arp_responder').with_value('<SERVICE DEFAULT>') should contain_neutron_agent_ovs('agent/arp_responder').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('agent/drop_flows_on_start').with_value(p[:drop_flows_on_start]) should contain_neutron_agent_ovs('agent/drop_flows_on_start').with_value(p[:drop_flows_on_start])

View File

@ -38,6 +38,7 @@ describe 'neutron::agents::ml2::sriov' do
should contain_neutron_sriov_agent_config('sriov_nic/physical_device_mappings').with_value('<SERVICE DEFAULT>') should contain_neutron_sriov_agent_config('sriov_nic/physical_device_mappings').with_value('<SERVICE DEFAULT>')
should contain_neutron_sriov_agent_config('agent/extensions').with_value(['<SERVICE DEFAULT>']) should contain_neutron_sriov_agent_config('agent/extensions').with_value(['<SERVICE DEFAULT>'])
should contain_neutron_sriov_agent_config('agent/polling_interval').with_value(p[:polling_interval]) should contain_neutron_sriov_agent_config('agent/polling_interval').with_value(p[:polling_interval])
should contain_neutron_sriov_agent_config('agent/report_interval').with_value('<SERVICE DEFAULT>')
should contain_neutron_sriov_agent_config('securitygroup/firewall_driver').with_value('noop') should contain_neutron_sriov_agent_config('securitygroup/firewall_driver').with_value('noop')
end end