From 07578e7c5553ca8fdf713b3ea24b7f2b8d6144ed Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Wed, 4 Sep 2019 10:07:13 -0400 Subject: [PATCH] Remove Rocky compute compat checks for live migration with port bindings The nova-compute RPC API version 35 was added in Rocky [1] to signal computes that can support live migration with the neutron port bindings extended API. The check in conductor was added in Rocky as well [2] to only use port bindings when both the source and destination compute were running at least version 35. Now that we're past supporting rolling upgrades from Rocky compute services we can remove that check in conductor. [1] I1ba00850bdd7c015c5f462f1d75a5b833a5e9af9 [2] Ie04ded7b0f4edbb98af92f2ce713cf712a83b383 Change-Id: I007a75ad6743909028c3b23f614c693cee9e4a93 --- nova/conductor/tasks/live_migrate.py | 21 ++----------------- .../unit/conductor/tasks/test_live_migrate.py | 4 +--- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/nova/conductor/tasks/live_migrate.py b/nova/conductor/tasks/live_migrate.py index 6254187655..a9385efdbf 100644 --- a/nova/conductor/tasks/live_migrate.py +++ b/nova/conductor/tasks/live_migrate.py @@ -32,19 +32,6 @@ LOG = logging.getLogger(__name__) CONF = nova.conf.CONF -def supports_extended_port_binding(context, host): - """Checks if the compute host service is new enough to support the neutron - port binding-extended details. - - :param context: The user request context. - :param host: The nova-compute host to check. - :returns: True if the compute host is new enough to support extended - port binding information, False otherwise. - """ - svc = objects.Service.get_by_host_and_binary(context, host, 'nova-compute') - return svc.version >= 35 - - def supports_vif_related_pci_allocations(context, host): """Checks if the compute host service is new enough to support VIF related PCI allocation during live migration @@ -344,12 +331,8 @@ class LiveMigrationTask(base.TaskBase): "%s") % destination raise exception.MigrationPreCheckError(msg) - # Check to see that neutron supports the binding-extended API and - # check to see that both the source and destination compute hosts - # are new enough to support the new port binding flow. - if (self.network_api.supports_port_binding_extension(self.context) and - supports_extended_port_binding(self.context, self.source) and - supports_extended_port_binding(self.context, destination)): + # Check to see that neutron supports the binding-extended API. + if self.network_api.supports_port_binding_extension(self.context): if 'vifs' not in self.migrate_data: # migrate data vifs were not constructed in dest compute # during check_can_live_migrate_destination, construct a diff --git a/nova/tests/unit/conductor/tasks/test_live_migrate.py b/nova/tests/unit/conductor/tasks/test_live_migrate.py index d3586e8b90..6a77da616e 100644 --- a/nova/tests/unit/conductor/tasks/test_live_migrate.py +++ b/nova/tests/unit/conductor/tasks/test_live_migrate.py @@ -612,9 +612,7 @@ class LiveMigrationTaskTestCase(test.NoDBTestCase): self.assertRaises(exception.MigrationPreCheckError, self.task._call_livem_checks_on_host, {}) - @mock.patch('nova.conductor.tasks.live_migrate.' - 'supports_extended_port_binding', return_value=True) - def test_call_livem_checks_on_host_bind_ports(self, mock_supports_ext): + def test_call_livem_checks_on_host_bind_ports(self): data = objects.LibvirtLiveMigrateData() bindings = { uuids.port1: {'host': 'dest-host'},