Add ovsdb-timeout configuration option

ovsdb-timeout sets ovsdb_timeout in openvswitch_agent.ini, this option
is used to determine when ovsdb commands should be marked as fail. This
is helpful for large clouds or where the node is under pressure.

Change-Id: I0b0e397691c49d3fcebdd30bbe9b160789acf3c3
Closes-Bug: #1849732
This commit is contained in:
Felipe Reyes 2019-11-08 13:18:16 -03:00
parent 6806db670b
commit 17cbdb50a2
4 changed files with 38 additions and 0 deletions

View File

@ -334,3 +334,9 @@ options:
Can be used to avoid excessive memory consumption.
WARNING: Should be NOT LESS than 25.
(Available from Stein)
ovsdb-timeout:
type: int
default:
description: |
Timeout in seconds for ovsdb commands.
(Available from Queens)

View File

@ -180,6 +180,7 @@ class NeutronGatewayContext(NeutronAPIContext):
'enable_isolated_metadata': config('enable-isolated-metadata'),
'availability_zone': get_availability_zone(),
'enable_nfg_logging': api_settings['enable_nfg_logging'],
'ovsdb_timeout': config('ovsdb-timeout'),
}
ctxt['local_ip'] = get_local_ip()

View File

@ -0,0 +1,26 @@
# queens
###############################################################################
# [ WARNING ]
# Configuration file maintained by Juju. Local changes may be overwritten.
###############################################################################
[ovs]
enable_tunneling = True
local_ip = {{ local_ip }}
bridge_mappings = {{ bridge_mappings }}
{%- if ovsdb_timeout and ovsdb_timeout > 0 %}
ovsdb_timeout = {{ovsdb_timeout}}
{%- endif %}
[agent]
tunnel_types = {{ overlay_network_type }}
l2_population = {{ l2_population }}
enable_distributed_routing = {{ enable_dvr }}
{% if veth_mtu -%}
veth_mtu = {{ veth_mtu }}
{% endif -%}
{% if extension_drivers -%}
extensions = {{ extension_drivers }}
{% endif %}
[securitygroup]
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

View File

@ -202,6 +202,8 @@ class TestNeutronGatewayContext(CharmTestCase):
self.test_config.set('customize-failure-domain', False)
self.test_config.set('default-availability-zone', 'nova')
self.test_config.set('ovsdb-timeout', 10)
self.network_get_primary_address.side_effect = NotImplementedError
self.unit_get.return_value = '10.5.0.1'
# Provided by neutron-api relation
@ -243,6 +245,7 @@ class TestNeutronGatewayContext(CharmTestCase):
'nfg_log_burst_limit': 50,
'nfg_log_output_base': '/var/log/firewall-logs',
'nfg_log_rate_limit': 100,
'ovsdb_timeout': 10,
})
@patch.object(neutron_contexts, 'validate_nfg_log_path', lambda x: x)
@ -270,6 +273,7 @@ class TestNeutronGatewayContext(CharmTestCase):
self.test_config.set('customize-failure-domain', False)
self.test_config.set('default-availability-zone', 'nova')
self.test_config.set('ovsdb-timeout', 60)
self.network_get_primary_address.return_value = '192.168.20.2'
self.unit_get.return_value = '10.5.0.1'
@ -312,6 +316,7 @@ class TestNeutronGatewayContext(CharmTestCase):
'nfg_log_burst_limit': 25,
'nfg_log_output_base': None,
'nfg_log_rate_limit': None,
'ovsdb_timeout': 60,
})
@patch('charmhelpers.contrib.openstack.context.relation_get')