....to support iterative utilization-based cluster
balancing, allowing for reevaluation of the load
after each group of moves.

Signed-off-by: Klaus Aehlig <aeh...@google.com>
---
 src/Ganeti/HTools/Program/Hbal.hs | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/Ganeti/HTools/Program/Hbal.hs 
b/src/Ganeti/HTools/Program/Hbal.hs
index f8fa48d..79e2217 100644
--- a/src/Ganeti/HTools/Program/Hbal.hs
+++ b/src/Ganeti/HTools/Program/Hbal.hs
@@ -86,6 +86,7 @@ options = do
     , luxi
     , oIAllocSrc
     , oExecJobs
+    , oFirstJobGroup
     , oGroup
     , oMaxSolLength
     , oVerbose
@@ -357,9 +358,13 @@ main opts args = do
   unless (verbose < 1) $
          printf "Solution length=%d\n" (length ord_plc)
 
-  let cmd_jobs = Cluster.splitJobs cmd_strs
+  let cmd_jobs = (if optFirstJobGroup opts then take 1 else id)
+                 $ Cluster.splitJobs cmd_strs
 
-  maybeSaveCommands "Commands to run to reach the above solution:" opts
+  maybeSaveCommands (if optFirstJobGroup opts
+                        then "First set of jobs"
+                        else "Commands to run to reach the above solution:")
+                    opts
     $ Cluster.formatCmds cmd_jobs
 
   maybeSaveData (optSaveCluster opts) "balanced" "after balancing"
-- 
2.2.0.rc0.207.ga3a616c

Reply via email to