ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Loader
Contents
Constants
Types
Functions
Description

Generic data loader

This module holds the common code for parsing the input data after it has been loaded from external sources.

Synopsis
exTagsPrefix :: String
data RqType
= Allocate Instance Int
| Relocate Idx Int [Ndx]
| Evacuate [Ndx]
data Request = Request RqType List List [String] String
lookupNode :: Monad m => [(String, Ndx)] -> String -> String -> m Ndx
lookupInstance :: Monad m => [(String, Idx)] -> String -> m Idx
assignIndices :: Element a => [(String, a)] -> (NameAssoc, [(Int, a)])
assocEqual :: Eq a => (a, b) -> (a, b) -> Bool
fixNodes :: [(Ndx, Node)] -> Instance -> [(Ndx, Node)]
filterExTags :: [String] -> Instance -> Instance
updateMovable :: [String] -> Instance -> Instance
longestDomain :: [String] -> String
stripSuffix :: Int -> String -> String
extractExTags :: [String] -> [String]
mergeData :: [(String, DynUtil)] -> [String] -> [String] -> (AssocList, AssocList, [String]) -> Result (List, List, [String], String)
checkData :: List -> List -> ([String], List)
nodeImem :: Node -> List -> Int
nodeIdsk :: Node -> List -> Int
Constants
exTagsPrefix :: StringSource
The exclusion tag prefix
Types
data RqType Source

The iallocator request type.

This type denotes what request we got from Ganeti and also holds request-specific fields.

Constructors
Allocate Instance IntA new instance allocation
Relocate Idx Int [Ndx]Move an instance to a new secondary node
Evacuate [Ndx]Evacuate nodes
show/hide Instances
Show RqType
data Request Source
A complete request, as received from Ganeti.
Constructors
Request RqType List List [String] String
show/hide Instances
Show Request
Functions
lookupNode :: Monad m => [(String, Ndx)] -> String -> String -> m NdxSource
Lookups a node into an assoc list.
lookupInstance :: Monad m => [(String, Idx)] -> String -> m IdxSource
Lookups an instance into an assoc list.
assignIndices :: Element a => [(String, a)] -> (NameAssoc, [(Int, a)])Source
Given a list of elements (and their names), assign indices to them.
assocEqual :: Eq a => (a, b) -> (a, b) -> BoolSource
Assoc element comparator
fixNodes :: [(Ndx, Node)] -> Instance -> [(Ndx, Node)]Source
For each instance, add its index to its primary and secondary nodes.
filterExTags :: [String] -> Instance -> InstanceSource
Remove non-selected tags from the exclusion list
updateMovable :: [String] -> Instance -> InstanceSource
Update the movable attribute
longestDomain :: [String] -> StringSource
Compute the longest common suffix of a list of strings that | starts with a dot.
stripSuffix :: Int -> String -> StringSource
Remove tail suffix from a string.
extractExTags :: [String] -> [String]Source
Extracts the exclusion tags from the cluster configuration
mergeDataSource
:: [(String, DynUtil)]Instance utilisation data
-> [String]Exclusion tags
-> [String]Untouchable instances
-> (AssocList, AssocList, [String])Data from backends
-> Result (List, List, [String], String)
Initializer function that loads the data from a node and instance list and massages it into the correct format.
checkData :: List -> List -> ([String], List)Source
Checks the cluster data for consistency.
nodeImem :: Node -> List -> IntSource
Compute the amount of memory used by primary instances on a node.
nodeIdsk :: Node -> List -> IntSource
Compute the amount of disk used by instances on a node (either primary or secondary).
Produced by Haddock version 2.4.2