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.
---
 lib/cmdlib.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 2f419c9..5f55173 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -3536,10 +3536,12 @@ 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)
 
     # check bridge existance
     brlist = [nic.bridge for nic in instance.nics]
-- 
1.6.3

Reply via email to