Commit a0aaa0d0 authored by Guido Trotter's avatar Guido Trotter
Browse files

Handle better failing over non-running instances

Right now if you try to failover an instance which is not marked as up the
operation will fail unless you pass the --ignore-consistency flag because the
disks won't be considered to be consistent. Allow them to be if we know the
instance shouldn't be up.

Reviewed-by: imsnah
parent fb300fb7
......@@ -2634,7 +2634,7 @@ class LUFailoverInstance(LogicalUnit):
for dev in instance.disks:
# for remote_raid1, these are md over drbd
if not _CheckDiskConsistency(self.cfg, dev, target_node, False):
if not self.op.ignore_consistency:
if instance.status == "up" and not self.op.ignore_consistency:
raise errors.OpExecError("Disk %s is degraded on target node,"
" aborting failover." % dev.iv_name)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment