ganeti-local
15 years agoUpdate NEWS for version 0.0.6 htools-v0.0.6
Iustin Pop [Mon, 16 Mar 2009 07:35:48 +0000 (08:35 +0100)]
Update NEWS for version 0.0.6

15 years agoAbstract the version format into a function
Iustin Pop [Sat, 14 Mar 2009 19:25:41 +0000 (20:25 +0100)]
Abstract the version format into a function

This patch moves the version string creation into a function in Utils
which shows some more information.

15 years agoAdd a man page for hn1 and update the hbal one
Iustin Pop [Sat, 14 Mar 2009 19:12:02 +0000 (20:12 +0100)]
Add a man page for hn1 and update the hbal one

A new man page and typos fixed in hbal.1.

15 years agoAdd a manpage for hbal
Iustin Pop [Sat, 14 Mar 2009 11:53:43 +0000 (12:53 +0100)]
Add a manpage for hbal

15 years agoAdd a --version option
Iustin Pop [Sat, 14 Mar 2009 11:49:43 +0000 (12:49 +0100)]
Add a --version option

This patch adds a -V, --version command line option that shows the
program version and also updates the hn1 usage string (similar to hbal).

15 years agoMove a function around in hbal.hs
Iustin Pop [Sat, 14 Mar 2009 11:41:13 +0000 (12:41 +0100)]
Move a function around in hbal.hs

This just reorders some functions for a more logical ordering.

15 years agoShow the step counter in the solution list
Iustin Pop [Sat, 14 Mar 2009 11:35:04 +0000 (12:35 +0100)]
Show the step counter in the solution list

This patch changes the solution list to include a step counter so that
it's more clear these are successive steps (in a definite order), and
not just an unordered list of changes.

15 years agoUse gnt-instance migrate instead of failover
Iustin Pop [Sat, 14 Mar 2009 11:16:52 +0000 (12:16 +0100)]
Use gnt-instance migrate instead of failover

This patch changes the gnt-instance failover to migrate, and fixes a bug
in the formatting of commands.

15 years agohbal: added a verbose setting and changed output
Iustin Pop [Sat, 14 Mar 2009 11:14:17 +0000 (12:14 +0100)]
hbal: added a verbose setting and changed output

This patch added a verbose output and changed the output so that by
default it is less verbose and more clear.

15 years agoAdd a new move FailoverAndReplace
Iustin Pop [Sat, 14 Mar 2009 09:11:36 +0000 (10:11 +0100)]
Add a new move FailoverAndReplace

This patch adds a new instance move, FailoverAndReplace, which promotes
the 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 node
changed per move.

15 years agoSome more docstring updates
Iustin Pop [Fri, 13 Mar 2009 19:42:56 +0000 (20:42 +0100)]
Some more docstring updates

15 years agoEnhance the command list for the solution
Iustin Pop [Fri, 13 Mar 2009 19:11:12 +0000 (20:11 +0100)]
Enhance the command list for the solution

This patch moves the formatting of the command list to Cluster.hs and
enhances it with separator messages between the steps.

15 years agoAdd a new ReplaceAndFailover move
Iustin Pop [Fri, 13 Mar 2009 18:53:41 +0000 (19:53 +0100)]
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 more
options at each step).

15 years agoSome whitespace changes
Iustin Pop [Fri, 13 Mar 2009 18:52:44 +0000 (19:52 +0100)]
Some whitespace changes

Aligned the comments in Instance.hs

15 years agoConvert hbal from multiple rounds to a step-method
Iustin Pop [Fri, 13 Mar 2009 07:49:12 +0000 (08:49 +0100)]
Convert hbal from multiple rounds to a step-method

Currently hbal does multiple rounds, stopping when a rounds doesn't
bring improvements. With the recent changes to not remove instances from
the candidate list, this is obsolete as the first round will always run
to the end of the improvements.

This patch changes this so that the Cluster.checkMove function doesn't
recurse, but just computes the next best move (as its docstring says).
This means we can actually incrementally compute and print the solution,
and this is needed as otherwise an instance could move twice and the
second time it needs the current placement to compute the exact command
line and operation needed for the move.

15 years agoRework the solution printing in Cluster.hs
Iustin Pop [Fri, 13 Mar 2009 07:09:35 +0000 (08:09 +0100)]
Rework the solution printing in Cluster.hs

This abstracts the individual placement solution so that it can be used
independently.

15 years agoRemove the restriction of one-move-per-round
Iustin Pop [Thu, 12 Mar 2009 20:21:14 +0000 (21:21 +0100)]
Remove the restriction of one-move-per-round

The current code restricts each instance to one move per round. This is
bad, as an computation restarted in the middle of the solution will have
a different set of instances to work and will thus lead to a different
end-solution.

Once this is applied, further rounds are not possible since the first
round will have tried all instances at its end. As such, the removal of
the rounds feature will be next.

The code adds a hard-coded 100 moves limit, which for big clusters is
actually small.

15 years agoAdd a header to node lists and print more data
Iustin Pop [Thu, 12 Mar 2009 20:16:41 +0000 (21:16 +0100)]
Add a header to node lists and print more data

This prints the total memory/disk and also adds a header.

15 years agoRename the maxRes to r_mem
Iustin Pop [Thu, 12 Mar 2009 20:07:47 +0000 (21:07 +0100)]
Rename the maxRes to r_mem

This is to keep in style with the other memory variables.

15 years agoDisplay the reserved memory too in node lists
Iustin Pop [Thu, 12 Mar 2009 19:54:41 +0000 (20:54 +0100)]
Display the reserved memory too in node lists

This is useful and not easy to compute otherwise.

15 years agoFirst try to embed VCS id in binaries
Iustin Pop [Thu, 12 Mar 2009 19:31:57 +0000 (20:31 +0100)]
First try to embed VCS id in binaries

This patch attempts to embed the VCS id in binaries, based on the way
other projects seem to do this.

15 years agoFix the Makefile clean rule
Iustin Pop [Wed, 11 Mar 2009 08:22:45 +0000 (09:22 +0100)]
Fix the Makefile clean rule

This removes obsolete entries from the clean rule and adds the hbal
binary.

15 years agoChange the N1 score to percent of N1 failures
Iustin Pop [Wed, 11 Mar 2009 08:12:11 +0000 (09:12 +0100)]
Change the N1 score to percent of N1 failures

Since for a very many N+1 failures in a cluster, we could actually
degrade the N1 CV by making a node N+1 compliant, we need to make sure
this value only decreases when fixing non-compliant nodes.

The easiest way is to compute the N+1 score as a percentage of failed
nodes, with the caveat that the domain of values might not be fully
compatible with the other scores. It is still [0, 1] but does not vary
like the others.

15 years agoAdd two new variables in the cluster score
Iustin Pop [Wed, 11 Mar 2009 08:08:31 +0000 (09:08 +0100)]
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
reserved memory percentage helps balance the unused memory for
redundancy on the nodes.

15 years agoAdd the node reserved memory percentage
Iustin Pop [Wed, 11 Mar 2009 08:07:06 +0000 (09:07 +0100)]
Add the node reserved memory percentage

This patch adds the node attribute “reserved memory percentage” that is
derived from the maximum reserved memory for a node and its total
memory.

This will be useful for enhancing the balancing algorithm.

15 years agoRecord the running cluster CV in placements
Iustin Pop [Wed, 11 Mar 2009 07:14:56 +0000 (08:14 +0100)]
Record the running cluster CV in placements

This patch adds a score variable to the placement type, so we can record
the changes in the cluster CV for later display.

This gives visibility in the decrease of the parameters and can show
which are the most important steps to perform (out of the full move
list).

15 years agoAlso print cluster coefficients in hn1
Iustin Pop [Wed, 11 Mar 2009 07:13:18 +0000 (08:13 +0100)]
Also print cluster coefficients in hn1

This patch adds printing the initial and final cluster coefficients in
hn1 too, to better understand the found solution.

15 years agoBeautify the cluster status list
Iustin Pop [Tue, 10 Mar 2009 20:20:06 +0000 (21:20 +0100)]
Beautify the cluster status list

This patch removes the primary/secondary instance lists from the node
status and also removes the tabbed formatting with explicit width
formatting.

15 years agoBeautify solution list
Iustin Pop [Tue, 10 Mar 2009 19:35:01 +0000 (20:35 +0100)]
Beautify solution list

This patch makes the tabular solution list nicer, by changing from tabs
to explicit widths.

15 years agoLimit string literals to 80-char columns
Iustin Pop [Tue, 10 Mar 2009 18:59:50 +0000 (19:59 +0100)]
Limit string literals to 80-char columns

Learned how multi-line string literals work in Haskell :)

15 years agoAdd a news file and make the 0.0.5 release htools-v0.0.5
Iustin Pop [Mon, 9 Mar 2009 20:47:48 +0000 (21:47 +0100)]
Add a news file and make the 0.0.5 release

15 years agoBeautify: strip common suffix from names
Iustin Pop [Mon, 9 Mar 2009 20:37:39 +0000 (21:37 +0100)]
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 gives
a much clearer display, and this format is compatible with the way
Ganeti accepts shortened names.

15 years agohbal: allow, but warn on, N+1 failed clusters
Iustin Pop [Mon, 9 Mar 2009 19:50:08 +0000 (20:50 +0100)]
hbal: allow, but warn on, N+1 failed clusters

Based on the node changes, we remove the N+1 check and only show a
warning instead.

15 years agoChange the node N+1 check model
Iustin Pop [Mon, 9 Mar 2009 19:46:24 +0000 (20:46 +0100)]
Change the node N+1 check model

Currently, we fail a new instance placement if the new node status is
not N+1 compliant. This means that an allocation on an already N+1
failed node still fails, even though (conceptually) we're not worse than
before.

This patch changes this model to fail the allocation *only* if the node
was N+1 compliant before. This allows balancing to work on non-N+1 happy
clusters, with the caveat that they probably won't be N+1 happy at the
end.

Since we skip N+1 check in some cases, we add a new “failHealth” check
that verifies the node still has strict positive free memory and disk
space.

15 years agoShow which nodes are not N+1 compliant in output
Iustin Pop [Mon, 9 Mar 2009 19:33:13 +0000 (20:33 +0100)]
Show which nodes are not N+1 compliant in output

This patch adds a '*' character to nodes which are not N+1 compliant to
the output, to help with understanding pre- and post-changes cluster
status.

15 years agoDon't build documentation for the Main modules
Iustin Pop [Sun, 22 Feb 2009 12:20:00 +0000 (13:20 +0100)]
Don't build documentation for the Main modules

This fixes the doc issue which exists since the addition of hbal. Now
make doc makes sense again.

15 years agoChange the total disk/mem to Double
Iustin Pop [Sun, 22 Feb 2009 12:18:52 +0000 (13:18 +0100)]
Change the total disk/mem to Double

Since we only use the totals for computations, and we always convert
them via fromIntegral, let's just store them directly as Doubles.

15 years agoA no-code change s/disk/dsk/
Iustin Pop [Sun, 22 Feb 2009 12:15:12 +0000 (13:15 +0100)]
A no-code change s/disk/dsk/

This just makes indendation nicer in many expressions.

15 years agoCompute the p_mem / p_dsk statically
Iustin Pop [Sun, 22 Feb 2009 12:05:08 +0000 (13:05 +0100)]
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 node
is modified, we update its stats). This brings a god speed-up as only
one node or two are usually changed between cluster-wide stats are
computed.

15 years agoDocumentation updates htools-v0.0.4
Iustin Pop [Sun, 15 Feb 2009 13:53:38 +0000 (14:53 +0100)]
Documentation updates

15 years agoSimplify the checkInstanceMove function
Iustin Pop [Sun, 15 Feb 2009 13:48:39 +0000 (14:48 +0100)]
Simplify the checkInstanceMove function

This patch flattens the two folds into one, by simply building the whole
list of moves instead  of the double recursion (nodes and the each
node's moves). This has no functional change, but it's much cleaner.

15 years agoA small optimization in node computation
Iustin Pop [Sun, 15 Feb 2009 13:40:42 +0000 (14:40 +0100)]
A small optimization in node computation

Currently we always compute the available node list for moves (for an
instances) 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),
which helps in two ways:
  - faster to filter later
  - allows restriction of target nodes by enforcing only this subset as
    target for moves

15 years agoContainer: add a 'keys' function
Iustin Pop [Sun, 15 Feb 2009 13:40:13 +0000 (14:40 +0100)]
Container: add a 'keys' function

15 years agoReplace a foldl by foldl'
Iustin Pop [Sun, 15 Feb 2009 13:35:53 +0000 (14:35 +0100)]
Replace a foldl by foldl'

15 years agoSplit checkMove into two
Iustin Pop [Sun, 15 Feb 2009 13:10:41 +0000 (14:10 +0100)]
Split checkMove into two

This cleans up and splits the individual instance move into a separate function.

15 years agoChange the balancing algorithm
Iustin Pop [Sat, 14 Feb 2009 21:22:26 +0000 (22:22 +0100)]
Change the balancing algorithm

This patch changes the balancing algorithm to not iterate linearly over
the instances (in a random, but fixed order), instead selecting at each
step the best next move. This should allow a better score (most of the
time), and usually also a shorter solution.

15 years agoAdd RAPI support to hn1
Iustin Pop [Sat, 14 Feb 2009 08:05:06 +0000 (09:05 +0100)]
Add RAPI support to hn1

This patch moves a function to Utils and changes hn1 to be able to take
data from RAPI.

15 years agoImplement oneline-output for hbal
Iustin Pop [Sat, 14 Feb 2009 08:00:56 +0000 (09:00 +0100)]
Implement oneline-output for hbal

15 years agoDo not try both http and https against the server
Iustin Pop [Sat, 14 Feb 2009 07:51:15 +0000 (08:51 +0100)]
Do not try both http and https against the server

This patch changes the tryRapi function so that if the http request
succeeded, we don't try https too.

15 years agoSimplify some JSON transforms
Iustin Pop [Sat, 14 Feb 2009 07:46:16 +0000 (08:46 +0100)]
Simplify some JSON transforms

... hopefully this is more clear.

15 years agoAdd compatibility with rapi v1
Iustin Pop [Fri, 13 Feb 2009 21:26:23 +0000 (22:26 +0100)]
Add compatibility with rapi v1

The patch adds compatibility with RAPI v1, and this required some new
JSON functions as valFromObj doesn't behave nicely.

Some other unrelated changes were done too.

15 years agoImplement reading data from RAPI v2
Iustin Pop [Fri, 13 Feb 2009 08:28:57 +0000 (09:28 +0100)]
Implement reading data from RAPI v2

15 years agoSome more utility functions
Iustin Pop [Fri, 13 Feb 2009 08:27:55 +0000 (09:27 +0100)]
Some more utility functions

15 years agoFix a bug in Cluster.fixNodes
Iustin Pop [Fri, 13 Feb 2009 08:26:13 +0000 (09:26 +0100)]
Fix a bug in Cluster.fixNodes

We need to lookup the moving accumulator, of course.

15 years agoMake RAPI return the same data format as gnt-*
Iustin Pop [Thu, 12 Feb 2009 20:14:17 +0000 (21:14 +0100)]
Make RAPI return the same data format as gnt-*

This patch changes the RAPI endpoint return the same data format as the
input files. This will allow using it instead of the files.

15 years agoChange the input file formats
Iustin Pop [Thu, 12 Feb 2009 19:55:51 +0000 (20:55 +0100)]
Change the input file formats

This patch changes the format of the input node and instance lists. It
removes the list of primary and secondary instances from the nodes, and
adds the primary and secondary nodes to the instance list.

This is done so that we can have the same input data from commands as
from the RAPI.

15 years agoInitial support for reading from RAPI
Iustin Pop [Wed, 11 Feb 2009 20:37:42 +0000 (21:37 +0100)]
Initial support for reading from RAPI

15 years agoInitial import htools-v0.0.3
Iustin Pop [Wed, 28 Jan 2009 11:09:09 +0000 (12:09 +0100)]
Initial import

This is the initial import of release 0.0.3.