From 152745ce2d1b947035068b66afb4554b46b418ac Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Tue, 5 Jul 2016 18:04:58 +0300 Subject: [PATCH] resync: small differences Add checks for driver attach_interfaces capability (cherry-picked from commit 4ad414f3b1216393301ef268a64e61ca1a3d5be9) (cherry-picked from commit d9c3e174f7a24a524638f54be41abe7c3f1cde46) Change-Id: I62d93b50e9e475115041324f28a87c8776d19844 --- hyperv/nova/driver.py | 3 ++- hyperv/nova/livemigrationops.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hyperv/nova/driver.py b/hyperv/nova/driver.py index e478d8a4..6c47b8d5 100644 --- a/hyperv/nova/driver.py +++ b/hyperv/nova/driver.py @@ -99,7 +99,8 @@ class HyperVDriver(driver.ComputeDriver): capabilities = { "has_imagecache": True, "supports_recreate": False, - "supports_migrate_to_same_host": True + "supports_migrate_to_same_host": True, + "supports_attach_interface": True } def __init__(self, virtapi): diff --git a/hyperv/nova/livemigrationops.py b/hyperv/nova/livemigrationops.py index 28e9f8ce..9985019e 100644 --- a/hyperv/nova/livemigrationops.py +++ b/hyperv/nova/livemigrationops.py @@ -92,6 +92,8 @@ class LiveMigrationOps(object): disk_path_mapping = self._volumeops.get_disk_path_mapping( block_device_info, block_dev_only=True) if disk_path_mapping: + # We create a planned VM, ensuring that volumes will remain + # attached after the VM is migrated. self._livemigrutils.create_planned_vm(instance.name, instance.host, disk_path_mapping)