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.
Small change in hscan
This fixes a mistake between Int/Integer. Should be more careful :)
Add hscan to Makefile
Add the hscan tool
This patch adds an hscan tool that loads data from clusters via RAPI andwrites it to files that can be later used offline.
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.
More fixes to the Makefile
Small doc update in Node.hs
Some updates to the apidoc rules
Fix/enhance makefile rules after the rename
Add a .gitattributes file
This will enhance the ‘dist’ rule by skipping unneeded files.
Introduce a namespace for the modules
The modules are moved from the ‘top’ namespace to ‘Ganeti.HTools’, incompliance with standard practices.
Update NEWS for version 0.0.6
Abstract the version format into a function
This patch moves the version string creation into a function in Utilswhich shows some more information.
Add a man page for hn1 and update the hbal one
A new man page and typos fixed in hbal.1.
Add a manpage for hbal
Add a --version option
This patch adds a -V, --version command line option that shows theprogram version and also updates the hn1 usage string (similar to hbal).
Move a function around in hbal.hs
This just reorders some functions for a more logical ordering.
Show the step counter in the solution list
This patch changes the solution list to include a step counter so thatit's more clear these are successive steps (in a definite order), andnot just an unordered list of changes.
Use gnt-instance migrate instead of failover
This patch changes the gnt-instance failover to migrate, and fixes a bugin the formatting of commands.
hbal: added a verbose setting and changed output
This patch added a verbose output and changed the output so that bydefault it is less verbose and more clear.
Add a new move FailoverAndReplace
This patch adds a new instance move, FailoverAndReplace, which promotesthe old secondary to primary and then uses a new secondary node.
This is the last move that we can do within the limitations of one nodechanged per move.
Some more docstring updates
Enhance the command list for the solution
This patch moves the formatting of the command list to Cluster.hs andenhances it with separator messages between the steps.
Add a new ReplaceAndFailover move
This patch adds a new replace secondary and failover move (equals to“r:x f”), which can improve the solution (since we are testing moreoptions at each step).
Some whitespace changes
Aligned the comments in Instance.hs
Convert hbal from multiple rounds to a step-method
Currently hbal does multiple rounds, stopping when a rounds doesn'tbring improvements. With the recent changes to not remove instances fromthe candidate list, this is obsolete as the first round will always run...
Rework the solution printing in Cluster.hs
This abstracts the individual placement solution so that it can be usedindependently.
Remove the restriction of one-move-per-round
The current code restricts each instance to one move per round. This isbad, as an computation restarted in the middle of the solution will havea different set of instances to work and will thus lead to a different...
Add a header to node lists and print more data
This prints the total memory/disk and also adds a header.
Rename the maxRes to r_mem
This is to keep in style with the other memory variables.
Display the reserved memory too in node lists
This is useful and not easy to compute otherwise.
First try to embed VCS id in binaries
This patch attempts to embed the VCS id in binaries, based on the wayother projects seem to do this.
Fix the Makefile clean rule
This removes obsolete entries from the clean rule and adds the hbalbinary.
Change the N1 score to percent of N1 failures
Since for a very many N+1 failures in a cluster, we could actuallydegrade the N1 CV by making a node N+1 compliant, we need to make surethis value only decreases when fixing non-compliant nodes.
The easiest way is to compute the N+1 score as a percentage of failed...
Add two new variables in the cluster score
This patch adds two new variables to the cluster score: - variance of the failN1 attribute - variance of the reserved memory percentage
The variance of the failN1 helps make the cluster N+1 happy, whereas the...
Add the node reserved memory percentage
This patch adds the node attribute “reserved memory percentage” that isderived from the maximum reserved memory for a node and its totalmemory.
This will be useful for enhancing the balancing algorithm.
Record the running cluster CV in placements
This patch adds a score variable to the placement type, so we can recordthe changes in the cluster CV for later display.
This gives visibility in the decrease of the parameters and can showwhich are the most important steps to perform (out of the full move...
Also print cluster coefficients in hn1
This patch adds printing the initial and final cluster coefficients inhn1 too, to better understand the found solution.
Beautify the cluster status list
This patch removes the primary/secondary instance lists from the nodestatus and also removes the tabbed formatting with explicit widthformatting.
Beautify solution list
This patch makes the tabular solution list nicer, by changing from tabsto explicit widths.
Limit string literals to 80-char columns
Learned how multi-line string literals work in Haskell :)
Add a news file and make the 0.0.5 release
Beautify: strip common suffix from names
This patch automatically removes the longest common (domain, i.e.starting with a dot) suffix from the node and instance names. This givesa much clearer display, and this format is compatible with the wayGaneti accepts shortened names.
hbal: allow, but warn on, N+1 failed clusters
Based on the node changes, we remove the N+1 check and only show awarning instead.
Change the node N+1 check model
Currently, we fail a new instance placement if the new node status isnot N+1 compliant. This means that an allocation on an already N+1failed node still fails, even though (conceptually) we're not worse thanbefore.
This patch changes this model to fail the allocation only if the node...
Show which nodes are not N+1 compliant in output
This patch adds a '*' character to nodes which are not N+1 compliant tothe output, to help with understanding pre- and post-changes clusterstatus.
Don't build documentation for the Main modules
This fixes the doc issue which exists since the addition of hbal. Nowmake doc makes sense again.
Change the total disk/mem to Double
Since we only use the totals for computations, and we always convertthem via fromIntegral, let's just store them directly as Doubles.
A no-code change s/disk/dsk/
This just makes indendation nicer in many expressions.
Compute the p_mem / p_dsk statically
This patch changes the computation of p_mem / p_dsk from on-demand(whenever the cluster stats are computed) to after-modify (after a nodeis modified, we update its stats). This brings a god speed-up as onlyone node or two are usually changed between cluster-wide stats are...
Documentation updates
Simplify the checkInstanceMove function
This patch flattens the two folds into one, by simply building the wholelist of moves instead of the double recursion (nodes and the eachnode's moves). This has no functional change, but it's much cleaner.
A small optimization in node computation
Currently we always compute the available node list for moves (for aninstances) based on the nodes of the initial table. This works find,however is a repeated calculation.
We optimize this by passing a node list (of indexes, not full objects),...
Container: add a 'keys' function
Replace a foldl by foldl'
Split checkMove into two
This cleans up and splits the individual instance move into a separate function.
Change the balancing algorithm
This patch changes the balancing algorithm to not iterate linearly overthe instances (in a random, but fixed order), instead selecting at eachstep the best next move. This should allow a better score (most of thetime), and usually also a shorter solution.
Add RAPI support to hn1
This patch moves a function to Utils and changes hn1 to be able to takedata from RAPI.
Implement oneline-output for hbal
Do not try both http and https against the server
This patch changes the tryRapi function so that if the http requestsucceeded, we don't try https too.
Simplify some JSON transforms
... hopefully this is more clear.
Add compatibility with rapi v1
The patch adds compatibility with RAPI v1, and this required some newJSON functions as valFromObj doesn't behave nicely.
Some other unrelated changes were done too.
Implement reading data from RAPI v2
Some more utility functions
Fix a bug in Cluster.fixNodes
We need to lookup the moving accumulator, of course.
Make RAPI return the same data format as gnt-*
This patch changes the RAPI endpoint return the same data format as theinput files. This will allow using it instead of the files.
Change the input file formats
This patch changes the format of the input node and instance lists. Itremoves the list of primary and secondary instances from the nodes, andadds the primary and secondary nodes to the instance list.
This is done so that we can have the same input data from commands as...
Initial support for reading from RAPI
Initial import
This is the initial import of release 0.0.3.