Skip to content

Commit

Permalink
allow power state "BLOCKED" for live migrations if using Xen by libvirt
Browse files Browse the repository at this point in the history
fixes bug 985587

Change-Id: I7184dd639733a68f6b31e5e3e4311c7aa8d50220
  • Loading branch information
berendt committed Apr 23, 2012
1 parent 820b470 commit a72f25d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nova/scheduler/driver.py
Expand Up @@ -46,6 +46,7 @@
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):
Expand Down Expand Up @@ -247,7 +248,9 @@ def _live_migration_src_check(self, context, instance_ref):
"""

# 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'])

Expand Down

0 comments on commit a72f25d

Please sign in to comment.