Merge "Make OVS controller inactivity_probe configurable" into stable/stein
This commit is contained in:
commit
eb7137fa9b
@ -687,6 +687,13 @@ class OVSBridge(BaseOVS):
|
|||||||
"""
|
"""
|
||||||
self.set_controller_field('connection_mode', connection_mode)
|
self.set_controller_field('connection_mode', connection_mode)
|
||||||
|
|
||||||
|
def set_controllers_inactivity_probe(self, interval):
|
||||||
|
"""Set bridge controllers inactivity probe interval.
|
||||||
|
|
||||||
|
:param interval: inactivity_probe value in seconds.
|
||||||
|
"""
|
||||||
|
self.set_controller_field('inactivity_probe', interval * 1000)
|
||||||
|
|
||||||
def _set_egress_bw_limit_for_port(self, port_name, max_kbps,
|
def _set_egress_bw_limit_for_port(self, port_name, max_kbps,
|
||||||
max_burst_kbps):
|
max_burst_kbps):
|
||||||
with self.ovsdb.transaction(check_error=True) as txn:
|
with self.ovsdb.transaction(check_error=True) as txn:
|
||||||
|
@ -121,6 +121,11 @@ ovs_opts = [
|
|||||||
help=_("Timeout in seconds to wait for a single "
|
help=_("Timeout in seconds to wait for a single "
|
||||||
"OpenFlow request. "
|
"OpenFlow request. "
|
||||||
"Used only for 'native' driver.")),
|
"Used only for 'native' driver.")),
|
||||||
|
cfg.IntOpt('of_inactivity_probe', default=10,
|
||||||
|
help=_("The inactivity_probe interval in seconds for the local "
|
||||||
|
"switch connection to the controller. "
|
||||||
|
"A value of 0 disables inactivity probes. "
|
||||||
|
"Used only for 'native' driver.")),
|
||||||
]
|
]
|
||||||
|
|
||||||
agent_opts = [
|
agent_opts = [
|
||||||
|
@ -94,6 +94,7 @@ class OVSAgentBridge(ofswitch.OpenFlowSwitchMixin,
|
|||||||
#
|
#
|
||||||
# [1] https://github.com/openvswitch/ovs/blob/master/DESIGN.md
|
# [1] https://github.com/openvswitch/ovs/blob/master/DESIGN.md
|
||||||
self.set_controllers_connection_mode("out-of-band")
|
self.set_controllers_connection_mode("out-of-band")
|
||||||
|
self.set_controllers_inactivity_probe(conf.OVS.of_inactivity_probe)
|
||||||
|
|
||||||
def drop_port(self, in_port):
|
def drop_port(self, in_port):
|
||||||
self.install_drop(priority=2, in_port=in_port)
|
self.install_drop(priority=2, in_port=in_port)
|
||||||
|
@ -429,3 +429,11 @@ class BaseOVSTestCase(base.BaseSudoTestCase):
|
|||||||
self.ovs.update_minimum_bandwidth_queue(self.port_id, [], 1, 2800)
|
self.ovs.update_minimum_bandwidth_queue(self.port_id, [], 1, 2800)
|
||||||
self._check_value(2800, self.ovs.get_egress_min_bw_for_port,
|
self._check_value(2800, self.ovs.get_egress_min_bw_for_port,
|
||||||
port_id=self.port_id)
|
port_id=self.port_id)
|
||||||
|
|
||||||
|
def test_set_controllers_inactivity_probe(self):
|
||||||
|
self._create_bridge()
|
||||||
|
self.ovs.set_controller(['tcp:127.0.0.1:6633'])
|
||||||
|
self.ovs.set_controllers_inactivity_probe(8)
|
||||||
|
self.assertEqual(8000,
|
||||||
|
self.ovs.db_get_val('Controller', self.br_name,
|
||||||
|
'inactivity_probe'))
|
||||||
|
@ -142,10 +142,13 @@ class OVSBridgeTestBase(ovs_test_base.OVSOSKenTestBase):
|
|||||||
|
|
||||||
m_add_protocols = mock.patch.object(self.br, 'add_protocols')
|
m_add_protocols = mock.patch.object(self.br, 'add_protocols')
|
||||||
m_set_controller = mock.patch.object(self.br, 'set_controller')
|
m_set_controller = mock.patch.object(self.br, 'set_controller')
|
||||||
|
m_set_probe = mock.patch.object(self.br,
|
||||||
|
'set_controllers_inactivity_probe')
|
||||||
m_set_ccm = mock.patch.object(self.br,
|
m_set_ccm = mock.patch.object(self.br,
|
||||||
'set_controllers_connection_mode')
|
'set_controllers_connection_mode')
|
||||||
|
|
||||||
with m_set_ccm as set_ccm, m_set_controller, m_add_protocols:
|
with m_set_ccm as set_ccm:
|
||||||
|
with m_set_controller, m_add_protocols, m_set_probe:
|
||||||
self.br.setup_controllers(cfg)
|
self.br.setup_controllers(cfg)
|
||||||
set_ccm.assert_called_once_with("out-of-band")
|
set_ccm.assert_called_once_with("out-of-band")
|
||||||
|
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
other:
|
||||||
|
- |
|
||||||
|
A new option ``[ovs] of_inactivity_probe`` has been added to allow
|
||||||
|
changing the inactivity probe interval when using the OVS ML2 agent
|
||||||
|
with the native OpenFlow driver. Operators can increase this if they
|
||||||
|
are experiencing OpenFlow timeouts. The default value is 10 seconds.
|
Loading…
Reference in New Issue
Block a user