diff --git a/src/Ganeti/HTools/Backend/Rapi.hs b/src/Ganeti/HTools/Backend/Rapi.hs index 4654c8825e683f61e82902876e8dffdfe4148e5f..4f8f52bb15f11c5d1661bbd35fb3b85ae96dc07e 100644 --- a/src/Ganeti/HTools/Backend/Rapi.hs +++ b/src/Ganeti/HTools/Backend/Rapi.hs @@ -166,7 +166,7 @@ parseNode ktg a = do dtotal <- extract "dtotal" dfree <- extract "dfree" ctotal <- extract "ctotal" - return $ Node.create name mtotal mnode mfree + return $ Node.create name mtotal mnode mfree dtotal dfree ctotal False spindles guuid' return (name, node) diff --git a/src/Ganeti/HTools/Node.hs b/src/Ganeti/HTools/Node.hs index 42180bf84d76c952f5cfa1158e452a3f8331230b..83a3dee464eca5a18f64ade27dafc5c8b2fb091e 100644 --- a/src/Ganeti/HTools/Node.hs +++ b/src/Ganeti/HTools/Node.hs @@ -39,6 +39,7 @@ module Ganeti.HTools.Node , setFmem , setPri , setSec + , setMaster , setMdsk , setMcpu , setPolicy @@ -130,6 +131,7 @@ data Node = Node , offline :: Bool -- ^ Whether the node should not be used for -- allocations and skipped from score -- computations + , isMaster :: Bool -- ^ Whether the node is the master node , utilPool :: T.DynUtil -- ^ Total utilisation capacity , utilLoad :: T.DynUtil -- ^ Sum of instance utilisation , 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 , pRem = 0 , pCpu = 0 , offline = offline_init + , isMaster = False , xMem = 0 , mDsk = T.defReservedDiskRatio , loDsk = mDskToloDsk T.defReservedDiskRatio dsk_t_init @@ -277,6 +280,10 @@ setAlias t s = t { alias = s } setOffline :: Node -> Bool -> Node setOffline t val = t { offline = val } +-- | Sets the master attribute +setMaster :: Node -> Bool -> Node +setMaster t val = t { isMaster = val } + -- | Sets the unnaccounted memory. setXmem :: Node -> Int -> Node setXmem t val = t { xMem = val }