Statistics
| Branch: | Tag: | Revision:

root / hbal.hs @ 2e28ac32

History | View | Annotate | Download (11.7 kB)

# Date Author Comment
2e28ac32 02/22/2010 03:50 pm Iustin Pop

Implement evacuation mode in hbal

This mode restricts the list of instances to be moved to the instances
living on the offline (and drained) nodes.

Signed-off-by: Iustin Pop <>

5ad86777 01/14/2010 06:05 pm Iustin Pop

Split the balancing function in two parts

Currently in the balancing function we do two thing:

- take the decision where to do a new balancing round or not
- and actually computing the balancing round

This is not nice, as the two parts are conceptually separate, so this...

16c2369c 01/07/2010 01:57 pm Iustin Pop

Switch the text file format to single-file

This patch changes from the two separate files to a single file, with
sections separated by a blank line. Currently only the node and instance
data is accepted, later the cluster tags will be read too via this
format....

ea017cbc 12/01/2009 11:53 am Iustin Pop

Read cluster tags in the RAPI backend

This also shows them in hbal in verbose mode.

94e05c32 11/27/2009 05:13 pm Iustin Pop

Introduce support for reading the cluster tags

While these are not actually populated from the backends, and all the
programs ignore them, this patch contains the changes in the function
types required.

0f15cc76 11/17/2009 11:44 am Iustin Pop

Add a command-line option to filter exclusion tags

Since we don't want all instance tags to be used for exclusion, we add a
command line option to filter on these. Since the iallocator protocol
cannot accept command line options, currently it's not possible to...

e98fb766 11/10/2009 02:59 pm Iustin Pop

Allow overriding the field list in -p

The print nodes option can now accept an optional field list to
customise the output. This is ugly, since the field names do not match
the header names, but it is at least barely customisable (at runtime).

aa8d2e71 10/16/2009 04:59 pm Iustin Pop

Add loading and processing of utilisation data

This patch adds loading and processing the utilisation data during
instance moves. While the data is not yet used, it is correctly modified
by instance changes between nodes.

hbal has the new ‘-U’ command line argument for this. The format of the...

507fda3f 10/15/2009 05:00 pm Iustin Pop

Allow displaying the instance map in hbal

This is similar to --print-nodes, but with much fewer fields.

f5b553da 10/14/2009 04:41 pm Iustin Pop

Style change: cluster CStats camel-casing

This is again the cs_x to csX name change.

b2245847 10/14/2009 11:56 am Iustin Pop

Implement first version of job execution

This not so nice patch adds submit/wait-for-completion functionality in
hbal. When enabled via ‘-X’ (only working on Luxi), it executes the jobs
(as split into separate jobsets by Cluster.splitJobs) and waits until...

924f9c16 10/14/2009 11:55 am Iustin Pop

Extend the MoveJob type to hold the instance index

This will be needed in order to generate the proper instance move commands.

Signed-off-by: Iustin Pop <>

a2e90275 10/02/2009 06:54 pm Iustin Pop

Store the instance move in the MoveJobs

This will automatically sort our Ganeti jobs into the independent job
sets, and then we can submit them separately.

92e32d76 10/02/2009 06:48 pm Iustin Pop

Move some more type definitions to Types.hs

0e8ae201 10/02/2009 02:56 pm Iustin Pop

hbal: Implement grouping of moves into jobsets

Since moving two instances between different node-quadruples (inst X: A,
B → C, D and inst Y: E, F → G, H) can be parallelised by Ganeti, it
makes sense to split the operation list into jobsets whose execution...

e8f89bb6 09/28/2009 03:50 pm Iustin Pop

Split the exernal data loader out of CLI.hs

Currently the external data loader is in CLI.hs, which makes all
programs that need cli functionality (options, etc.) link against the
network modules (most importantly curl). This patch splits this
functionality into a new module such that (for example) hail which only...

f25e5aac 08/30/2009 06:55 pm Iustin Pop

Split the balancing algorithm in two parts

Currently the computation, recursing part and the IO part (progress
updates) of the balancing main function (iterateDepth) are all in the
same function, which makes it hard to test. This patch moves the
decision/computation part (whether to proceed one more round, whether we...

c0501c69 08/26/2009 11:07 am Iustin Pop

Implement support for 'cheap' moves only

This patch adds support for cheap (failover/migrate) operations only in
the balancing algorithm and in the hbal command line options.

This allows a very quick balancing (compared to allowing replace-disks)
which can be useful as a scheduled operation.

24acc2c6 07/28/2009 12:29 pm Guido Trotter

Fix a typo in hbal.hs

Signed-off-by: Guido Trotter <>

0427285d 07/15/2009 11:31 am Iustin Pop

Unify the command line options and structures

This patch moves all the command line options and their internal
representation into CLI.hs. This means that duplicated options between
any two binaries are no longer declared twice, and that we no longer
need the two *Option classes.

8e445e6d 07/14/2009 04:06 pm Iustin Pop

Add support for luxi backend in CLI/hspace/hbal

This patch changes the backend selection method in CLI to prefer, in order:
- a RAPI specification
- a Luxi specification
- and finally the node/instance files

It also modifies hspace and hbal to provide a ‘-L’ command line option...

2795466b 07/07/2009 12:20 pm Iustin Pop

Show errors on stderr instead of stdout

Currently many of the exit and warning conditions mistakenly display error
messages on stdout, which makes parsing the output of programs harder. This
patch attempts to fix such occurrences.

9f6dcdea 07/06/2009 11:50 pm Iustin Pop

Fix hlint-generated warnings

This big patch cleans up the code per hlint indications. Many removals
of extra parentheses, replacements of concat . map with concabtMap,
extra dollar signs, eta reductions, etc. were performed.

The code still compiles and passes a couple of manual tests on sample...

1a7eff0e 07/03/2009 12:50 am Iustin Pop

Add a new type for cluster statistics

Currently totalResources returns a 5-tuple of integers. This is not easy
to handle, as each change on the return type means that each caller must
be updated.

This patch adds a new type for cluster stats and uses that instead as...

e2af3156 07/02/2009 01:33 pm Iustin Pop

Add display of more stats in hspace

This patch changes Cluster.totalResources to compute more details about
the cluster status, and enhances hspace to display more of these.

877d0386 06/13/2009 01:33 am Iustin Pop

Some documentation updates for the new parameters

66d67ad4 06/13/2009 01:33 am Iustin Pop

Add cpu/disk limits in hbal

78694255 06/12/2009 02:22 am Iustin Pop

Fix the various monomorphism warning

In a few places (e.g. tryRead or any printf call) it's a little bit hard
to add the correct type signatures, but in the it is possible to fix
these warnings (which can bite one in subtle cases).

e2fa2baf 06/01/2009 12:55 pm Iustin Pop

Add copyright/license information

This doc-patch adds copyright and license information to (hopefully) all
needed files.

262a08a2 05/27/2009 02:17 am Iustin Pop

Change the module import hierarchy

This patch makes the Types module a base module, and Node/Instance ones
import it, from the previous (opposite) situation. This will allow in
the future to use newtypes for the index and name types.

8472a321 05/24/2009 02:36 am Iustin Pop

Remove the ktn/kti from second half of loading

This removes the return of ktn/kti from Loader.mergeData and associated
functions.

db1bcfe8 05/24/2009 02:29 am Iustin Pop

Remove most uses of ktn/kti

This patch removes all uses of ktn/kti from the past-loader stages.

dbd6700b 05/24/2009 02:05 am Iustin Pop

Remove some extraneous uses of ktn/kti

Since we have Node/Instance.name, we can now simplify a few constructs.

926c35b1 05/24/2009 01:32 am Iustin Pop

Some small layout changes

fae371cc 05/24/2009 01:22 am Iustin Pop

Move common loading sequence in CLI

This patch moves the common loading sequence to CLI, such that hbal/hn1
and possible future scripts that take the input from same sources can
use it.

446d8827 05/24/2009 01:16 am Iustin Pop

Move checkData from Cluster to Loader

This moves the remaining loading function to Loader (together with its
associated support functions).

75d1edf8 05/23/2009 03:34 am Iustin Pop

Introduce a class for CLI options

This patch generalizes a little the CLI handling by not passing in a
special function for help and such, but instead requiring that the
options object supports some common functionality.

e4c5beaf 05/23/2009 02:29 am Iustin Pop

More code reorganizations

This new big patch does a couple of more cleanups in the loading of data
chapter:
- 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)...

040afc35 05/22/2009 08:03 pm Iustin Pop

Rework the loader model

This big patch changes the loader model from “string data as common
format” 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...

fd22ce8e 05/21/2009 02:09 am Iustin Pop

Convert Cluster.loadData to Result return

This patch changes Cluster.loadData to return a Result, instead of
directly the values; this will allow us to return meaningful error
values (e.g. when an instances lives on unknown node) rather than simply
abort. Currently the result is always an Ok, the actual signalling of...

942403e6 05/21/2009 12:25 am Iustin Pop

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 the
extra constructs. Hopefully the code is also more clear....

d09b6ed3 04/26/2009 05:15 pm Iustin Pop

hbal: add a --quiet option

This option is the opposite of the --verbose option, and it allows
decreasing the verbosity level from the default of one to zero (which
currently doesn't show the warning messages for missing disk/memory).

ba6c6006 04/25/2009 06:40 pm Iustin Pop

hbal: Simplify the oneline formatting

This patch moves the oneline format into a separate function for easier
usage.

dcbcdb58 04/25/2009 06:40 pm Iustin Pop

hbal: Early exit when we don't have any instances

For clusters with no instances, there is no point in computing either
the score or in running the algorithm. In this case, we exit prematurely
and when running in one-line mode we show dummy information.

b0517d61 04/25/2009 06:40 pm Iustin Pop

hbal: Add a new min-score option

This new parameter causes the algorithm to finish (or even not start at
all) if we reach/have a score better than it.

8032b3b5 04/20/2009 02:07 pm Iustin Pop

Add reading the file names from env vars

This patch adds support for selecting the instance/node file names via
two environment variables (HTOOLS_NODES, HTOOLS_INSTANCES).

Unfortunately we still have lots of duplicated code, since the options
are not unified.

45f01962 04/20/2009 02:00 pm Iustin Pop

Implement error checks for extra arguments

Neither hbal nor hn1 take any arguments beside the options, so if any
are passed is most likely an unintended error. This patch aborts in such
cases.

e0eb63f0 04/19/2009 01:17 am Iustin Pop

Implement writing the command list to a script

This patch adds support in hbal for writing the command list to a shell
script, with error checking and allowing for early exit.

3d7cd10b 04/16/2009 12:02 pm Iustin Pop

hbal: Abort for invalid offline node names

Since it's easy to pass a wrong node name as offline, we should abort
instead of silently ignoring it.

a1c6212e 03/22/2009 12:07 pm Iustin Pop

Show the x_mem/i_mem in node list

This patch adds checking of cluster data in the binaries and display of
node's x_mem/i_mem in the node list.

209b3711 03/22/2009 11:52 am Iustin Pop

Split common CLI functionality into a module

This patch moves the common CLI functionality (as much as currently
possible) into a separate module. This means we only have one parseOpts
and that Utils.hs doesn't keep this kind of functions anymore.

740ec004 03/21/2009 11:00 pm Iustin Pop

Add a separate type for the [(Int, String)] list

This is added for better readability, since this is very often used in
declarations.

ec18dca9 03/21/2009 12:48 am Iustin Pop

Add command line support for offlining nodes

This patch modifies hbal (only, hn1 not yet) for setting nodes offline.

669d7e3d 03/20/2009 07:16 pm Iustin Pop

Introduce a namespace for the modules

The modules are moved from the ‘top’ namespace to ‘Ganeti.HTools’, in
compliance with standard practices.