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

Extend the simulation backend to also simulate a master node


In a simulated cluster as created by the simulation backend to
the htools, make the first node of the first node group the master
node. In this way, hools (like hroller) that require a master node
can also be used on simulated clusters, e.g., for testing.

Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 754b9b1c
No related branches found
No related tags found
No related merge requests found
......@@ -78,10 +78,11 @@ createGroup grpIndex spec = do
(apol, ncount, disk, mem, cpu, spindles) <- parseDesc spec $
sepSplit ',' spec
let nodes = map (\idx ->
Node.create (printf "node-%02d-%03d" grpIndex idx)
(fromIntegral mem) 0 mem
(fromIntegral disk) disk
(fromIntegral cpu) False spindles grpIndex
flip Node.setMaster (grpIndex == 1 && idx == 1) $
Node.create (printf "node-%02d-%03d" grpIndex idx)
(fromIntegral mem) 0 mem
(fromIntegral disk) disk
(fromIntegral cpu) False spindles grpIndex
) [1..ncount]
grp = Group.create (printf "group-%02d" grpIndex)
(printf "fake-uuid-%02d" grpIndex) apol defIPolicy []
......
......@@ -28,12 +28,10 @@
>>> /HCHECK_INIT_CLUSTER_NEED_REBALANCE=0/
>>>= 0
# FIXME: remove option -f once the text backend supports indicating
# the master node
# hroller should be able to print the solution
./test/hs/hroller -f -t$T/simu-onegroup.tiered
./test/hs/hroller -t$T/simu-onegroup.tiered
>>>= 0
# hroller should be able to print the solution, in verbose mode as well
./test/hs/hroller -f -t$T/simu-onegroup.tiered -v -v
./test/hs/hroller -t$T/simu-onegroup.tiered -v -v
>>>= 0
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