Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Ganeti.HTools.Backend.IAlloc
Description
Implementation of the iallocator interface.
Synopsis
- readRequest :: FilePath -> Int -> IO Request
- runIAllocator :: AlgorithmOptions -> Request -> (Maybe (List, List), String)
- processRelocate :: AlgorithmOptions -> List -> List -> List -> Idx -> Int -> [Ndx] -> Result (List, List, [Ndx])
- loadData :: FilePath -> Int -> IO (Result ClusterData)
- formatAllocate :: List -> GenericAllocSolution a -> Result IAllocResult
- formatIAllocResult :: Result IAllocResult -> (Maybe (List, List), String)
- formatMultiAlloc :: (List, List, GenericAllocSolutionList a) -> Result IAllocResult
Documentation
Arguments
:: FilePath | Path to IAllocator input file |
-> Int | Static node memory size, see optStaticKvmNodeMemory |
-> IO Request |
Reads the request from the data file(s).
runIAllocator :: AlgorithmOptions -> Request -> (Maybe (List, List), String) #
Main iallocator pipeline.
Arguments
:: AlgorithmOptions | |
-> List | The group list |
-> List | The node list |
-> List | The instance list |
-> Idx | The index of the instance to move |
-> Int | The number of nodes required |
-> [Ndx] | Nodes which should not be used |
-> Result (List, List, [Ndx]) | Solution list |
Runs relocate for a single instance.
This is wrapper over the tryNodeEvac
function that is run
with a single instance (ours), and further it checks that the
result it got (in the nodes field) is actually consistent, as
tryNodeEvac is designed to output primarily an opcode list, not a
node list.
Arguments
:: FilePath | Path to IAllocator input file |
-> Int | Static node memory size, see optStaticKvmNodeMemory |
-> IO (Result ClusterData) |
Load the data from an iallocation request file
formatAllocate :: List -> GenericAllocSolution a -> Result IAllocResult #
Convert allocation/relocation results into the result format.
formatIAllocResult :: Result IAllocResult -> (Maybe (List, List), String) #
Format an IAlloc result to maybe the new cluster and a response.
formatMultiAlloc :: (List, List, GenericAllocSolutionList a) -> Result IAllocResult #
Convert multi allocation results into the result format.