|
|
|
|
|
Description |
Module describing a node.
All updates are functional (copy-based) and return a new node with
updated value.
|
|
Synopsis |
|
|
|
|
Type declarations
|
|
type TagMap = Map String Int | Source |
|
The tag map type.
|
|
|
The node type.
| Constructors | Node | | name :: String | The node name
| alias :: String | The shortened name (for display purposes)
| tMem :: Double | Total memory (MiB)
| nMem :: Int | Node memory (MiB)
| fMem :: Int | Free memory (MiB)
| xMem :: Int | Unaccounted memory (MiB)
| tDsk :: Double | Total disk space (MiB)
| fDsk :: Int | Free disk space (MiB)
| tCpu :: Double | Total CPU count
| uCpu :: Int | Used VCPU count
| pList :: [Idx] | List of primary instance indices
| sList :: [Idx] | List of secondary instance indices
| idx :: Ndx | Internal index for book-keeping
| peers :: PeerMap | Pnode to instance mapping
| failN1 :: Bool | Whether the node has failed n1
| rMem :: Int | Maximum memory needed for failover by
primaries of this node
| pMem :: Double | Percent of free memory
| pDsk :: Double | Percent of free disk
| pRem :: Double | Percent of reserved memory
| pCpu :: Double | Ratio of virtual to physical CPUs
| mDsk :: Double | Minimum free disk ratio
| mCpu :: Double | Max ratio of virt-to-phys CPUs
| loDsk :: Int | Autocomputed from mDsk low disk
threshold
| hiCpu :: Int | Autocomputed from mCpu high cpu
threshold
| offline :: Bool | Whether the node should not be used
for allocations and skipped from score
computations
| utilPool :: DynUtil | Total utilisation capacity
| utilLoad :: DynUtil | Sum of instance utilisation
| pTags :: TagMap | Map of primary instance tags and their count
| group :: Gdx | The node's group (index)
|
|
|
|
|
|
A simple name for the int, node association list.
|
|
|
A simple name for a node map.
|
|
|
A simple name for an allocation element (here just for logistic
reasons).
|
|
|
Constant node index for a non-moveable instance.
|
|
Helper functions
|
|
|
Add a tag to a tagmap.
|
|
|
Add multiple tags.
|
|
|
Adjust or delete a tag from a tagmap.
|
|
|
Remove multiple tags.
|
|
|
Check if we can add a list of tags to a tagmap.
|
|
|
Check how many primary instances have conflicting tags. The
algorithm to compute this is to sum the count of all tags, then
subtract the size of the tag map (since each tag has at least one,
non-conflicting instance); this is equivalent to summing the
values in the tag map minus one.
|
|
Initialization functions
|
|
create :: String -> Double -> Int -> Int -> Double -> Int -> Double -> Bool -> Gdx -> Node | Source |
|
Create a new node.
The index and the peers maps are empty, and will be need to be
update later via the setIdx and buildPeers functions.
|
|
mDskToloDsk :: Double -> Double -> Int | Source |
|
Conversion formula from mDsk/tDsk to loDsk.
|
|
mCpuTohiCpu :: Double -> Double -> Int | Source |
|
Conversion formula from mCpu/tCpu to hiCpu.
|
|
|
Changes the index.
This is used only during the building of the data structures.
|
|
|
Changes the alias.
This is used only during the building of the data structures.
|
|
|
Sets the offline attribute.
|
|
|
Sets the unnaccounted memory.
|
|
|
Sets the max disk usage ratio.
|
|
|
Sets the max cpu usage ratio.
|
|
|
Computes the maximum reserved memory for peers from a peer map.
|
|
|
Builds the peer map for a given node.
|
|
|
Assigns an instance to a node as primary and update the used VCPU
count, utilisation data and tags map.
|
|
|
Assigns an instance to a node as secondary without other updates.
|
|
Update functions
|
|
|
Sets the free memory.
|
|
|
Removes a primary instance.
|
|
|
Removes a secondary instance.
|
|
|
Adds a primary instance (basic version).
|
|
|
:: Bool | Whether to override the N+1 and
other soft checks, useful if we
come from a worse status
(e.g. offline)
| -> Node | The target node
| -> Instance | The instance to add
| -> OpResult Node | The result of the operation,
either the new version of the node
or a failure mode
| Adds a primary instance (extended version).
|
|
|
|
Adds a secondary instance (basic version).
|
|
|
Adds a secondary instance (extended version).
|
|
Stats functions
|
|
|
Computes the amount of available disk on a given node.
|
|
|
Computes the amount of used disk on a given node.
|
|
|
Computes the amount of available memory on a given node.
|
|
|
Computes the amount of available memory on a given node.
|
|
|
The memory used by instances on a given node.
|
|
Display functions
|
|
|
:: Node | Node which we're querying
| -> String | Field name
| -> String | Field value as string
| Return a field for a given node.
|
|
|
showHeader :: String -> (String, Bool) | Source |
|
Returns the header and numeric propery of a field.
|
|
|
String converter for the node list functionality.
|
|
defaultFields :: [String] | Source |
|
Constant holding the fields we're displaying by default.
|
|
|
Split a list of nodes into a list of (node group UUID, list of
associated nodes).
|
|
Produced by Haddock version 2.6.0 |