|
|
|
|
|
Description |
Module describing an instance.
The instance data type holds very few fields, the algorithm
intelligence is in the Node and Cluster modules.
|
|
Synopsis |
|
|
|
|
Type declarations
|
|
|
The instance type.
| Constructors | Instance | | name :: String | The instance name
| alias :: String | The shortened name
| mem :: Int | Memory of the instance
| dsk :: Int | Disk size of instance
| vcpus :: Int | Number of VCPUs
| runSt :: InstanceStatus | Original run status
| pNode :: Ndx | Original primary node
| sNode :: Ndx | Original secondary node
| idx :: Idx | Internal index
| util :: DynUtil | Dynamic resource usage
| movable :: Bool | Can and should the instance be moved?
| autoBalance :: Bool | Is the instance auto-balanced?
| tags :: [String] | List of instance tags
| diskTemplate :: DiskTemplate | The disk template of the instance
| spindleUse :: Int | The numbers of used spindles
|
|
|
|
|
|
Check if instance is running.
|
|
|
Check if instance is offline.
|
|
|
Helper to check if the instance is not offline.
|
|
|
Check if instance is down.
|
|
|
Apply the function if the instance is online. Otherwise use
the initial value
|
|
|
Helper for determining whether an instance's memory needs to be
taken into account for secondary memory reservation.
|
|
|
Constant holding the local storage templates.
Note: Currently Ganeti only exports node total/free disk space
for LVM-based storage; file-based storage is ignored in this model,
so even though file-based storage uses in reality disk space on the
node, in our model it won't affect it and we can't compute whether
there is enough disk space for a file-based instance. Therefore we
will treat this template as 'foreign' storage.
|
|
|
Constant holding the movable disk templates.
This only determines the initial movable state of the
instance. Further the movable state can be restricted more due to
user choices, etc.
|
|
|
A simple name for the int, instance association list.
|
|
|
A simple name for an instance map.
|
|
Initialization
|
|
|
Create an instance.
Some parameters are not initialized by function, and must be set
later (via setIdx for example).
|
|
|
:: Instance | The original instance
| -> Idx | New index
| -> Instance | The modified instance
| Changes the index.
This is used only during the building of the data structures.
|
|
|
|
:: Instance | The original instance
| -> String | New name
| -> Instance | The modified instance
| Changes the name.
This is used only during the building of the data structures.
|
|
|
|
:: Instance | The original instance
| -> String | New alias
| -> Instance | The modified instance
| Changes the alias.
This is used only during the building of the data structures.
|
|
|
Update functions
|
|
|
:: Instance | the original instance
| -> Ndx | the new primary node
| -> Instance | the modified instance
| Changes the primary node of the instance.
|
|
|
|
:: Instance | the original instance
| -> Ndx | the new secondary node
| -> Instance | the modified instance
| Changes the secondary node of the instance.
|
|
|
|
:: Instance | the original instance
| -> Ndx | new primary node index
| -> Ndx | new secondary node index
| -> Instance | the modified instance
| Changes both nodes of the instance.
|
|
|
|
:: Instance | The original instance
| -> Bool | New movable flag
| -> Instance | The modified instance
| Sets the movable flag on an instance.
|
|
|
|
Try to shrink the instance based on the reason why we can't
allocate it.
|
|
|
Return the spec of an instance.
|
|
|
Checks if an instance is smaller than a given spec. Returns
OpGood for a correct spec, otherwise OpFail one of the possible
failure modes.
|
|
|
Checks if an instance is bigger than a given spec.
|
|
|
Checks if an instance matches a policy.
|
|
|
Checks whether the instance uses a secondary node.
Note: This should be reconciled with sNode ==
Node.noSecondary.
|
|
|
Computed the number of nodes for a given disk template.
|
|
|
Computes all nodes of an instance.
|
|
|
Checks whether a given disk template uses local storage.
|
|
|
Checks whether a given disk template supported moves.
|
|
|
A simple wrapper over templateMirrorType.
|
|
Produced by Haddock version 2.6.0 |