From b006e6bcb4b58039663b5ee0d0b007cf42245e49 Mon Sep 17 00:00:00 2001 From: Jian Wen Date: Tue, 11 Sep 2012 20:57:14 +0800 Subject: libvirt: Fix live block migration Current check_can_live_migrate_destination trys to get instance info by call self._conn.lookupByName(instance_name) on the destination host before migrating. Because the instance is not on the destination host yet, it failes with InstanceNotFound. This fix gets the available disk size of the destination side. On the source side, checks whether the above space is enough before migrating. Fixes bug 1044237 Change-Id: I20f64e1f85828049b697a4b1173bac8e5779d45a --- nova/compute/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 95ad4b7d0..a9ab17a13 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1938,8 +1938,9 @@ class API(base.Base): def live_migrate(self, context, instance, block_migration, disk_over_commit, host): """Migrate a server lively to a new host.""" - LOG.debug(_("Going to try to live migrate instance"), - instance=instance) + LOG.debug(_("Going to try to live migrate instance to %s"), + host, instance=instance) + self.scheduler_rpcapi.live_migration(context, block_migration, disk_over_commit, instance, host) -- cgit