FUP Remove unnecessary PCI check

This patch removes the _test_pci() method, which is no longer necessary
since flavor-based requests can now be live migrated.

The related tests have also been removed.

This fixes a bug where a user requests a live migration with a
flavor-based request and NUMA constraints (e.g., CPU affinity). In
this case, the code encounters the _test_pci() method and fails because
the check was originally designed to enforce port-based requests only,
causing an unnecessary failure.

Notes: This issue was discovered through functional tests that involve
a mix of port-based and flavor-based requests. The failure in this
scenario highlighted the unnecessary constraint.
A functional test reproducing this issue in a mixed-mode scenario
(port request + flavor-based request) will be provided in a subsequent
FUP patch.

The _test_pci() check was redundant, as a similar verification
is already performed earlier in the migration process.

Closes-Bug: 2103636
Implements: blueprint migrate-vfio-devices-using-kernel-variant-drivers
Change-Id: Icbeaadd94658ed44917d724446d484f6497f29e5
This commit is contained in:
René Ribaud
2025-03-12 11:37:50 +01:00
parent 725a307693
commit 4e4262cd3d
2 changed files with 0 additions and 39 deletions
-26
View File
@@ -206,32 +206,6 @@ class MoveClaim(Claim):
flavor=self.flavor)
self.instance.drop_migration_context()
def _test_pci(self):
"""Test whether this host can accept this claim's PCI requests. For
live migration, only Neutron SRIOV PCI requests are supported. Any
other type of PCI device would need to be removed and re-added for live
migration to work, and there is currently no support for that. For cold
migration, all types of PCI requests are supported, so we just call up
to normal Claim's _test_pci().
"""
if not self.migration.is_live_migration:
return super(MoveClaim, self)._test_pci()
if self._pci_requests.requests:
for pci_request in self._pci_requests.requests:
if (pci_request.source !=
objects.InstancePCIRequest.NEUTRON_PORT):
return (_('Non-VIF related PCI requests are not '
'supported for live migration.'))
# TODO(artom) At this point, once we've made sure we only have
# NEUTRON_PORT (aka SRIOV) PCI requests, we should check whether
# the host can support them, like Claim._test_pci() does. However,
# SRIOV live migration is currently being handled separately - see
# for example _claim_pci_for_instance_vifs() in the compute
# manager. So we do nothing here to avoid stepping on that code's
# toes, but ideally MoveClaim would be used for all live migration
# resource claims.
def _test_live_migration_page_size(self):
"""Tests that the current page size and the requested page size are the
same.
-13
View File
@@ -372,19 +372,6 @@ class MoveClaimTestCase(ClaimTestCase):
class LiveMigrationClaimTestCase(ClaimTestCase):
def test_live_migration_claim_bad_pci_request(self):
flavor = self._fake_flavor()
instance = self._fake_instance()
instance.numa_topology = None
self.assertRaisesRegex(
exception.ComputeResourcesUnavailable,
'PCI requests are not supported',
claims.MoveClaim, self.context, instance, _NODENAME, flavor,
{}, self.tracker, self.compute_node,
objects.InstancePCIRequests(requests=[
objects.InstancePCIRequest(alias_name='fake-alias')]),
objects.Migration(migration_type='live-migration'), None)
def test_live_migration_page_size(self):
flavor = self._fake_flavor()
instance = self._fake_instance()