Commit d254d6ce authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: add function for getting all nodes of an instance


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 20b376ff
......@@ -42,6 +42,7 @@ module Ganeti.HTools.Instance
, shrinkByType
, runningStates
, requiredNodes
, allNodes
) where
import qualified Ganeti.HTools.Types as T
......@@ -189,3 +190,9 @@ specOf Instance { mem = m, dsk = d, vcpus = c } =
requiredNodes :: T.DiskTemplate -> Int
requiredNodes T.DTDrbd8 = 2
requiredNodes _ = 1
-- | Computes all nodes of an instance.
allNodes :: Instance -> [T.Ndx]
allNodes inst = case diskTemplate inst of
T.DTDrbd8 -> [pNode inst, sNode inst]
_ -> [pNode inst]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment