From 0cbc2a8c0f645d34d3a293928de0be3bf36fd0ef Mon Sep 17 00:00:00 2001 From: Dmitrii Shcherbakov Date: Thu, 14 May 2020 17:54:55 +0300 Subject: [PATCH] Deprecate linux bridge usage in data-port config f832f1073d47a430111c59563962922dfe37a0a5 addressed LP: #1635067 by adding support for using pre-created Linux bridges in the data-port config option. The same use-case of reusing a single physical interface for VLAN interfaces and plugging it into an OVS bridge can be addressed in a different way by plugging the physical interface directly into the OVS bridge and creating VLAN interfaces on that physical interface - this does not require the use of veth pairs which is problematic due to the performance reasons and lack of support for in netplan for veth pairs at the time of writing. There is a procedure to move from the setup with Linux bridge and veth pair used to the one that does not which will be documented to migrate the existing environments in-place. Partial-Bug: #1877594 Change-Id: I5e455fa701cc2f5248ccfd9ed15f3c902aacb1ef Co-authored-by: Aurelien Lourot --- hooks/neutron_ovs_utils.py | 4 ++++ unit_tests/test_neutron_ovs_utils.py | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/hooks/neutron_ovs_utils.py b/hooks/neutron_ovs_utils.py index cc027884..f086102f 100644 --- a/hooks/neutron_ovs_utils.py +++ b/hooks/neutron_ovs_utils.py @@ -700,6 +700,10 @@ def configure_ovs(): ifdata=generate_external_ids(br), portdata=generate_external_ids(br)) else: + log('{} is a Linux bridge: using Linux bridges in the ' + 'data-port config is deprecated for removal after ' + '21.10 release of OpenStack charms.'.format(port), + level=WARNING) add_ovsbridge_linuxbridge( br, port, ifdata=generate_external_ids(br), portdata=generate_external_ids(br)) diff --git a/unit_tests/test_neutron_ovs_utils.py b/unit_tests/test_neutron_ovs_utils.py index d221fd7e..a897fe53 100644 --- a/unit_tests/test_neutron_ovs_utils.py +++ b/unit_tests/test_neutron_ovs_utils.py @@ -70,6 +70,7 @@ TO_PATCH = [ 'is_container', 'is_unit_paused_set', 'deferrable_svc_restart', + 'log', ] head_pkg = 'linux-headers-3.15.0-5-generic' @@ -660,8 +661,22 @@ class TestNeutronOVSUtils(CharmTestCase): _nics.return_value = ['br-juju'] self.add_bridge.reset_mock() self.add_bridge_port.reset_mock() + expected_ifdata = { + 'external-ids': { + 'charm-neutron-openvswitch': 'br-foo' + } + } nutils.configure_ovs() - self.assertTrue(self.add_ovsbridge_linuxbridge.called) + self.add_ovsbridge_linuxbridge.assert_called_once_with( + 'br-foo', + 'br-juju', + ifdata=expected_ifdata, + portdata=expected_ifdata, + ) + self.log.assert_called_with( + 'br-juju is a Linux bridge: using Linux bridges in the data-port ' + 'config is deprecated for removal after 21.10 release of OpenStack' + ' charms.', level='WARNING') @patch.object(nutils, 'use_dvr') @patch('charmhelpers.contrib.network.ovs.charm_name')