Handle better failing over non-running instances
authorGuido Trotter <ultrotter@google.com>
Wed, 2 Apr 2008 18:05:54 +0000 (18:05 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 2 Apr 2008 18:05:54 +0000 (18:05 +0000)
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

lib/cmdlib.py

index 173f87b..96e028d 100644 (file)
@@ -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)