ganeti

Safe HaskellNone

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

Instances
Show EvacSolution # 
Instance details

Defined in Ganeti.HTools.Cluster.Evacuate

Methods

showsPrec :: Int -> EvacSolution -> ShowS

show :: EvacSolution -> String

showList :: [EvacSolution] -> ShowS

emptyEvacSolution :: EvacSolution Source #

The empty evac solution.

reverseEvacSolution :: EvacSolution -> EvacSolution Source #

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.

nodeEvacInstance Source #

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.

tryNodeEvac Source #

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.