[OVN] Allow only one physical network per bridge
Same as in other ML2 plugins (OVS, Linux Bridge), OVN mechanism driver should allow only one physical network per bridge. The rule "one network, one bridge" should be present in OVN too. By allowing only one physical network per bridge, Neutron prevents having two networks with subnets with the same CIDR in the same bridge. Currently is possible and this CIDR clash is not prevented (shouldn't be by the API). This architectural limitation prevents this situation. This limitation is already present in deployment tools as TripleO. Conflicts: neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_impl_idl.py Closes-Bug: #1956476 Change-Id: I74a2ca9a344a93219deb94d60247478ee3200659 (cherry picked from commit55afd9bc92
) (cherry picked from commiteddb3a7902
)
This commit is contained in:
parent
cf18c3e2e5
commit
cb67856d9f
|
@ -817,8 +817,7 @@ class OvsdbSbOvnIdl(sb_impl_idl.OvnSbApiIdlImpl, Backend):
|
|||
|
||||
def _get_chassis_physnets(self, chassis):
|
||||
bridge_mappings = chassis.external_ids.get('ovn-bridge-mappings', '')
|
||||
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','),
|
||||
unique_values=False)
|
||||
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','))
|
||||
return list(mapping_dict.keys())
|
||||
|
||||
def chassis_exists(self, hostname):
|
||||
|
|
|
@ -137,8 +137,7 @@ class ChassisEvent(row_event.RowEvent):
|
|||
phy_nets = []
|
||||
if event != self.ROW_DELETE:
|
||||
bridge_mappings = row.external_ids.get('ovn-bridge-mappings', '')
|
||||
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','),
|
||||
unique_values=False)
|
||||
mapping_dict = helpers.parse_mappings(bridge_mappings.split(','))
|
||||
phy_nets = list(mapping_dict)
|
||||
|
||||
self.driver.update_segment_host_mapping(host, phy_nets)
|
||||
|
|
|
@ -53,7 +53,7 @@ class TestSbApi(BaseOvnIdlTest):
|
|||
{'external_ids': {'ovn-bridge-mappings':
|
||||
'public:br-ex,private:br-0'}},
|
||||
{'external_ids': {'ovn-bridge-mappings':
|
||||
'public:br-ex,public2:br-ex'}},
|
||||
'public:br-ex,public2:br-ex2'}},
|
||||
{'external_ids': {'ovn-bridge-mappings':
|
||||
'public:br-ex'}},
|
||||
]
|
||||
|
@ -99,6 +99,15 @@ class TestSbApi(BaseOvnIdlTest):
|
|||
self.assertGreaterEqual(set(mapping.keys()),
|
||||
{c['name'] for c in self.data['chassis']})
|
||||
|
||||
def test_multiple_physnets_in_one_bridge(self):
|
||||
self.data = {
|
||||
'chassis': [
|
||||
{'external_ids': {'ovn-bridge-mappings': 'p1:br-ex,p2:br-ex'}}
|
||||
]
|
||||
}
|
||||
self.load_test_data()
|
||||
self.assertRaises(ValueError, self.api.get_chassis_and_physnets)
|
||||
|
||||
def _add_switch_port(self, chassis_name, type='localport'):
|
||||
sname, pname = (utils.get_rand_device_name(prefix=p)
|
||||
for p in ('switch', 'port'))
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
other:
|
||||
- |
|
||||
OVN mechanism driver allows only to have one physical network per bridge.
|
Loading…
Reference in New Issue