Add support for logging service plugin configuration

This patch adds possibility to configure logging's service plugin
in Neutron.
See [1] for details.

[1] https://docs.openstack.org/neutron/latest/admin/config-logging.html

Conflicts:
    manifests/agents/ml2/ovs.pp

Change-Id: I569fa71e84582b8deb1b45dee6b619d511692b36
(cherry picked from commit 61f4fc966b)
This commit is contained in:
Slawek Kaplonski 2021-08-11 11:48:17 +02:00
parent 2d67a8474c
commit bd97629f73
7 changed files with 178 additions and 92 deletions

View File

@ -95,6 +95,23 @@
# (optional) Name of Open vSwitch bridge to use
# Defaults to $::os_service_default
#
# [*network_log_rate_limit*]
# (Optional) Maximum packets logging per second.
# Used by logging service plugin.
# Defaults to $::os_service_default.
# Minimum possible value is 100.
#
# [*network_log_burst_limit*]
# (Optional) Maximum number of packets per rate_limit.
# Used by logging service plugin.
# Defaults to $::os_service_default.
# Minimum possible value is 25.
#
# [*network_log_local_output_log_base*]
# (Optional) Output logfile path on agent side, default syslog file.
# Used by logging service plugin.
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*gateway_external_network_id*]
@ -122,6 +139,9 @@ class neutron::agents::l3 (
$extensions = $::os_service_default,
$radvd_user = $::os_service_default,
$ovs_integration_bridge = $::os_service_default,
$network_log_rate_limit = $::os_service_default,
$network_log_burst_limit = $::os_service_default,
$network_log_local_output_log_base = $::os_service_default,
# DEPRECATED PARAMETERS
$gateway_external_network_id = undef,
) {
@ -162,6 +182,9 @@ class neutron::agents::l3 (
'ovs/integration_bridge': value => $ovs_integration_bridge;
'agent/availability_zone': value => $availability_zone;
'agent/extensions': value => join(any2array($extensions), ',');
'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

@ -199,6 +199,23 @@
# final egress tables direct output flows for unicast traffic. (boolean value)
# Defaults to $::os_service_default
#
# [*network_log_rate_limit*]
# (Optional) Maximum packets logging per second.
# Used by logging service plugin.
# Defaults to $::os_service_default.
# Minimum possible value is 100.
#
# [*network_log_burst_limit*]
# (Optional) Maximum number of packets per rate_limit.
# Used by logging service plugin.
# Defaults to $::os_service_default.
# Minimum possible value is 25.
#
# [*network_log_local_output_log_base*]
# (Optional) Output logfile path on agent side, default syslog file.
# Used by logging service plugin.
# Defaults to $::os_service_default.
#
# DEPRECATED
#
# [*ovsdb_interface*]
@ -244,6 +261,9 @@ class neutron::agents::ml2::ovs (
$resource_provider_bandwidths = [],
$resource_provider_hypervisors = [],
$explicitly_egress_direct = $::os_service_default,
$network_log_rate_limit = $::os_service_default,
$network_log_burst_limit = $::os_service_default,
$network_log_local_output_log_base = $::os_service_default,
# DEPRECATED
$ovsdb_interface = undef,
) {
@ -374,6 +394,9 @@ class neutron::agents::ml2::ovs (
'securitygroup/enable_security_group': value => $enable_security_group;
'ovs/bridge_mac_table_size': value => $bridge_mac_table_size;
'ovs/igmp_snooping_enable': value => $igmp_snooping_enable;
'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 $firewall_driver {

View File

@ -96,6 +96,23 @@
# Type: boolean
# Defaults to $::os_service_default
#
# [*network_log_rate_limit*]
# (Optional) Maximum packets logging per second.
# Used by logging service plugin.
# Defaults to $::os_service_default.
# Minimum possible value is 100.
#
# [*network_log_burst_limit*]
# (Optional) Maximum number of packets per rate_limit.
# Used by logging service plugin.
# Defaults to $::os_service_default.
# Minimum possible value is 25.
#
# [*network_log_local_output_log_base*]
# (Optional) Output logfile path on agent side, default syslog file.
# Used by logging service plugin.
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*ovn_l3_mode*]
@ -121,6 +138,9 @@ class neutron::plugins::ml2::ovn(
$dns_servers = $::os_service_default,
$vhostuser_socket_dir = $::os_service_default,
$ovn_emit_need_to_frag = $::os_service_default,
$network_log_rate_limit = $::os_service_default,
$network_log_burst_limit = $::os_service_default,
$network_log_local_output_log_base = $::os_service_default,
# DEPRECATED PARAMETERS
$ovn_l3_mode = undef,
$vif_type = undef,
@ -160,10 +180,13 @@ class neutron::plugins::ml2::ovn(
'ovn/ovsdb_connection_timeout' : value => $ovsdb_connection_timeout;
'ovn/neutron_sync_mode' : value => $neutron_sync_mode;
'ovn/ovn_metadata_enabled' : value => $ovn_metadata_enabled;
'ovn/enable_distributed_floating_ip' : value => $dvr_enabled;
'ovn/enable_distributed_floating_ip': value => $dvr_enabled;
'ovn/dns_servers' : value => join(any2array($dns_servers), ',');
'ovn/vhost_sock_dir' : value => $vhostuser_socket_dir;
'ovn/ovn_emit_need_to_frag' : value => $ovn_emit_need_to_frag;
'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;
}
# TODO(tkajinam): Remove this when removing the deprecated parameters

View File

@ -0,0 +1,9 @@
---
features:
- |
Support for the logging serivce plugin parameters has been added to
the following classes.
- ``neutron::agent::l3``
- ``neutron::agent::ml2::ovs``
- ``neutron::plugins::ml2::ovn``

View File

@ -41,6 +41,9 @@ describe 'neutron::agents::l3' do
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/extensions').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/local_output_log_base').with_value('<SERVICE DEFAULT>')
end
it 'passes purge to resource' do

View File

@ -71,6 +71,9 @@ describe 'neutron::agents::ml2::ovs' do
should contain_neutron_agent_ovs('ovs/resource_provider_hypervisors').\
with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('agent/explicitly_egress_direct').with_value(['<SERVICE DEFAULT>'])
should contain_neutron_agent_ovs('network_log/rate_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('network_log/burst_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_agent_ovs('network_log/local_output_log_base').with_value('<SERVICE DEFAULT>')
end
it 'installs neutron ovs agent package' do

View File

@ -52,8 +52,10 @@ describe 'neutron::plugins::ml2::ovn' do
should contain_neutron_plugin_ml2('ovn/dns_servers').with_value(params[:dns_servers].join(','))
should contain_neutron_plugin_ml2('ovn/vhost_sock_dir').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_ml2('ovn/ovn_emit_need_to_frag').with_value(params[:ovn_emit_need_to_frag])
should contain_neutron_plugin_ml2('network_log/rate_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_ml2('network_log/burst_limit').with_value('<SERVICE DEFAULT>')
should contain_neutron_plugin_ml2('network_log/local_output_log_base').with_value('<SERVICE DEFAULT>')
end
end
shared_examples 'Validating parameters' do