Safe Haskell | Safe-Infered |
---|
Implementation of node evacuation
- data EvacSolution = EvacSolution {}
- emptyEvacSolution :: EvacSolution
- reverseEvacSolution :: EvacSolution -> EvacSolution
- type EvacInnerState = Either String (List, Instance, Score, Ndx)
- failOnSecondaryChange :: Monad m => EvacMode -> DiskTemplate -> m ()
- evacOneNodeInner :: AlgorithmOptions -> List -> Instance -> Gdx -> (Ndx -> IMove) -> EvacInnerState -> Ndx -> EvacInnerState
- evacOneNodeOnly :: AlgorithmOptions -> List -> List -> Instance -> Gdx -> [Ndx] -> Result (List, List, [OpCode])
- evacDrbdAllInner :: AlgorithmOptions -> List -> List -> Instance -> Gdx -> (Ndx, Ndx) -> Result (List, List, [OpCode], Score)
- nodeEvacInstance :: AlgorithmOptions -> List -> List -> EvacMode -> Instance -> Gdx -> [Ndx] -> Result (List, List, [OpCode])
- updateEvacSolution :: (List, List, EvacSolution) -> Idx -> Result (List, List, [OpCode]) -> (List, List, EvacSolution)
- nodesToEvacuate :: List -> EvacMode -> [Idx] -> IntSet
- tryNodeEvac :: AlgorithmOptions -> List -> List -> List -> EvacMode -> [Idx] -> Result (List, List, EvacSolution)
Documentation
data EvacSolution Source
Node evacuation/group change iallocator result type. This result type consists of actual opcodes (a restricted subset) that are transmitted back to Ganeti.
Show EvacSolution |
emptyEvacSolution :: EvacSolutionSource
The empty evac solution.
reverseEvacSolution :: EvacSolution -> EvacSolutionSource
Reverses an evacuation solution.
Rationale: we always concat the results to the top of the lists, so for proper jobset execution, we should reverse all lists.
failOnSecondaryChange :: Monad m => EvacMode -> DiskTemplate -> m ()Source
evacOneNodeInner :: AlgorithmOptions -> List -> Instance -> Gdx -> (Ndx -> IMove) -> EvacInnerState -> Ndx -> EvacInnerStateSource
evacOneNodeOnly :: AlgorithmOptions -> List -> List -> Instance -> Gdx -> [Ndx] -> Result (List, List, [OpCode])Source
evacDrbdAllInner :: AlgorithmOptions -> List -> List -> Instance -> Gdx -> (Ndx, Ndx) -> Result (List, List, [OpCode], Score)Source
:: AlgorithmOptions | |
-> List | The node list (cluster-wide) |
-> List | Instance list (cluster-wide) |
-> EvacMode | The evacuation mode |
-> Instance | The instance to be evacuated |
-> Gdx | The group we're targetting |
-> [Ndx] | The list of available nodes for allocation |
-> Result (List, List, [OpCode]) |
Run evacuation for a single instance.
Note: this function should correctly execute both intra-group
evacuations (in all modes) and inter-group evacuations (in the
ChangeAll
mode). Of course, this requires that the correct list
of target nodes is passed.
updateEvacSolution :: (List, List, EvacSolution) -> Idx -> Result (List, List, [OpCode]) -> (List, List, EvacSolution)Source
Updates the evac solution with the results of an instance evacuation.
nodesToEvacuate :: List -> EvacMode -> [Idx] -> IntSetSource
:: AlgorithmOptions | |
-> List | The cluster groups |
-> List | The node list (cluster-wide, not per group) |
-> List | Instance list (cluster-wide) |
-> EvacMode | The evacuation mode |
-> [Idx] | List of instance (indices) to be evacuated |
-> Result (List, List, EvacSolution) |
Node-evacuation IAllocator mode main function.