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 ClusterData
data ClusterData = ClusterData {
cdGroups :: List
cdNodes :: List
cdInstances :: List
cdTags :: [String]
}
emptyCluster :: ClusterData
lookupNode :: Monad m => NameAssoc -> String -> String -> m Ndx
lookupInstance :: Monad m => NameAssoc -> String -> m Idx
lookupGroup :: Monad m => NameAssoc -> String -> String -> m Gdx
assignIndices :: Element a => [(String, a)] -> (NameAssoc, Container a)
fixNodes :: List -> Instance -> List
filterExTags :: [String] -> Instance -> Instance
updateMovable :: [String] -> Instance -> Instance
longestDomain :: [String] -> String
extractExTags :: [String] -> [String]
commonSuffix :: List -> List -> String
mergeData :: [(String, DynUtil)] -> [String] -> [String] -> ClusterData -> Result ClusterData
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
data Request Source
A complete request, as received from Ganeti.
Constructors
Request RqType ClusterData
data ClusterData Source
The cluster state.
Constructors
ClusterData
cdGroups :: ListThe node group list
cdNodes :: ListThe node list
cdInstances :: ListThe instance list
cdTags :: [String]The cluster tags
emptyCluster :: ClusterDataSource
An empty cluster.
Functions
lookupNode :: Monad m => NameAssoc -> String -> String -> m NdxSource
Lookups a node into an assoc list.
lookupInstance :: Monad m => NameAssoc -> String -> m IdxSource
Lookups an instance into an assoc list.
lookupGroup :: Monad m => NameAssoc -> String -> String -> m GdxSource
Lookups a group into an assoc list.
assignIndices :: Element a => [(String, a)] -> (NameAssoc, Container a)Source
Given a list of elements (and their names), assign indices to them.
fixNodes :: List -> Instance -> ListSource
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.
extractExTags :: [String] -> [String]Source
Extracts the exclusion tags from the cluster configuration
commonSuffix :: List -> List -> StringSource
Extracts the common suffix from node/instance names
mergeDataSource
:: [(String, DynUtil)]Instance utilisation data
-> [String]Exclusion tags
-> [String]Untouchable instances
-> ClusterDataData from backends
-> Result ClusterDataFixed cluster data
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.6.0