Ignore results from drained nodes in iallocator
authorIustin Pop <iustin@google.com>
Wed, 12 Aug 2009 12:22:41 +0000 (14:22 +0200)
committerIustin Pop <iustin@google.com>
Wed, 12 Aug 2009 13:58:08 +0000 (15:58 +0200)
Since drained nodes could be (partially or fully) broken in iallocator,
we ignore results from these nodes when building the cluster map in
preparation for sending it to the script.

This is a cheap change for the stable branch; ideally we should not
query them at all.

The patch also fixes a typo in iallocator.rst.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

doc/iallocator.rst
lib/cmdlib.py

index 9dfc847..408b908 100644 (file)
@@ -176,7 +176,7 @@ instances
 
 nodes
   dictionary with the data for the nodes in the cluster, indexed by
-  the node name; the dict contains:
+  the node name; the dict contains [*]_ :
 
   total_disk
     the total disk size of this node (mebibytes)
@@ -225,9 +225,13 @@ nodes
   or ``offline`` flags set. More details about these of node status
   flags is available in the manpage *ganeti(7)*.
 
+.. [*] Note that no run-time data is present for offline or drained nodes;
+   this means the tags total_memory, reserved_memory, free_memory, total_disk,
+   free_disk, total_cpus, i_pri_memory and i_pri_up memory will be absent
 
-Respone message
-~~~~~~~~~~~~~~~
+
+Response message
+~~~~~~~~~~~~~~~~
 
 The response message is much more simple than the input one. It is
 also a dict having three keys:
index 1919663..78a379d 100644 (file)
@@ -6907,7 +6907,7 @@ class IAllocator(object):
         "master_candidate": ninfo.master_candidate,
         }
 
-      if not ninfo.offline:
+      if not (ninfo.offline or ninfo.drained):
         nresult.Raise()
         if not isinstance(nresult.data, dict):
           raise errors.OpExecError("Can't get data for node %s" % nname)