diff options
author | LuyaoZhong <luyao.zhong@intel.com> | 2020-03-27 08:07:17 +0000 |
---|---|---|
committer | LuyaoZhong <luyao.zhong@intel.com> | 2020-04-07 13:13:13 +0000 |
commit | 4bd5af66b55b1ac5e5fa654eb31bf90616d62256 (patch) | |
tree | 1fc2a45255fa48f54ecb16954586c3fd16100773 /nova/conductor | |
parent | 990a26ef1fa5e7d9e607951070ede4dfb5d6acd0 (diff) | |
download | nova-4bd5af66b55b1ac5e5fa654eb31bf90616d62256.tar.gz |
Support live migration with vpmem
1. Check if the cluster supports live migration with vpmem
2. On source host we generate new dest xml with vpmem info stored in
migration_context.new_resources.
3. If there are vpmems, cleanup them on host/destination when live
migration succeeds/fails
Change-Id: I5c346e690148678a2f0dc63f4f516a944c3db8cd
Implements: blueprint support-live-migration-with-virtual-persistent-memory
Diffstat (limited to 'nova/conductor')
-rw-r--r-- | nova/conductor/tasks/live_migrate.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/nova/conductor/tasks/live_migrate.py b/nova/conductor/tasks/live_migrate.py index 5aa701e688..36a856d779 100644 --- a/nova/conductor/tasks/live_migrate.py +++ b/nova/conductor/tasks/live_migrate.py @@ -46,6 +46,17 @@ def supports_vif_related_pci_allocations(context, host): return svc.version >= 36 +def supports_vpmem_live_migration(context): + """Checks if the commpute host service is new enough to support + instance live migration with virtual persistent memory. + + :param context: The user request context. + :returns: True if the compute hosts are new enough to support live + migration with vpmem + """ + return objects.Service.get_minimum_version(context, 'nova-compute') >= 51 + + class LiveMigrationTask(base.TaskBase): def __init__(self, context, instance, destination, block_migration, disk_over_commit, migration, compute_rpcapi, @@ -261,11 +272,16 @@ class LiveMigrationTask(base.TaskBase): if not self.instance.resources: return + has_vpmem = False for resource in self.instance.resources: if resource.resource_class.startswith("CUSTOM_PMEM_NAMESPACE_"): - raise exception.MigrationPreCheckError( - reason="Cannot live migration with virtual persistent " - "memory, the operation is not supported.") + has_vpmem = True + break + + if has_vpmem and not supports_vpmem_live_migration(self.context): + raise exception.MigrationPreCheckError( + reason="Cannot live migrate with virtual persistent memory, " + "the operation is not supported.") def _check_host_is_up(self, host): service = objects.Service.get_by_compute_host(self.context, host) |