ganeti
Safe HaskellNone

Ganeti.HTools.Program.Hroller

Description

Cluster rolling maintenance helper.

Synopsis

Documentation

options :: IO [OptType] Source #

Options list and functions.

arguments :: [ArgCompletion] Source #

The list of arguments supported by the program.

move :: Idx -> Ndx -> (List, List) -> OpResult (List, List) Source #

Compute the result of moving an instance to a different node.

locateInstance :: Idx -> [Ndx] -> (List, List) -> Result (List, List) Source #

Move a non-redundant instance to one of the candidate nodes mentioned.

locateInstances :: [Idx] -> [Ndx] -> (List, List) -> Result (List, List) Source #

Move a list of non-redundant instances to some of the nodes mentioned.

greedyClearNodes :: ((List, List) -> Ndx -> [Idx]) -> ([Idx] -> [Ndx] -> (List, List) -> Result (List, List)) -> [Ndx] -> [Ndx] -> (List, List) -> Result ([Ndx], (List, List)) Source #

Greedily clear a node of a kind of instances by a given relocation method. The arguments are a function providing the list of instances to be cleared, the relocation function, the list of nodes to be cleared, a list of nodes that can be relocated to, and the initial configuration. Returned is a list of nodes that can be cleared simultaneously and the configuration after clearing these nodes.

clearNodes :: [Ndx] -> [Ndx] -> (List, List) -> Result ([Ndx], (List, List)) Source #

Greedily move the non-redundant instances away from a list of nodes. Returns a list of ndoes that can be cleared simultaneously and the configuration after clearing these nodes.

partitionNodes :: ([Ndx] -> [Ndx] -> (List, List) -> Result ([Ndx], (List, List))) -> [Ndx] -> [Ndx] -> (List, List) -> Result [([Ndx], (List, List))] Source #

Partition nodes according to some clearing strategy. Arguments are the clearing strategy, the list of nodes to be cleared, the list of nodes that instances can be moved to, and the initial configuration. Returned is a partion of the nodes to be cleared with the configuration in that clearing situation.

partitionNonRedundant :: [Ndx] -> [Ndx] -> (List, List) -> Result [([Ndx], (List, List))] Source #

Parition a list of nodes into chunks according cluster capacity.

migrate :: Idx -> (List, List) -> OpResult (List, List) Source #

Compute the result of migrating an instance.

primaries :: (List, List) -> Ndx -> [Idx] Source #

Obtain the list of primaries for a given node. This restricts to those instances that have a secondary node.

migrateOffNodes :: ([Ndx], (List, List)) -> OpResult ([Ndx], (List, List)) Source #

Migrate all instances of a given list of nodes. The list of nodes is repeated as first argument in the result.

replaceSecondary :: Idx -> Ndx -> (List, List) -> OpResult (List, List) Source #

Compute the result of replacing the secondary node of an instance.

findSecondary :: Idx -> [Ndx] -> (List, List) -> Result (List, List) Source #

Find a suitable secondary node for the given instance from a list of nodes.

findSecondaries :: [Idx] -> [Ndx] -> (List, List) -> Result (List, List) Source #

Find suitable secondary nodes from the given nodes for a list of instances.

secondaries :: (List, List) -> Ndx -> [Idx] Source #

Obtain the list of secondaries for a given node.

clearSecondaries :: [Ndx] -> [Ndx] -> (List, List) -> Result ([Ndx], (List, List)) Source #

Greedily move secondaries away from a list of nodes. Returns a list of nodes that can be cleared simultaneously, and the configuration after these nodes are cleared.

partitionSecondaries :: [Ndx] -> [Ndx] -> (List, List) -> Result [([Ndx], (List, List))] Source #

Partition a list of nodes into chunks according to the ability to find suitable replacement secondary nodes.

getStats :: [(String, ColorVertMap)] -> String Source #

Gather statistics for the coloring algorithms. Returns a string with a summary on how each algorithm has performed, in order of non-decreasing effectiveness, and whether it tied or lost with the previous one.

hasGroup :: Maybe Group -> Node -> Bool Source #

Predicate of belonging to a given group restriction.

hasTag :: Maybe [String] -> Node -> Bool Source #

Predicate of having at least one tag in a given set.

nonRedundant :: (List, List) -> Ndx -> [Idx] Source #

From a cluster configuration, get the list of non-redundant instances of a node.

noNonRedundant :: (List, List) -> Node -> Bool Source #

Within a cluster configuration, decide if the node hosts non-redundant Instances.

masterLast :: [([Node], a)] -> [([Node], a)] Source #

Put the master node last. Reorder a list groups of nodes (with additional information) such that the master node (if present) is the last node of the last group.

getMoves :: (List, List) -> (List, List) -> [(Instance, (Node, Maybe Node))] Source #

From two configurations compute the list of moved instances. Do not show instances where only primary and secondary switched their role, as here the instance is not moved in a proper sense.

main :: Options -> [String] -> IO () Source #

Main function.