Safe HaskellNone



Implementation of instance moves in a cluster.



instanceNodes :: List -> Instance -> (Ndx, Ndx, Node, Node) Source #

Extracts the node pairs for an instance. This can fail if the instance is single-homed. FIXME: this needs to be improved, together with the general enhancement for handling non-DRBD moves.

setInstanceLocationScore Source #


:: Instance

the original instance

-> Node

the primary node of the ^ instance

-> Maybe Node

the secondary node of the ^ instance

-> Instance

the instance with the location score updated

Sets the location score of an instance, given its primary and secondary node.

applyMoveEx Source #


:: Bool

whether to ignore soft errors

-> List 
-> Instance 
-> IMove 
-> OpResult (List, Instance, Ndx, Ndx) 

Applies an instance move to a given node list and instance.

move :: (List, List) -> (Idx, IMove) -> OpResult (List, List) Source #

Apply a move to an instance, ignoring soft errors. This is a variant of `applyMoveEx True` suitable for folding.