|
|
|
Description |
Implementation of the iallocator interface.
|
|
Synopsis |
|
type IAllocResult = (String, JSValue, List, List) | | parseBaseInstance :: String -> JSRecord -> Result (String, Instance) | | parseInstance :: NameAssoc -> String -> JSRecord -> Result (String, Instance) | | parseNode :: NameAssoc -> String -> JSRecord -> Result (String, Node) | | parseGroup :: String -> JSRecord -> Result (String, Group) | | parseData :: String -> Result ([String], Request) | | formatResponse :: Bool -> String -> JSValue -> String | | describeSolution :: AllocSolution -> String | | formatAllocate :: List -> AllocSolution -> Result IAllocResult | | formatNodeEvac :: List -> List -> List -> (List, List, EvacSolution) -> Result IAllocResult | | processRelocate :: List -> List -> List -> Idx -> Int -> [Ndx] -> Result (List, List, [Ndx]) | | formatRelocate :: (List, List, [Ndx]) -> Result IAllocResult | | processRequest :: Request -> Result IAllocResult | | readRequest :: Options -> [String] -> IO Request | | runIAllocator :: Request -> (Maybe (List, List), String) |
|
|
Documentation |
|
|
Type alias for the result of an IAllocator call.
|
|
|
Parse the basic specifications of an instance.
Instances in the cluster instance list and the instance in an
Allocate request share some common properties, which are read by
this function.
|
|
|
:: NameAssoc | The node name-to-index association list
| -> String | The name of the instance
| -> JSRecord | The JSON object
| -> Result (String, Instance) | | Parses an instance as found in the cluster instance list.
|
|
|
|
:: NameAssoc | The group association
| -> String | The node's name
| -> JSRecord | The JSON object
| -> Result (String, Node) | | Parses a node as found in the cluster node list.
|
|
|
|
:: String | The group UUID
| -> JSRecord | The JSON object
| -> Result (String, Group) | | Parses a group as found in the cluster group list.
|
|
|
|
:: String | The JSON message as received from Ganeti
| -> Result ([String], Request) | Result tuple
| Top-level parser.
The result is a tuple of eventual warning messages and the parsed
request; if parsing the input data fails, we'll return a Bad
value.
|
|
|
|
:: Bool | Whether the request was successful
| -> String | Information text
| -> JSValue | The JSON encoded result
| -> String | The full JSON-formatted message
| Formats the result into a valid IAllocator response message.
|
|
|
|
Flatten the log of a solution into a string.
|
|
|
Convert allocation/relocation results into the result format.
|
|
|
Convert a node-evacuation/change group result.
|
|
|
:: List | The group list
| -> List | The node list
| -> List | The instance list
| -> Idx | The index of the instance to move
| -> Int | The number of nodes required
| -> [Ndx] | Nodes which should not be used
| -> Result (List, List, [Ndx]) | Solution list
| Runs relocate for a single instance.
This is wrapper over the tryNodeEvac function that is run
with a single instance (ours), and further it checks that the
result it got (in the nodes field) is actually consistent, as
tryNodeEvac is designed to output primarily an opcode list, not a
node list.
|
|
|
|
|
|
Process a request and return new node lists.
|
|
|
Reads the request from the data file(s).
|
|
|
Main iallocator pipeline.
|
|
Produced by Haddock version 2.6.0 |