diff --git a/src/Ganeti/HTools/Node.hs b/src/Ganeti/HTools/Node.hs index a55c3f80864cee8d3a726586e94c6fcf812ae97d..a8c1fdb7f58b9982819c3d8b0647eedb9d595642 100644 --- a/src/Ganeti/HTools/Node.hs +++ b/src/Ganeti/HTools/Node.hs @@ -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 }