ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Program.Hcheck
Description
Cluster checker.
Synopsis
options :: [OptType]
data Phase
= Initial
| Rebalanced
data Level
= GroupLvl
| ClusterLvl
type GroupInfo = (Gdx, (List, List))
type GroupStats = ((Group, Double), [Int])
htcPrefix :: String
commonData :: [(String, String)]
groupData :: [(String, String)]
clusterData :: [(String, String)]
phasePrefix :: Phase -> String
levelPrefix :: Level -> String
keysData :: Level -> [String]
phaseDescr :: Phase -> String
descrData :: Level -> [String]
phaseLevelDescr :: Phase -> Level -> Maybe String -> String
printKeysHTC :: [(String, String)] -> IO ()
printBool :: Bool -> Bool -> String
printGroupsMappings :: List -> IO ()
prepareKey :: Level -> Phase -> Maybe String -> String -> String
printStats :: Int -> Bool -> Level -> Phase -> [String] -> Maybe String -> IO ()
extractGroupData :: Bool -> Group -> String
prepareGroupValues :: [Int] -> Double -> [String]
prepareClusterValues :: Bool -> [Int] -> [Bool] -> [String]
printGroupStats :: Int -> Bool -> Phase -> GroupStats -> IO ()
printClusterStats :: Int -> Bool -> Phase -> [Int] -> Bool -> IO ()
clusterNeedsRebalance :: [Int] -> Bool
perGroupChecks :: List -> GroupInfo -> GroupStats
executeSimulation :: Options -> Table -> Double -> Gdx -> List -> List -> IO GroupInfo
maybeSimulateGroupRebalance :: Options -> GroupInfo -> IO GroupInfo
maybeSimulateRebalance :: Bool -> Options -> [GroupInfo] -> IO [GroupInfo]
printFinalHTC :: Bool -> IO ()
main :: Options -> [String] -> IO ()
Documentation
options :: [OptType]Source
Options list and functions.
data Phase Source
Check phase - are we before (initial) or after rebalance.
Constructors
Initial
Rebalanced
data Level Source
Level of presented statistics.
Constructors
GroupLvl
ClusterLvl
type GroupInfo = (Gdx, (List, List))Source
A type alias for a group index and node/instance lists.
type GroupStats = ((Group, Double), [Int])Source
A type alias for group stats.
htcPrefix :: StringSource
Prefix for machine readable names.
commonData :: [(String, String)]Source
Data showed both per group and per cluster.
groupData :: [(String, String)]Source
Data showed per group.
clusterData :: [(String, String)]Source
Data showed per cluster.
phasePrefix :: Phase -> StringSource
Phase-specific prefix for machine readable version.
levelPrefix :: Level -> StringSource
Level-specific prefix for machine readable version.
keysData :: Level -> [String]Source
Machine-readable keys to show depending on given level.
phaseDescr :: Phase -> StringSource
Description of phases for human readable version.
descrData :: Level -> [String]Source
Description to show depending on given level.
phaseLevelDescr :: Phase -> Level -> Maybe String -> StringSource
Human readable prefix for statistics.
printKeysHTC :: [(String, String)] -> IO ()Source
Format a list of key, value as a shell fragment.
printBoolSource
:: BoolWhether the result should be machine readable
-> BoolValue to be converted to string
-> String
Prepare string from boolean value.
printGroupsMappings :: List -> IO ()Source
Print mapping from group idx to group uuid (only in machine readable mode).
prepareKey :: Level -> Phase -> Maybe String -> String -> StringSource
Prepare a single key given a certain level and phase of simulation.
printStatsSource
:: IntVerbosity level
-> BoolIf the output should be machine readable
-> LevelLevel on which we are printing
-> PhaseCurrent phase of simulation
-> [String]Values to print
-> Maybe StringAdditional data for groups
-> IO ()
Print all the statistics for given level and phase.
extractGroupData :: Bool -> Group -> StringSource
Extract name or idx from group.
prepareGroupValues :: [Int] -> Double -> [String]Source
Prepare values for group.
prepareClusterValues :: Bool -> [Int] -> [Bool] -> [String]Source
Prepare values for cluster.
printGroupStats :: Int -> Bool -> Phase -> GroupStats -> IO ()Source
Print all the statistics on a group level.
printClusterStats :: Int -> Bool -> Phase -> [Int] -> Bool -> IO ()Source
Print all the statistics on a cluster (global) level.
clusterNeedsRebalance :: [Int] -> BoolSource
Check if any of cluster metrics is non-zero.
perGroupChecks :: List -> GroupInfo -> GroupStatsSource
Check group for N+1 hapiness, conflicts of primaries on nodes and instances residing on offline nodes.
executeSimulation :: Options -> Table -> Double -> Gdx -> List -> List -> IO GroupInfoSource
Use Hbal's iterateDepth to simulate group rebalance.
maybeSimulateGroupRebalance :: Options -> GroupInfo -> IO GroupInfoSource
Simulate group rebalance if group's score is not good
maybeSimulateRebalanceSource
:: BoolWhether to simulate rebalance
-> OptionsCommand line options
-> [GroupInfo]Group data
-> IO [GroupInfo]
Decide whether to simulate rebalance.
printFinalHTC :: Bool -> IO ()Source
Prints the final OK marker in machine readable output.
main :: Options -> [String] -> IO ()Source
Main function.
Produced by Haddock version 2.6.0