Introduce a class for CLI options
This patch generalizes a little the CLI handling by not passing in aspecial function for help and such, but instead requiring that theoptions object supports some common functionality.
Add a small class for Nodes and Instances
Since both nodes and instances support some common functionality (namesand indices), we add a class so that we can access these attributes in ageneric way.
Add back names to nodes/instances
In order to simplify the data structures, we add back the name on thenode and instance objects. We still keep the index for, well, indexing,but we will use the name directly from the object, in order to get ridof the ktn/kti arguments which are passed around everywhere.
More code reorganizations
This new big patch does a couple of more cleanups in the loading of datachapter: - introduce a Types module that holds most types (except the base Node/Instance/etc.) so that multiple other modules can use these (instead of only Cluster and its users)...
Rework the loader model
This big patch changes the loader model from “string data as commonformat” to actual object structures as common format.
The text loading function move from Cluster.hs to a new Text.hs module,some common functions are moved to a new Loader.hs module, and the...
Initial work on hail
This makes hail compile and get a request parsed via IAlloc, but nothingmore.
Experimental support for non-redundant instances
This patch adds experimental support to hbal for non-redundant instances(i.e. instances with only one node). They are currently handled asnon-moveable, and as such the algorithm simply ignores them.
Supports needs to be added when reading from RAPI via hscan, and...
Small doc addition
Introduce nice errors on invalid input fields
This patch switches from plain read to a wrapper over readsPrec thatreturns better error messages than the buildin 'Prelude: no parse'.
Split node/instance parsing into functions
This allows easy checking for valid format of the input data (row-wise).
Add initial validation checks in Cluster.loadData
This patch converts loadTabular and loadData to a monadic form, thusallowing meaningful error messages from the node/instance load routines.
Small syntax improvement
D'oh, one can extract from a wrapped variable, not only from functions.
Convert Cluster.loadData to Result return
This patch changes Cluster.loadData to return a Result, instead ofdirectly the values; this will allow us to return meaningful errorvalues (e.g. when an instances lives on unknown node) rather than simplyabort. Currently the result is always an Ok, the actual signalling of...
Allow overriding the RAPI port/scheme
This patch adds a very dumb way to override the port and scheme forRAPI: if the master string doesn't contain a colon, we consider it asimple hostname specification, and thus prepend ‘https://’ and append‘:5080’, (the default RAPI port); otherwise, we consider it a fully...
Remove some 1.2 specific code
Now that we dropped 1.2 compatibility, we can removed the special casingfor RAPI differences.
Generalize some Result function into monad ones
We don't really needed, but is more clean like this.
Switch from hand-written monads to a real one
This big patch converts from our home-grown monad-like constructs(the Either stuff) to a real, Either-like-but-another-name monad.
We introduce a “Result a” monad, and this allows dropping many of theextra constructs. Hopefully the code is also more clear....
Small changes to the IAlloc module
Adding a small request type data structure.
Don't consider offline nodes as N+1 failed
This is just a cosmetic (I hope) change; the nodes shouldn't be usedanyway, and we only correct the display message.
Drop RAPI v1 compatiblity
Since we only support Ganeti 2.0, we drop the 1.2 compatibility.
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.