Revision 3fea6959 Ganeti/HTools/Cluster.hs

b/Ganeti/HTools/Cluster.hs
476 476
       else best_tbl
477 477

  
478 478
-- | Check if we are allowed to go deeper in the balancing
479

  
480
doNextBalance :: Table       -- ^ The starting table
481
              -> Int         -- ^ Remaining length
482
              -> Score       -- ^ Score at which to stop
483
              -> Bool -- ^ The resulting table and commands
479
doNextBalance :: Table     -- ^ The starting table
480
              -> Int       -- ^ Remaining length
481
              -> Score     -- ^ Score at which to stop
482
              -> Bool      -- ^ The resulting table and commands
484 483
doNextBalance ini_tbl max_rounds min_score =
485 484
    let Table _ _ ini_cv ini_plc = ini_tbl
486 485
        ini_plc_len = length ini_plc
487 486
    in (max_rounds < 0 || ini_plc_len < max_rounds) && ini_cv > min_score
488 487

  
489 488
-- | Run a balance move
490

  
491 489
tryBalance :: Table       -- ^ The starting table
492 490
           -> Bool        -- ^ Allow disk moves
493 491
           -> Bool        -- ^ Only evacuate moves
......
599 597
                                \destinations required (" ++ show reqn ++
600 598
                                                  "), only one supported"
601 599

  
602
-- | Try to allocate an instance on the cluster.
600
-- | Try to evacuate a list of nodes.
603 601
tryEvac :: (Monad m) =>
604 602
            Node.List       -- ^ The node list
605 603
         -> Instance.List   -- ^ The instance list

Also available in: Unified diff