From a72f25dba2cccbbcdd8c8927f0bc6199272b67ce Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 23 Apr 2012 13:09:21 +0200 Subject: allow power state "BLOCKED" for live migrations if using Xen by libvirt fixes bug 985587 Change-Id: I7184dd639733a68f6b31e5e3e4311c7aa8d50220 --- nova/scheduler/driver.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py index ad83bc10a..d4ba58d6f 100644 --- a/nova/scheduler/driver.py +++ b/nova/scheduler/driver.py @@ -46,6 +46,7 @@ FLAGS = flags.FLAGS FLAGS.register_opts(scheduler_driver_opts) flags.DECLARE('instances_path', 'nova.compute.manager') +flags.DECLARE('libvirt_type', 'nova.virt.libvirt.connection') def cast_to_volume_host(context, host, method, update_db=True, **kwargs): @@ -247,7 +248,9 @@ class Scheduler(object): """ # Checking instance is running. - if instance_ref['power_state'] != power_state.RUNNING: + if instance_ref['power_state'] != power_state.RUNNING and not ( + FLAGS.libvirt_type == 'xen' and + instance_ref['power_state'] == power_state.BLOCKED): raise exception.InstanceNotRunning( instance_id=instance_ref['uuid']) -- cgit