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

Extend the node description by isMaster


Extend the description of the node by the property
of being the master node; also provide and appropriate
setter function. This property will be used, e.g., by
hroller to schedule reboot of the master last.

Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 2ab65a5d
No related branches found
No related tags found
No related merge requests found
...@@ -166,7 +166,7 @@ parseNode ktg a = do ...@@ -166,7 +166,7 @@ parseNode ktg a = do
dtotal <- extract "dtotal" dtotal <- extract "dtotal"
dfree <- extract "dfree" dfree <- extract "dfree"
ctotal <- extract "ctotal" ctotal <- extract "ctotal"
return $ Node.create name mtotal mnode mfree return $ Node.create name mtotal mnode mfree
dtotal dfree ctotal False spindles guuid' dtotal dfree ctotal False spindles guuid'
return (name, node) return (name, node)
......
...@@ -39,6 +39,7 @@ module Ganeti.HTools.Node ...@@ -39,6 +39,7 @@ module Ganeti.HTools.Node
, setFmem , setFmem
, setPri , setPri
, setSec , setSec
, setMaster
, setMdsk , setMdsk
, setMcpu , setMcpu
, setPolicy , setPolicy
...@@ -130,6 +131,7 @@ data Node = Node ...@@ -130,6 +131,7 @@ data Node = Node
, offline :: Bool -- ^ Whether the node should not be used for , offline :: Bool -- ^ Whether the node should not be used for
-- allocations and skipped from score -- allocations and skipped from score
-- computations -- computations
, isMaster :: Bool -- ^ Whether the node is the master node
, utilPool :: T.DynUtil -- ^ Total utilisation capacity , utilPool :: T.DynUtil -- ^ Total utilisation capacity
, utilLoad :: T.DynUtil -- ^ Sum of instance utilisation , utilLoad :: T.DynUtil -- ^ Sum of instance utilisation
, pTags :: TagMap -- ^ Primary instance exclusion tags and their count , pTags :: TagMap -- ^ Primary instance exclusion tags and their count
...@@ -235,6 +237,7 @@ create name_init mem_t_init mem_n_init mem_f_init ...@@ -235,6 +237,7 @@ create name_init mem_t_init mem_n_init mem_f_init
, pRem = 0 , pRem = 0
, pCpu = 0 , pCpu = 0
, offline = offline_init , offline = offline_init
, isMaster = False
, xMem = 0 , xMem = 0
, mDsk = T.defReservedDiskRatio , mDsk = T.defReservedDiskRatio
, loDsk = mDskToloDsk T.defReservedDiskRatio dsk_t_init , loDsk = mDskToloDsk T.defReservedDiskRatio dsk_t_init
...@@ -277,6 +280,10 @@ setAlias t s = t { alias = s } ...@@ -277,6 +280,10 @@ setAlias t s = t { alias = s }
setOffline :: Node -> Bool -> Node setOffline :: Node -> Bool -> Node
setOffline t val = t { offline = val } setOffline t val = t { offline = val }
-- | Sets the master attribute
setMaster :: Node -> Bool -> Node
setMaster t val = t { isMaster = val }
-- | Sets the unnaccounted memory. -- | Sets the unnaccounted memory.
setXmem :: Node -> Int -> Node setXmem :: Node -> Int -> Node
setXmem t val = t { xMem = val } 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