ganeti

Safe HaskellSafe-Infered

Ganeti.HTools.Cluster.Evacuate

Description

Implementation of node evacuation

Synopsis

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.

Constructors

EvacSolution 

Fields

esMoved :: [(Idx, Gdx, [Ndx])]

Instances moved successfully

esFailed :: [(Idx, String)]

Instances which were not relocated

esOpCodes :: [[OpCode]]

List of jobs

Instances

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.

type EvacInnerState = Either String (List, Instance, Score, Ndx)Source

nodeEvacInstanceSource

Arguments

:: 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

tryNodeEvacSource

Arguments

:: 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.