From: Guido Trotter Date: Wed, 2 Apr 2008 18:00:27 +0000 (+0000) Subject: Handle better failing over non-running instances X-Git-Tag: v1.2.4~157 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/c299278d4d05f37f87683c3bcae5035d90d4900c 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 --- diff --git a/lib/cmdlib.py b/lib/cmdlib.py index aeeda5b..34f2955 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -2609,7 +2609,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)