KVM live migration: handle failure
authorGuido Trotter <ultrotter@google.com>
Wed, 21 Jan 2009 18:23:44 +0000 (18:23 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 21 Jan 2009 18:23:44 +0000 (18:23 +0000)
If the KVM live migration ends up in a 'failed' state it has been
aborted at the kvm level, and the machine is still running locally.
We support also the 'cancelled' state even though there should be no way
of reaching it, without manual intervention.

Reviewed-by: iustinp

lib/hypervisor/hv_kvm.py

index ba5b39d..028e675 100644 (file)
@@ -506,6 +506,11 @@ class KVMHypervisor(hv_base.BaseHypervisor):
           done = True
         elif status == 'active':
           time.sleep(2)
+        elif status == 'failed' or status == 'cancelled':
+          if not live:
+            self._CallMonitorCommand(instance_name, 'cont')
+          raise errors.HypervisorError("Migration %s at the kvm level" %
+                                       status)
         else:
           logging.info("KVM: unknown migration status '%s'" % status)
           time.sleep(2)