Statistics
| Branch: | Tag: | Revision:

root / Ganeti @ 669ea132

# Date Author Comment
669ea132 12/01/2009 01:24 pm Iustin Pop

Read cluster tags in the IAllocator backend

f89235f1 12/01/2009 12:47 pm Iustin Pop

Read cluster tags in the LUXI backend

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...

b2999982 11/17/2009 11:44 am Iustin Pop

Add a new node list field

This patch adds a new node list field (ptags), showing the primary
instance tags.

1e4b5230 11/17/2009 11:44 am Iustin Pop

Node: add function for conflicting primary count

d844fe88 11/17/2009 11:44 am Iustin Pop

Use conflicting primaries count in cluster score

This small patch adds the number of conflicting primaries in the cluster
score. This is different from the other non-CV metrics where we usually
compute the percentage of failing instances (for that metric); but for a...

e27eb8ab 11/17/2009 11:44 am Iustin Pop

Specialize the math functions

The statistics functions are currently defined as polymorphic with a
Floating constraint. Changing this to monomorphic on Double type makes
them stricter and much more performant (~70% speedup). This is a cheap
way to recoup some of the loses incurred by the recent proliferation of...

185297fa 11/17/2009 11:44 am Iustin Pop

Collapse the statistical functions into one

This allows us to get rid of two duplicate list length computations,
with a minor speedup.

5f0b9579 11/17/2009 11:44 am Iustin Pop

Introduce tag-based exclusion of primary instances

This patch introduces exclusion of primary instances based on tags. This
is incomplete as currently all tags are being excluded, and we don't
optimise towards relocation of instances sharing tags on the same node.

17e7af2b 11/11/2009 12:10 pm Iustin Pop

Add a tags attribute to instances

… and read it in all the loaders. hscan is modified to save it to the
files it generates.

The attribute is not yet used in any place.

27671a61 11/11/2009 11:39 am Iustin Pop

Small change in some list arguments

This is simpler than the concat operator.

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).

76354e11 11/09/2009 05:49 pm Iustin Pop

Move more node-listing functionality in Node.hs

This will prepare for the runtime-selectable field list.

a7a8f280 11/09/2009 04:51 pm Iustin Pop

Change the default dynamic usage to baseUtil

This fixed the unbalanced secondary instances on partially empty
clusters, and helps in general for the cases where real utilisation data
is not available.

daee4bed 11/09/2009 03:43 pm Iustin Pop

Add a few comments in the scoring function

117dc2d8 11/06/2009 07:23 pm Iustin Pop

Enhance the error reporting for Rapi and Luxi

Currently the JSON conversion in Rapi and Luxi are giving something
like:
Error: failed to load data. Details:
Unable to read Double

This doesn't tell one where the error is (in a node specification? and...

262f3e6c 11/06/2009 07:23 pm Iustin Pop

Change the Utils.fromObj signature

Currently the fromObj function takes a JSON object which is then
converted into a list of (String, JSValue) in which we make a lookup.
However, most of the callers of this function call it repeatedly on the
same object, which means we do the object→list conversion repeatedly....

7f4e37f0 11/06/2009 07:13 pm Iustin Pop

Make some CLI options more consistent

Both the simulate and the tiered allocation mode take a machine spec on
input via a comma-separated list. This patch makes this a little bit
more consistent (always use disk,ram,cpu in this order).

83ad1f3c 11/06/2009 07:13 pm Iustin Pop

hspace: show tiered-alloc stats in the output

This is a first attempt to get a readable output of tiered allocation
stats in hspace's output. Not very nice, but it should be somewhat
parseable.

12e6776a 11/06/2009 07:13 pm Iustin Pop

A small style change in Node.hs

This imports PeerMap as P and reindents some lines.

c8db97e5 11/06/2009 07:12 pm Iustin Pop

Add support for shrinking instance specs

This patch adds a function that, for some given failure modes, shrinks a
given instance in the hope that allocation will succeed when retried
with the new spec.

2f567ac0 10/30/2009 01:23 pm Iustin Pop

Convert option parsing to a monadic flow

This allows us to do verification of option arguments in the assignment
functions themselves.

1f9066c0 10/30/2009 01:23 pm Iustin Pop

Rework the instance spec CLI options

This patch reworks the internal handling of the instance spec CLI
option, and adds a tiered spec option that will be used in hspace to
enable the (auxiliary) tiered-spec allocation mode.

It also introduces a new data type for holding the instance...

ce0392e6 10/21/2009 02:06 pm Iustin Pop

Some cleanup of Loader.mergeData

This doesn't need to be a monadic function, let's make it a simpler one.

a5f8dcdc 10/21/2009 11:58 am Iustin Pop

hbal: ignore unknown instance in dynload file

Since the utilisation file might be generated at a different time from
the hbal run, and instances could dissapear in the meantime, it's better
to simply ignore unknown instances rather than abort.

30ff0c73 10/21/2009 11:47 am Iustin Pop

Expand the --print-instances output

This adds run status, resource parameters and load parameters for
instances.

e7724ccc 10/19/2009 01:08 am Iustin Pop

Change the Container.findByName function

This patch changes the signature and implementation of the function;
returning the item makes more sense (saves a lookup later again in the
container, and applying idx is cheap), and the previous implementation
was ugly.

bbd8efd2 10/19/2009 01:08 am Iustin Pop

Some small style fixes

8c9af2f0 10/19/2009 12:17 am Iustin Pop

Simplify the cstats initializer

Since all values are initialized to zero, the exact ordering is not
important and thus we can use the positional mode for simpler code.

The patch also adds docstrings to the cstats functions.

668c03b3 10/19/2009 12:11 am Iustin Pop

Simplify Cluster.computeMoves

Since we now have an actual type for describing the instance moves
(IMove), it's simpler to convert this into the move description/move
commands, rather than re-computing the move based on initial and final
nodes. This makes the shell commands computation and over-Luxi command...

eb2598ab 10/18/2009 11:20 pm Iustin Pop

Remove obsolete export

The ‘Placement’ type has been moved to Types.hs but we kept exporting it
from Cluster, which is not needed.

c5f7412e 10/18/2009 08:21 pm Iustin Pop

Generalise the node/instance listing

This patch introduces a generic formatTable function (based on, and
similar to the Ganeti one, but different and more FP in style) and
changes the node and instance listing to it.

The node list (due to the many variables) is still a little bit hackish...

ad6cffe4 10/18/2009 07:38 pm Iustin Pop

Fix instance listing for non-redundant case

c4ef235b 10/16/2009 05:24 pm Iustin Pop

Fix two haddoc/happy docstring issues

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

Start using the utilisation scores in balancing

This enables the per-node load/total available capacity scores to be
used in balancing. Note that the total available capacity is currently
fixed at zero and cannot be changed by the user.

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...

4f83a560 10/16/2009 02:54 pm Iustin Pop

Add an option to input utilisation data

a488a217 10/16/2009 02:43 pm Iustin Pop

Merge the Node.setPri and Node.addCpus functions

The latter is only used right after the former in the Loader module, and
we'll need more of this 'update not with the data of this instance'
functionality (which is different than addPri where all information must...

5b763470 10/16/2009 10:41 am Iustin Pop

Move some utility functions to Utils.hs

These were already duplicate (Text and Simu) and we need tryRead in more places.

183a9c3d 10/16/2009 10:09 am Iustin Pop

Show the load on nodes in node lists

The strange printf usage is due to some limitation (it seems) in ghc for
very long argument lists. The whole printout should be rewritten later.

2180829f 10/15/2009 05:05 pm Iustin Pop

Add initial structure for utilisation balancing

This patch adds the datatypes and modifies the nodes and instance types to have
such attributes. They are not used yet in any way.

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.

181d4e04 10/15/2009 11:49 am Iustin Pop

Add an explicit export list to Instance.hs

This exports all functions, but it's still good to have.

3a3c1eb4 10/15/2009 11:33 am Iustin Pop

More hlint fixes

This makes (for now) the code hlint-clean. This is per se not a huge
gain, but it allows easier tracking of regressions in style later
(one-two new violations are easier to diagnose when not hidden among 20
“known” ones).

c15f7183 10/14/2009 04:43 pm Iustin Pop

Style change: camel-casing of unittests

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.

2060348b 10/14/2009 04:41 pm Iustin Pop

Style change: node and instance attributes

This changes from a_b to aB in all node and instance attributes, to
match the standard Haskell style. Also attributes that should have been
camel-cased but weren't were changed (e.g. plist → pList, pnode →
pNode).

fca250e9 10/14/2009 01:45 pm Iustin Pop

Modify the internals of the detailed CV scores

Before we used a tuple; since we'll need more metrics in the future,
it's simpler to transform this into a list of doubles, whose elements
are handled homogeneously by all the code that needs them.

0df5a1b4 10/14/2009 11:56 am Iustin Pop

Add a command line option for executing jobs

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

9a2ff880 10/14/2009 11:56 am Iustin Pop

Add two specialized Luxi calls

This are higher level wrappers over the basic callMethod.

Signed-off-by: Iustin Pop <>

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

Change iMoveToJob to properly create migrates

The current Cluster.iMoveToJob always creates failovers, which is not
what we want. This simply used the original instances status to select
between these two (this is not optimal by the way, since the status...

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 <>

13b6cb3f 10/14/2009 11:53 am Iustin Pop

Add a simple module for dealing with Ganeti jobs

This holds for now just the job status definitions and its serialisation
to/from JSON.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

66dac8e0 10/12/2009 03:13 pm Iustin Pop

Fix haddock issues with tuple members

It seems that haddock cannot document tuple members - but arguably, once
one needs to do that, tuples should not be used anymore.

This just moves the comments to the tuple comment.

Signed-off-by: Iustin Pop <>...

e97f211e 10/08/2009 01:06 pm Guido Trotter

parseNode: don't lookup values in drained nodes

Currently parseNode skips looking for values in offline nodes, but tries
to read them for drained ones. With this patch we treat offline and
drained nodes in the same way (which is compatible with the iallocator...

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

6b20875c 10/02/2009 06:37 pm Iustin Pop

Add a function converting Placements into Jobs

This converts from htools-specific Placements into Ganeti standard
OpCodes, which will later allow execution via Luxi.

702a4ee0 10/02/2009 06:35 pm Iustin Pop

Add a small implementation of OpCodes

These are just a few opcodes we need for executing instance moves.

3173c987 10/02/2009 05:52 pm Iustin Pop

Record the move being performed in a Placement

This will allow a more descriptive output later in the solution list, as
opposed to trying to reconstruct the move from the node indices.

The patch also documents the Placement members.

a1b5eeaf 10/02/2009 03:54 pm Iustin Pop

Add definitions for more Luxi calls

6583e677 10/02/2009 03:54 pm Iustin Pop

Split the Luxi generic parts from the loader

The Luxi loader implements both a generic Ganeti Luxi client and the
loader; it is better if these two are separated. The patch adds a
Ganeti/Luxi.hs (not under HTools!) since that is generic for Ganeti, and
not related necessarily to htools.

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...

1cf97474 09/30/2009 03:12 am Iustin Pop

Change ExtLoader to only handle I/O errors

Due to the Control.Exception changes between 6.8 and 6.10, using it
portably is difficult. Since we're only interested in handling I/O
errors, we can use prelude's catch and not have to deal with
Control.Exception at all....

cf924b6d 09/29/2009 04:43 pm Iustin Pop

Brown-paper-bag release fixing haddock issues

Haddock doesn't like pre-processed files (at least not in all versions).
Thus we need to remove the ExtLoader module from the haddock-procesed
file list.

685f5bc6 09/28/2009 05:09 pm Iustin Pop

Brown bag fix: invert a test

During testing I used the test inversely to see it triggers correctly,
and committed by mistake the inverted test. Fixing it.

fbb95f28 09/28/2009 05:09 pm Iustin Pop

Turn on, and fix, more warnings

The Makefile was intented to be -Wall and not simply -W, but I missed
that. This enables more warnings and also enables -Werror (except for
the tests).

45ab6a8d 09/28/2009 04:16 pm Iustin Pop

Add support for building without curl

Since curl is not always needed (e.g. when only using luxi or less
likely file backends only) and is also not always available, it is
useful for building without it. This of course disabled the RAPI
backend.

This patch changes ExtLoader to build with the ‘-cpp’ option which makes...

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...

084b2502 09/03/2009 01:58 am Iustin Pop

Fix luxi recvMsg for messages bigger than 4K

This patch fixes a logic bug in luxi that breaks receive of messages
bigger than 4096 bytes. The send message is not impacted as it uses a
different algorithm.

1ae7a904 09/01/2009 01:54 am Iustin Pop

Add some more instance tests

This include instance text load tests.

cf35a869 09/01/2009 01:54 am Iustin Pop

Test some cases for the cluster score computation

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.

633e6bcb 08/26/2009 10:45 am Iustin Pop

Simplify the wrapIO function

This fixes one warning from hlint.

c9926b22 08/26/2009 10:40 am Iustin Pop

Use migrate or failover based on instance state

While we can't guarantee that the instance will be in the same state by
the time the migrate/failover command will be run, we can at least try
to do the right thing assuming no other changes to the cluster state....

f723de38 08/19/2009 02:03 pm Iustin Pop

Improve the error message for command line errors

Instead of using ioError . userError, we format the error ourselves.
This is nicer - no ‘)’ at the end of the output.

b2278348 08/18/2009 07:11 pm Iustin Pop

Add a simulated cluster data loader

This is useful especially for hspace, where we might want to simulate a
hypothetical cluster to check allocation beforehand.

175cc337 07/15/2009 08:22 pm Iustin Pop

CLI: Handle error better

This patch adds an error handler for any exceptions that are raised
during the external data load phase. This can be improved further, but
it's a good start.

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.

2485487d 07/14/2009 05:15 pm Iustin Pop

Fix a few hlint errors

26d47cf5 07/14/2009 05:00 pm Iustin Pop

CLI: Prevent incompatible options to be selected

This patch makes CLI abort if more than one backend is selected.

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...

53ec9022 07/14/2009 03:56 pm Iustin Pop

Initial commit of the luxi backend

This patch adds a luxi backend that allows direct query of the master
daemon on the local node. This patch doesn't enable the backend to be
used.

There are a couple of things still missing in the implementation:
- we don't have a master timeout in reads and writes, only a...

135a6c6a 07/14/2009 03:56 pm Iustin Pop

Introduce timeout in RAPI queries

The patch adds two constants in Types.hs for connect and query timeout,
then modifies Rapi.hs to use them as the connect and general curl
timeout.

Rapi could be improved more, as currently we wait double the total
timeout due to not aborting early in case the node queries failed.

7d11799b 07/09/2009 04:58 pm Iustin Pop

Fix a haddoc issue

31e7ac17 07/09/2009 04:16 pm Iustin Pop

hspace: fix failure handling of tryAlloc results

Currently hspace doesn't handle failures from tryAlloc correctly; this
patch changes the iterateDepth function in hspace to return a Result (…)
so that errors can be propagated correctly.

The patch also changes one output key to be more clear and a typo in...

478df686 07/09/2009 03:44 pm Iustin Pop

Change the tryAlloc/tryReloc workflow

Currently, the tryAlloc and tryReloc function return a list with all the
results, both failures and successes. This is fine for hail, which does
one round of allocations, but is not so good for hspace, which does
iterative rounds; since at each (successful) step we only take the best...

685935f7 07/08/2009 08:30 pm Iustin Pop

Simplify the Cluster.tryAlloc structures

Currently the tryAlloc function calls the
allocateOnSingle/allocateOnPair and the builds a new tuple with those
functions's result plus the new node list. This is however suboptimal
in two respects:
- the new nodes added are the 'old' versions of the respective nodes,...

8880d889 07/08/2009 07:38 pm Iustin Pop

Slight change to the internal allocation results

Currently the Cluster.AllocSolution type is defined as a list of
‘(OpResult Node.list, …)’ and the results for applyMove are defined as
‘(OpResult Node.List, …)’. Both these means that the failure/success
indication is hidden in the first elements of this tuple, which makes is...

2bbf77cc 07/08/2009 05:34 pm Iustin Pop

hspace: switch output to shell-script format

This (big) patch changes the output of hspace from text-format
(separated by ‘: ’) to a shell-snippet, in ‘key=value’ format.

This will allow sourcing the output or parsing it via awk/sed/etc.

de4ac2c2 07/08/2009 12:49 pm Iustin Pop

hspace: move instance count and score into CStats

Currently the instance count and cluster score are separated from the
other initial/final phase stats, even though they are very similar. This
patch moves computation of these two into totalResources/CStats and...

79a72ce7 07/07/2009 07:10 pm Iustin Pop

Fix unittests

The recent OpResult and CPU values additions broke unittests.

8c4c6a8a 07/07/2009 12:56 pm Iustin Pop

Export more stats in hspace

This patch changes Cluster.totalResources to compute more resources and
prints them in hspace.

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.

16103319 07/07/2009 11:06 am Iustin Pop

Fix score calculation to work with empty clusters

Currently the cluster score calculation includes an offline instance
percentage, expressed as “offline inst / (offline + online inst)”, which
results in NaN for empty clusters. This patch changes the calculation...

e6f4f05c 07/07/2009 01:22 am Iustin Pop

Optimize the Utils.stdDev function

This patch optimizes the stdDev function in two respects:
- first, we don't do sum . map which builds an intermediate list, but
instead use a fold over the list to build incrementally the sum;
this should reduce both the time and space characteristics, as we...

d71d0a1d 07/07/2009 12:24 am Iustin Pop

Take the foldl out of Loader.fixNodes

Currently Loader.fixNodes is foldl' with a complicated function. It
makes more sense to take foldl' out of this function (and put it into
the caller) and let fixNodes be only this internal function.