Revision 4162995d

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})
b/man/hail.rst
68 68
  data with a simulated cluster. For details about the description,
69 69
  see the man page **hspace**(1).
70 70

  
71
-S *filename*, --save-cluster=*filename*
72
  If given, the state of the cluster before and the iallocator run is
73
  saved to a file named *filename.pre-ialloc*, respectively
74
  *filename.post-ialloc*. This allows re-feeding the cluster state to
75
  any of the htools utilities.
76

  
71 77
-v
72 78
  This option increases verbosity and can be used for debugging in order
73 79
  to understand how the IAllocator request is parsed; it can be passed

Also available in: Unified diff