From e507094eef9a7b4a54a04faade8aa95a36fa6d93 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Fri, 22 Mar 2013 10:23:22 +0000 Subject: Enable live block migration when using iSCSI volumes Fix for bug 1160323. DocImpact Depends on a version of XAPI supporting relax-xsm-sr-check. Currently no release versions support this, so the change at https://github.com/xen-org/xen-api/pull/1116 would need to be applied to the source to enable this. XenServer 6.2 is expected to support this mode, and possibly some future hotfixes for XenServer 6.1. It also depends on a configuration change which must be documented and added to devstack: * Set "relax-xsm-sr-check = true" in /etc/xapi.conf This commit makes the following changes: * Attach the SR on the destination host prior to migrate * Returns the SR-ref from the pre_migrate call (API change) * Populates the XS VDI map with the sr-ref on the destination host * Removes the connection to the SR from the source host post-migrate * Added plugin to determine if iSCSI block migration is enabled Associated tempest test at https://review.openstack.org/#/c/26478/ Change-Id: I917d9cf094190d636f4b9e14f6c8e728ff85af0e Fixes: bug 1160323 --- nova/compute/manager.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 70d88117d..edf9da667 100755 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3224,7 +3224,8 @@ class ComputeManager(manager.SchedulerDependentManager): raise exception.FixedIpNotFoundForInstance( instance_uuid=instance['uuid']) - self.driver.pre_live_migration(context, instance, + pre_live_migration_data = self.driver.pre_live_migration(context, + instance, block_device_info, self._legacy_nw_info(network_info), migrate_data) @@ -3246,6 +3247,8 @@ class ComputeManager(manager.SchedulerDependentManager): if block_migration: self.driver.pre_block_migration(context, instance, disk) + return pre_live_migration_data + def live_migration(self, context, dest, instance, block_migration=False, migrate_data=None): """Executing live migration. @@ -3257,14 +3260,18 @@ class ComputeManager(manager.SchedulerDependentManager): :param migrate_data: implementation specific params """ + # Create a local copy since we'll be modifying the dictionary + migrate_data = dict(migrate_data or {}) try: if block_migration: disk = self.driver.get_instance_disk_info(instance['name']) else: disk = None - self.compute_rpcapi.pre_live_migration(context, instance, - block_migration, disk, dest, migrate_data) + pre_migration_data = self.compute_rpcapi.pre_live_migration( + context, instance, + block_migration, disk, dest, migrate_data) + migrate_data['pre_live_migration_result'] = pre_migration_data except Exception: with excutils.save_and_reraise_exception(): -- cgit