Skip to content

Commit 986a0f0

Browse files
ralonsohdougszumski
authored andcommitted
Revert "[OVN] Always exclude the local chassis creating HA_Chassis_Group"
This reverts commit 4238ccb. Reason for revert: this patch is breaking the Ironic CI. The external can be bound to a gateway chassis and yet this chassis can be used to build the ``HA_Chassis_Group`` register. This limitation imposed by the reverted patch doesn't work if the environment has one single gateway chassis, usually happening that in CI jobs. Change-Id: I201d7681c1a1b0c6e3f54c46ba5d4be586c709ff Signed-off-by: Rodolfo Alonso Hernandez <ralonsoh@redhat.com>
1 parent e8518fb commit 986a0f0

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

neutron/common/ovn/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,19 +1237,20 @@ def sync_ha_chassis_group_network(context, nb_idl, sb_idl, port_id,
12371237
chassis_list = sb_idl.get_extport_chassis_from_cms_options()
12381238
if chassis_list:
12391239
group_name = ovn_extport_chassis_group_name(port_id)
1240+
# Check if the port is bound to a chassis and if so, ignore that
1241+
# chassis when building the HA Chassis Group to ensure the
1242+
# external port is bound to a different chassis than the VM
1243+
ignore_chassis = sb_idl.get_chassis_host_for_port(port_id)
12401244
LOG.debug('HA Chassis Group %s is based on external port %s '
12411245
'(network %s)', group_name, port_id, network_id)
12421246
else:
12431247
chassis_list = sb_idl.get_gateway_chassis_from_cms_options(
12441248
name_only=False)
12451249
group_name = ovn_name(network_id)
1250+
ignore_chassis = set()
12461251
LOG.debug('HA Chassis Group %s is based on network %s',
12471252
group_name, network_id)
12481253

1249-
# Check if the port is bound to a chassis and if so, ignore that
1250-
# chassis when building the HA Chassis Group to ensure the
1251-
# external port is bound to a different chassis than the VM
1252-
ignore_chassis = sb_idl.get_chassis_host_for_port(port_id)
12531254
plugin = directory.get_plugin()
12541255
resource = plugin.get_network(context, network_id)
12551256
az_hints = common_utils.get_az_hints(resource)

neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/test_mech_driver.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,9 +2880,7 @@ def test_sync_ha_chassis_group_network_as_gw(self, mock_sync_hcg):
28802880
self.sb_ovn.get_extport_chassis_from_cms_options.return_value = []
28812881
self.sb_ovn.get_gateway_chassis_from_cms_options.return_value = [
28822882
ch0, ch1, ch2, ch3, ch4, ch5]
2883-
expected_ignore_chassis = [ch4.name, ch5.name]
2884-
self.sb_ovn.get_chassis_host_for_port.return_value = set(
2885-
expected_ignore_chassis)
2883+
28862884
ovn_utils.sync_ha_chassis_group_network(
28872885
self.context, self.nb_ovn, self.sb_ovn, fake_port['id'],
28882886
fake_net['id'], None)
@@ -2896,8 +2894,7 @@ def test_sync_ha_chassis_group_network_as_gw(self, mock_sync_hcg):
28962894
self.assertEqual(expected_ch_list,
28972895
hcg_info.chassis_list)
28982896
self.assertEqual(expected_az_hints, hcg_info.az_hints)
2899-
self.assertEqual(sorted(expected_ignore_chassis),
2900-
sorted(hcg_info.ignore_chassis))
2897+
self.assertEqual(set(), hcg_info.ignore_chassis)
29012898

29022899
@mock.patch.object(ovn_utils, '_sync_ha_chassis_group')
29032900
def test_sync_ha_chassis_group_router(self, mock_sync_hcg):

0 commit comments

Comments
 (0)