Skip to content
Snippets Groups Projects
Commit 07ea9bf5 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Extend the Node in the htools to allow adding node tags


Since hroller (and probably other tools in the future) will support
node selection based on node tags, extend the node data structure to
allow adding this information.

Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 442d5aae
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ module Ganeti.HTools.Node
, setPri
, setSec
, setMaster
, setNodeTags
, setMdsk
, setMcpu
, setPolicy
......@@ -132,6 +133,7 @@ data Node = Node
-- allocations and skipped from score
-- computations
, isMaster :: Bool -- ^ Whether the node is the master node
, nTags :: [String] -- ^ The node tags for this node
, utilPool :: T.DynUtil -- ^ Total utilisation capacity
, utilLoad :: T.DynUtil -- ^ Sum of instance utilisation
, pTags :: TagMap -- ^ Primary instance exclusion tags and their count
......@@ -238,6 +240,7 @@ create name_init mem_t_init mem_n_init mem_f_init
, pCpu = 0
, offline = offline_init
, isMaster = False
, nTags = []
, xMem = 0
, mDsk = T.defReservedDiskRatio
, loDsk = mDskToloDsk T.defReservedDiskRatio dsk_t_init
......@@ -284,6 +287,10 @@ setOffline t val = t { offline = val }
setMaster :: Node -> Bool -> Node
setMaster t val = t { isMaster = val }
-- | Sets the node tags attribute
setNodeTags :: Node -> [String] -> Node
setNodeTags t val = t { nTags = val }
-- | Sets the unnaccounted memory.
setXmem :: Node -> Int -> Node
setXmem t val = t { xMem = val }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment