ganeti
Safe HaskellNone

Ganeti.HTools.Program.Hcheck

Description

Cluster checker.

Synopsis

Documentation

options :: IO [OptType] Source #

Options list and functions.

arguments :: [ArgCompletion] Source #

The list of arguments supported by the program.

data Phase Source #

Check phase - are we before (initial) or after rebalance.

Constructors

Initial 
Rebalanced 

data Level Source #

Level of presented statistics.

Constructors

GroupLvl String

Group level, with name

ClusterLvl

Cluster level

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 :: String Source #

Prefix for machine readable names.

commonData :: Options -> [(String, String)] Source #

Data showed both per group and per cluster.

groupData :: Options -> [(String, String)] Source #

Data showed per group.

clusterData :: Options -> [(String, String)] Source #

Data showed per cluster.

phasePrefix :: Phase -> String Source #

Phase-specific prefix for machine readable version.

levelPrefix :: Level -> String Source #

Level-specific prefix for machine readable version.

keysData :: Options -> Level -> [String] Source #

Machine-readable keys to show depending on given level.

phaseDescr :: Phase -> String Source #

Description of phases for human readable version.

descrData :: Options -> Level -> [String] Source #

Description to show depending on given level.

phaseLevelDescr :: Phase -> Level -> String Source #

Human readable prefix for statistics.

printKeysHTC :: [(String, String)] -> IO () Source #

Format a list of key, value as a shell fragment.

printBool Source #

Arguments

:: Bool

Whether the result should be machine readable

-> Bool

Value 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 -> String -> String Source #

Prepare a single key given a certain level and phase of simulation.

printStats Source #

Arguments

:: Options 
-> Bool

If the output should be machine readable

-> Level

Level on which we are printing

-> Phase

Current phase of simulation

-> [String]

Values to print

-> IO () 

Print all the statistics for given level and phase.

extractGroupData :: Bool -> Group -> String Source #

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 :: Options -> Bool -> Phase -> GroupStats -> IO () Source #

Print all the statistics on a group level.

printClusterStats :: Options -> Bool -> Phase -> [Int] -> Bool -> IO () Source #

Print all the statistics on a cluster (global) level.

clusterNeedsRebalance :: [Int] -> Bool Source #

Check if any of cluster metrics is non-zero.

perGroupChecks :: Options -> List -> GroupInfo -> GroupStats Source #

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 GroupInfo Source #

Use Hbal's iterateDepth to simulate group rebalance.

maybeSimulateGroupRebalance :: Options -> GroupInfo -> IO GroupInfo Source #

Simulate group rebalance if group's score is not good

maybeSimulateRebalance Source #

Arguments

:: Bool

Whether to simulate rebalance

-> Options

Command 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.