Revision 4162995d htools/hail.hs
b/htools/hail.hs | ||
---|---|---|
35 | 35 |
import Ganeti.HTools.CLI |
36 | 36 |
import Ganeti.HTools.IAlloc |
37 | 37 |
import Ganeti.HTools.Loader (Request(..), ClusterData(..)) |
38 |
import Ganeti.HTools.ExtLoader (maybeSaveData) |
|
38 | 39 |
|
39 | 40 |
-- | Options list and functions |
40 | 41 |
options :: [OptType] |
41 | 42 |
options = |
42 | 43 |
[ oPrintNodes |
44 |
, oSaveCluster |
|
43 | 45 |
, oDataFile |
44 | 46 |
, oNodeSim |
45 | 47 |
, oVerbose |
... | ... | |
55 | 57 |
|
56 | 58 |
let shownodes = optShowNodes opts |
57 | 59 |
verbose = optVerbose opts |
60 |
savecluster = optSaveCluster opts |
|
58 | 61 |
|
59 | 62 |
request <- readRequest opts args |
60 | 63 |
|
... | ... | |
71 | 74 |
hPutStrLn stderr $ Cluster.printNodes (cdNodes cdata) |
72 | 75 |
(fromJust shownodes) |
73 | 76 |
|
77 |
maybeSaveData savecluster "pre-ialloc" "before iallocator run" cdata |
|
78 |
|
|
74 | 79 |
let (maybe_ni, resp) = runIAllocator request |
75 | 80 |
(fin_nl, fin_il) = maybe (cdNodes cdata, cdInstances cdata) id maybe_ni |
76 | 81 |
putStrLn resp |
77 | 82 |
when (isJust shownodes) $ do |
78 | 83 |
hPutStrLn stderr "Final cluster status:" |
79 | 84 |
hPutStrLn stderr $ Cluster.printNodes fin_nl (fromJust shownodes) |
85 |
|
|
86 |
maybeSaveData savecluster "post-ialloc" "after iallocator run" |
|
87 |
(cdata { cdNodes = fin_nl, cdInstances = fin_il}) |
Also available in: Unified diff