ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Instance
Contents
Type declarations
Initialization
Update functions
Description

Module describing an instance.

The instance data type holds very few fields, the algorithm intelligence is in the Node and Cluster modules.

Synopsis
data Instance = Instance {
name :: String
alias :: String
mem :: Int
dsk :: Int
vcpus :: Int
running :: Bool
runSt :: String
pNode :: Ndx
sNode :: Ndx
idx :: Idx
util :: DynUtil
movable :: Bool
tags :: [String]
}
runningStates :: [String]
type AssocList = [(Idx, Instance)]
type List = Container Instance
create :: String -> Int -> Int -> Int -> String -> [String] -> Ndx -> Ndx -> Instance
setIdx :: Instance -> Idx -> Instance
setName :: Instance -> String -> Instance
setAlias :: Instance -> String -> Instance
setPri :: Instance -> Ndx -> Instance
setSec :: Instance -> Ndx -> Instance
setBoth :: Instance -> Ndx -> Ndx -> Instance
setMovable :: Instance -> Bool -> Instance
shrinkByType :: Instance -> FailMode -> Result Instance
specOf :: Instance -> RSpec
Type declarations
data Instance Source
The instance type
Constructors
Instance
name :: StringThe instance name
alias :: StringThe shortened name
mem :: IntMemory of the instance
dsk :: IntDisk size of instance
vcpus :: IntNumber of VCPUs
running :: BoolIs the instance running?
runSt :: StringOriginal (text) run status
pNode :: NdxOriginal primary node
sNode :: NdxOriginal secondary node
idx :: IdxInternal index
util :: DynUtilDynamic resource usage
movable :: BoolCan the instance be moved?
tags :: [String]List of instance tags
runningStates :: [String]Source
Running instance states.
type AssocList = [(Idx, Instance)]Source
A simple name for the int, instance association list.
type List = Container InstanceSource
A simple name for an instance map.
Initialization
create :: String -> Int -> Int -> Int -> String -> [String] -> Ndx -> Ndx -> InstanceSource

Create an instance.

Some parameters are not initialized by function, and must be set later (via setIdx for example).

setIdxSource
:: InstanceThe original instance
-> IdxNew index
-> InstanceThe modified instance

Changes the index.

This is used only during the building of the data structures.

setNameSource
:: InstanceThe original instance
-> StringNew name
-> InstanceThe modified instance

Changes the name.

This is used only during the building of the data structures.

setAliasSource
:: InstanceThe original instance
-> StringNew alias
-> InstanceThe modified instance

Changes the alias.

This is used only during the building of the data structures.

Update functions
setPriSource
:: Instancethe original instance
-> Ndxthe new primary node
-> Instancethe modified instance
Changes the primary node of the instance.
setSecSource
:: Instancethe original instance
-> Ndxthe new secondary node
-> Instancethe modified instance
Changes the secondary node of the instance.
setBothSource
:: Instancethe original instance
-> Ndxnew primary node index
-> Ndxnew secondary node index
-> Instancethe modified instance
Changes both nodes of the instance.
setMovableSource
:: InstanceThe original instance
-> BoolNew movable flag
-> InstanceThe modified instance
shrinkByType :: Instance -> FailMode -> Result InstanceSource
Try to shrink the instance based on the reason why we can't allocate it.
specOf :: Instance -> RSpecSource
Return the spec of an instance.
Produced by Haddock version 2.6.0