ganeti
Safe HaskellNone

Ganeti.HTools.Dedicated

Description

Implementation of special handling of dedicated clusters.

Synopsis

Documentation

isDedicated :: ClusterData -> Maybe String -> Bool Source #

Given a cluster description and maybe a group name, decide if that group, or all allocatable groups if no group is given, is dedicated.

minimallyCompliantInstance :: ISpec -> Instance Source #

Given a specification interval, create an instance minimally fitting into that interval. In other words create an instance from the lower bounds of the specified interval.

testInstances :: IPolicy -> [Instance] Source #

From an instance policy get the list of test instances, in correct order, for which the allocation count has to be determined for the lost allocations metrics.

allocationVector :: [Instance] -> Node -> [Int] Source #

Given the test instances, compute the allocations vector of a node

type Metric = ([Int], Int) Source #

The metric do be used in dedicated allocation.

lostAllocationsMetric :: AlgorithmOptions -> [Instance] -> Instance -> Node -> OpResult (Metric, Node) Source #

Given the test instances and an instance to be placed, compute the lost allocations metrics for that node, together with the modified node. Return Bad if it is not possible to place the instance on that node.

allocateOnSingle :: AlgorithmOptions -> List -> Instance -> Ndx -> OpResult (GenericAllocElement Metric) Source #

Allocate an instance on a given node.

allocateOnPair :: AlgorithmOptions -> List -> Instance -> Ndx -> Ndx -> OpResult (GenericAllocElement Metric) Source #

Allocate an instance on a given pair of nodes.

findAllocation :: AlgorithmOptions -> List -> List -> Gdx -> Instance -> Int -> Result (GenericAllocSolution Metric, [String]) Source #

Find an allocation for an instance on a group.

findMGAllocation :: AlgorithmOptions -> List -> List -> List -> Instance -> Int -> Result (GenericAllocSolution Metric) Source #

Find an allocation in a suitable group.

runDedicatedAllocation :: AlgorithmOptions -> Request -> (Maybe (List, List), String) Source #

Handle allocation requests in the dedicated scenario.