On Mon, Jul 27, 2015 at 02:56:05PM +0200, 'Klaus Aehlig' via ganeti-devel wrote:
When choosing a group for allocating a new instance, not only
consider how balanced the group of the new instance would be,
but look at the overall balancedness of the cluster.
The net effect of this change is that hail will prefer the most
empty group and not (as it is now) the most balanced node group.
This will keep the overall cluster more balanced.
Signed-off-by: Klaus Aehlig <[email protected]>
---
src/Ganeti/HTools/Cluster.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Ganeti/HTools/Cluster.hs b/src/Ganeti/HTools/Cluster.hs
index 3b6aadb..b8f1f60 100644
--- a/src/Ganeti/HTools/Cluster.hs
+++ b/src/Ganeti/HTools/Cluster.hs
@@ -618,9 +618,9 @@ findBestAllocGroup opts mggl mgnl mgil allowed_gdxs inst
cnt =
(\gs -> filter ((`elem` gs) . Group.idx . fst) groups)
allowed_gdxs
(groups'', filter_group_msgs) = filterValidGroups groups' inst
- sols = map (\(gr, (nl, il)) ->
+ sols = map (\(gr, (nl, _)) ->
(gr, genAllocNodes opts mggl nl cnt False >>=
- tryAlloc opts nl il inst))
+ tryAlloc opts mgnl mgil inst))
groups''::[(Group.Group, Result AllocSolution)]
all_msgs = filter_group_msgs ++ concatMap solutionDescription sols
goodSols = filterMGResults sols
--
2.5.0.rc2.392.g76e840b
LGTM