Enable keepalived VRRP health check

If you want to have vrrp watch the external networking interface
today, the option ha_vrrp_health_check_interval [1] detects a failure
it re-triggers the transitional change - which works if the external
physical interface fails because the ping will fail.

In fact, we've tried to enable it before [2], but then we had to
revert it [3] due to instability issues [4] in previous releases of
OpenStack. Maybe the previous instability issue [4] was caused by
another keepalived issue mentioned in the comment [5], now I have
tested this option again, it works.

This is how neutron allows monitoring southbound network today, so
I would suggest we add this capability into the charm again.

[1] https://docs.openstack.org/ocata/networking-guide/ \
        deploy-ovs-ha-vrrp.html#keepalived-vrrp-health-check
[2] https://review.opendev.org/#/c/601533/
[3] https://review.opendev.org/#/c/603347/
[4] https://bugs.launchpad.net/neutron/+bug/1793102
[5] https://bugs.launchpad.net/neutron/+bug/1793102/comments/5

Change-Id: If2947e7640545cb9a48215afb9b2439fdc33c645
Closes-Bug: 1825966
This commit is contained in:
Zhang Hua 2019-05-08 09:52:12 +08:00
parent 183c76a96f
commit 4c150529b5
5 changed files with 19 additions and 0 deletions

View File

@ -102,6 +102,7 @@ class L3AgentContext(OSContextGenerator):
ctxt['agent_mode'] = 'legacy'
ctxt['rpc_response_timeout'] = api_settings['rpc_response_timeout']
ctxt['report_interval'] = api_settings['report_interval']
ctxt['use_l3ha'] = api_settings['enable_l3ha']
return ctxt

View File

@ -30,6 +30,9 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% endif -%}
[AGENT]
extensions = fwaas

View File

@ -25,6 +25,9 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% endif -%}
[AGENT]
extensions = fwaas

View File

@ -25,6 +25,9 @@ gateway_external_network_id = {{ ext_net_id }}
external_network_bridge = br-ex
{% endif -%}
agent_mode = {{ agent_mode }}
{% if use_l3ha -%}
ha_vrrp_health_check_interval = 30
{% endif -%}
[AGENT]
extensions = fwaas_v2

View File

@ -63,6 +63,7 @@ class TestL3AgentContext(CharmTestCase):
DummyNeutronAPIContext(return_value={'enable_dvr': False,
'report_interval': 30,
'rpc_response_timeout': 60,
'enable_l3ha': True,
})
self.test_config.set('run-internal-router', 'none')
self.test_config.set('external-network-id', '')
@ -71,6 +72,7 @@ class TestL3AgentContext(CharmTestCase):
{'agent_mode': 'legacy',
'report_interval': 30,
'rpc_response_timeout': 60,
'use_l3ha': True,
'external_configuration_new': True,
'handle_internal_only_router': False,
'plugin': 'ovs'})
@ -81,6 +83,7 @@ class TestL3AgentContext(CharmTestCase):
DummyNeutronAPIContext(return_value={'enable_dvr': False,
'report_interval': 30,
'rpc_response_timeout': 60,
'enable_l3ha': True,
})
self.test_config.set('run-internal-router', 'none')
self.test_config.set('ext-port', 'eth1')
@ -89,6 +92,7 @@ class TestL3AgentContext(CharmTestCase):
{'agent_mode': 'legacy',
'report_interval': 30,
'rpc_response_timeout': 60,
'use_l3ha': True,
'handle_internal_only_router': False,
'plugin': 'ovs'})
@ -98,6 +102,7 @@ class TestL3AgentContext(CharmTestCase):
DummyNeutronAPIContext(return_value={'enable_dvr': False,
'report_interval': 30,
'rpc_response_timeout': 60,
'enable_l3ha': True,
})
self.test_config.set('run-internal-router', 'leader')
self.test_config.set('external-network-id', 'netid')
@ -106,6 +111,7 @@ class TestL3AgentContext(CharmTestCase):
{'agent_mode': 'legacy',
'report_interval': 30,
'rpc_response_timeout': 60,
'use_l3ha': True,
'handle_internal_only_router': True,
'ext_net_id': 'netid',
'plugin': 'ovs'})
@ -116,6 +122,7 @@ class TestL3AgentContext(CharmTestCase):
DummyNeutronAPIContext(return_value={'enable_dvr': False,
'report_interval': 30,
'rpc_response_timeout': 60,
'enable_l3ha': True,
})
self.test_config.set('run-internal-router', 'all')
self.test_config.set('external-network-id', 'netid')
@ -124,6 +131,7 @@ class TestL3AgentContext(CharmTestCase):
{'agent_mode': 'legacy',
'report_interval': 30,
'rpc_response_timeout': 60,
'use_l3ha': True,
'handle_internal_only_router': True,
'ext_net_id': 'netid',
'plugin': 'ovs'})
@ -134,6 +142,7 @@ class TestL3AgentContext(CharmTestCase):
DummyNeutronAPIContext(return_value={'enable_dvr': True,
'report_interval': 30,
'rpc_response_timeout': 60,
'enable_l3ha': True,
})
self.assertEqual(neutron_contexts.L3AgentContext()()['agent_mode'],
'dvr_snat')