From: Iustin Pop Date: Thu, 21 May 2009 13:20:10 +0000 (+0200) Subject: Change failover instance when instance is stopped X-Git-Tag: v2.0.1~6^2~5 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/d27776f046225736cf2f7ea06f0d33cc807cc65d Change failover instance when instance is stopped Currently, if the instance is stopped, we still check for enough memory on the target node. This is a little bit too strict, since in case too many nodes have failed and one is out of the memory, this prevents fixing the cluster (with the instances down). We change it to do the memory checks only when the instance will be started. Signed-off-by: Iustin Pop Reviewed-by: Guido Trotter --- diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 2f419c9..1ab20ac 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -3536,10 +3536,15 @@ class LUFailoverInstance(LogicalUnit): target_node = secondary_nodes[0] _CheckNodeOnline(self, target_node) _CheckNodeNotDrained(self, target_node) - # check memory requirements on the secondary node - _CheckNodeFreeMemory(self, target_node, "failing over instance %s" % - instance.name, bep[constants.BE_MEMORY], - instance.hypervisor) + + if instance.admin_up: + # check memory requirements on the secondary node + _CheckNodeFreeMemory(self, target_node, "failing over instance %s" % + instance.name, bep[constants.BE_MEMORY], + instance.hypervisor) + else: + self.LogInfo("Not checking memory on the secondary node as" + " instance will not be started") # check bridge existance brlist = [nic.bridge for nic in instance.nics]