Add support for 'offline' nodes
This patch drops compatiblity with Ganeti 1.2 and adds support foroffline nodes in the cluster. When reading from RAPI, the drained nodesare considered offline so that we don't allocate on them too.
Update the IAlloc module
We know have a working parseData function that returns the node andinstance data. This uncovered bad support for non-drbd instances ☹
Move the JSON utilities to Utils.hs
This patch moves the generic/reusable JSON functions to Utils.hs, sothat they're shared between RAPI/IAlloc.
Add a copy of Rapi.HS as IAlloc.hs
This will be used in two ways: - format the response to Ganeti (easy, implemented) - parse the input data and build the node/instance lists (hard :)
hbal: Add a new min-score option
This new parameter causes the algorithm to finish (or even not start atall) if we reach/have a score better than it.
hbal: Change hardcoded tests to monadic composition
In some case we manually do “if isNothing … then Nothing else …”, whichcan be very easily replaced with a monadic construct in the Maybe monad.
Increase allowed missing memory to 512MB
Since Xen seems to “steal” some amounts of memory (depending on totalnode memory), we increase the maximum allowed missing memory to 512MB,based on gathered data from multiple machines.
Add reading the file names from env vars
This patch adds support for selecting the instance/node file names viatwo environment variables (HTOOLS_NODES, HTOOLS_INSTANCES).
Unfortunately we still have lots of duplicated code, since the optionsare not unified.
Implement writing the command list to a script
This patch adds support in hbal for writing the command list to a shellscript, with error checking and allowing for early exit.
hbal: Abort for invalid offline node names
Since it's easy to pass a wrong node name as offline, we should abortinstead of silently ignoring it.
More documentation updates
This removes most of the content of the README file (obsoleted by newalgorithm and man pages), modifies the Makefile to include the builtdocumentation in the source archive (so that haddock/hscolour are notneeded) and updates the haddock-prologue with current information.
Add checks for missing disk space
This small patch adds disk space checks to the Cluster.checkDatafunction, and simplifies a little the warning messages.
Include DRBD overhead in sda/sdb size
For Ganeti 1.2 which doesn't have the ‘disk_usage’ instance query field,we need to manually include the DRBD overhead (per disk). This patchmodifies the RAPI collection to do this, but loading from disk does notas it's unknown if the query came from hscan or RAPI 1.2 or RAPI 2.0...
Update all needed node fields on f_mem change
This fixes the setFmem function which didn't compute other relatedfields after free memory change. Ideally, this should be abstracted sothat add/remove Pri and similar functions could reuse it instead ofduplicating code.
Fix interaction between down instances and nodes
If an instance is down, it's memory is not reflected in the node usedmemory, and thus the node free memory is higher than the actual value.This patch deducts the memory for such instances from the node free...
Add a new instance field denoting run status
This patch modifies Rapi, the Cluster.loadData and hscan serialization to loadand save the instance run status. At instance level, we add both a booleanfield denoting the true/false run status, and a string field which holds the...
Show the x_mem/i_mem in node list
This patch adds checking of cluster data in the binaries and display ofnode's x_mem/i_mem in the node list.
Add functions to check and fix cluster data
This patch adds a checkData function which goes over the node list and computesthe unaccounted memory, returning a list of warning messages (if any) and theupdate nodes.
Add a new node filed x_mem
Nodes can have some memory unaccounted for, due to (e.g.) hypervisoroverhead, rounding errors in reporting, etc.
It is better if we model this memory explicitly instead of hiding it,and actually since the n_mem addition it is actually required to do so....
Split common CLI functionality into a module
This patch moves the common CLI functionality (as much as currentlypossible) into a separate module. This means we only have one parseOptsand that Utils.hs doesn't keep this kind of functions anymore.
Remove unused and obsolete function
The Node.str function is very old and is not useful since the nodeobjects have much more fields today. This patch removes it, and ifneeded a full node display can be done via ‘show’.
Add node memory field to Node objects
This patch adds a new n_mem field to the node objects, and implementsread/save/show support for it. The field is not currently used (exceptin the node list) but will be used for checking data consistency andinstance up/down status.
Pass actual types to node/instance constructors
This patch changes the parameters passed to the node and instanceconstructors from generic Strings (which are then parsed via “read”) tothe actual used types, by converting them earlier in Cluster.loadData.
Some small changes in preparation for hscan
This patch does some small changes: - fixes a comment - export more node functions (unneeded now, but hscan will use them) - fixes Makefile rule for building the programs
Add a separate type for the [(Int, String)] list
This is added for better readability, since this is very often used indeclarations.
Handle correctly offline nodes in cluster scoring
This patch changes two things with regard to offline nodes: - first, it only calculates the various coefficients across online nodes - second, it adds a new score denoting the percentage of instances...
Show offline nodes in the node status list
This patch adds a new ‘-’ flag for the node status which denotes offlinenodes.
Restrict move list based on offline node status
This patch changes the Cluster.checkInstanceMove function to restrictthe target move list based on which nodes are online.
Add command line support for offlining nodes
This patch modifies hbal (only, hn1 not yet) for setting nodes offline.
Add a new 'offline' Node attribute
This patch adds a new node attribute - offline - which will serve toskip nodes from the target candidate list.
Small doc update in Node.hs
Some updates to the apidoc rules
Introduce a namespace for the modules
The modules are moved from the ‘top’ namespace to ‘Ganeti.HTools’, incompliance with standard practices.