Make hroller not consider offline nodes for evacuation
authorKlaus Aehlig <aehlig@google.com>
Wed, 26 Jun 2013 12:51:24 +0000 (14:51 +0200)
committerKlaus Aehlig <aehlig@google.com>
Mon, 1 Jul 2013 07:52:52 +0000 (09:52 +0200)
When planing on where to evacuate the non-redundant instances
of the nodes to be rebooted, it doesn't make sense to consider
offline nodes. So add this restriction to hroller.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

src/Ganeti/HTools/Program/Hroller.hs

index 1887a86..1bd1099 100644 (file)
@@ -252,7 +252,8 @@ main opts args = do
       colorings = map (\(v,a) -> (v,(colorVertMap.a) nodeGraph)) colorAlgorithms
       smallestColoring = IntMap.elems $
         (snd . minimumBy (comparing (IntMap.size . snd))) colorings
-      allNdx = map Node.idx $ Container.elems nlf
+      allNdx = map Node.idx . filter (not . Node.offline) . Container.elems
+               $ nlf
       splitted = mapM (\ grp -> partitionNonRedundant grp allNdx (nlf,ilf))
                  smallestColoring
   rebootGroups <- if optIgnoreNonRedundant opts