N+1: verify using minimum memory
authorGuido Trotter <ultrotter@google.com>
Fri, 27 Jan 2012 13:33:06 +0000 (13:33 +0000)
committerGuido Trotter <ultrotter@google.com>
Fri, 27 Jan 2012 14:56:57 +0000 (14:56 +0000)
Since instances can be started, failed over and migrated with less than
their maximum memory N+1 will use the minimum memory for verification.

Note that this accounts only for the instances being moved being
resized, and not for the ones already on the node, as ganeti will not
automatically resize other instances on the target node now when trying
to start/failover/migrate an instance.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py

index 2a895e7..81f21ae 100644 (file)
@@ -2429,14 +2429,13 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
         # we already list instances living on such nodes, and that's
         # enough warning
         continue
-      #TODO(dynmem): use MINMEM for checking
       #TODO(dynmem): also consider ballooning out other instances
       for prinode, instances in n_img.sbp.items():
         needed_mem = 0
         for instance in instances:
           bep = cluster_info.FillBE(instance_cfg[instance])
           if bep[constants.BE_AUTO_BALANCE]:
-            needed_mem += bep[constants.BE_MAXMEM]
+            needed_mem += bep[constants.BE_MINMEM]
         test = n_img.mfree < needed_mem
         self._ErrorIf(test, constants.CV_ENODEN1, node,
                       "not enough memory to accomodate instance failovers"