Safe HaskellSafe-Infered




Generic data loader.

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



data RqType Source

The iallocator request type.

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


Allocate Instance AllocDetails

A new instance allocation

Relocate Idx Int [Ndx]

Choose a new secondary node

NodeEvacuate [Idx] EvacMode

node-evacuate mode

ChangeGroup [Gdx] [Idx]

Multi-relocate mode

MultiAllocate [(Instance, AllocDetails)]

Multi-allocate mode


Show RqType 

data Request Source

A complete request, as received from Ganeti.


Request RqType ClusterData 


Show Request 

data ClusterData Source

The cluster state.




cdGroups :: List

The node group list

cdNodes :: List

The node list

cdInstances :: List

The instance list

cdTags :: [String]

The cluster tags

cdIPolicy :: IPolicy

The cluster instance policy


emptyCluster :: ClusterDataSource

An empty cluster.


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.

setMaster :: Monad m => NameAssoc -> List -> String -> m ListSource

Given am indexed node list, and the name of the master, mark it as such.

updateExclTags :: [String] -> Instance -> InstanceSource

Update instance with exclusion tags list.

updateMovable :: [String] -> [String] -> Instance -> InstanceSource

setArPolicy :: [String] -> List -> List -> List -> ClockTime -> ListSource

getArPolicy :: [String] -> ClockTime -> Maybe AutoRepairPolicySource

longestDomain :: [String] -> StringSource

extractExTags :: [String] -> [String]Source

Extracts the exclusion tags from the cluster configuration.

commonSuffix :: List -> List -> StringSource

Extracts the common suffix from node/instance names.

addMigrationTags :: [String] -> Node -> NodeSource



:: [(String, DynUtil)]

Instance utilisation data

-> [String]

Exclusion tags

-> [String]

Selected instances (if not empty)

-> [String]

Excluded instances

-> ClockTime

The current timestamp

-> ClusterData

Data from backends

-> Result ClusterData

Fixed cluster data

Initializer function that loads the data from a node and instance list and massages it into the correct format.

clearDynU :: ClusterData -> Result ClusterDataSource

In a cluster description, clear dynamic utilisation information.

checkData :: List -> List -> ([String], List)Source

Checks the cluster data for consistency.

nodeImem :: Node -> List -> IntSource

nodeIdsk :: Node -> List -> IntSource

eitherLive :: Monad m => Bool -> a -> m a -> m aSource

Get live information or a default value