ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Program.Hbal
Description
Cluster rebalancer.
Synopsis
options :: [OptType]
iterateDepth :: Bool -> Table -> Int -> Bool -> Bool -> Int -> Int -> [MoveJob] -> Score -> Score -> Score -> Bool -> IO (Table, [MoveJob])
printStats :: List -> List -> IO ()
saveBalanceCommands :: Options -> String -> IO ()
waitForJobs :: Client -> [String] -> IO (Result [JobStatus])
checkJobsStatus :: [JobStatus] -> Bool
execWrapper :: String -> List -> List -> IORef Int -> [JobSet] -> IO Bool
execJobSet :: String -> List -> List -> IORef Int -> [JobSet] -> IO Bool
maybeExecJobs :: Options -> [a] -> List -> List -> [JobSet] -> IO Bool
hangleSigInt :: IORef Int -> IO ()
hangleSigTerm :: IORef Int -> IO ()
runJobSet :: String -> List -> List -> [JobSet] -> IO Bool
selectGroup :: Options -> List -> List -> List -> IO (String, (List, List))
checkCluster :: Int -> List -> List -> IO ()
checkGroup :: Int -> String -> List -> List -> IO ()
checkNeedRebalance :: Options -> Score -> IO ()
main :: Options -> [String] -> IO ()
Documentation
options :: [OptType]Source
Options list and functions.
iterateDepthSource
:: BoolWhether to print moves
-> TableThe starting table
-> IntRemaining length
-> BoolAllow disk moves
-> BoolAllow instance moves
-> IntMax node name len
-> IntMax instance name len
-> [MoveJob]Current command list
-> ScoreScore at which to stop
-> ScoreMin gain limit
-> ScoreMin score gain
-> BoolEnable evacuation mode
-> IO (Table, [MoveJob])The resulting table and commands
Start computing the solution at the given depth and recurse until we find a valid solution or we exceed the maximum depth.
printStats :: List -> List -> IO ()Source
Displays the cluster stats.
saveBalanceCommands :: Options -> String -> IO ()Source
Saves the rebalance commands to a text file.
waitForJobs :: Client -> [String] -> IO (Result [JobStatus])Source
Polls a set of jobs at a fixed interval until all are finished one way or another.
checkJobsStatus :: [JobStatus] -> BoolSource
Check that a set of job statuses is all success.
execWrapper :: String -> List -> List -> IORef Int -> [JobSet] -> IO BoolSource
Wrapper over execJobSet checking for early termination.
execJobSet :: String -> List -> List -> IORef Int -> [JobSet] -> IO BoolSource
Execute an entire jobset.
maybeExecJobs :: Options -> [a] -> List -> List -> [JobSet] -> IO BoolSource
Executes the jobs, if possible and desired.
hangleSigInt :: IORef Int -> IO ()Source
Signal handler for graceful termination.
hangleSigTerm :: IORef Int -> IO ()Source
Signal handler for immediate termination.
runJobSet :: String -> List -> List -> [JobSet] -> IO BoolSource
Runs a job set with handling of signals.
selectGroup :: Options -> List -> List -> List -> IO (String, (List, List))Source
Select the target node group.
checkCluster :: Int -> List -> List -> IO ()Source
Do a few checks on the cluster data.
checkGroup :: Int -> String -> List -> List -> IO ()Source
Do a few checks on the selected group data.
checkNeedRebalance :: Options -> Score -> IO ()Source
Check that we actually need to rebalance.
main :: Options -> [String] -> IO ()Source
Main function.
Produced by Haddock version 2.6.0