Statistics
| Branch: | Tag: | Revision:

root / Ganeti / HTools @ f5ed8632

# Date Author Comment
f5ed8632 11/24/2010 03:55 pm Iustin Pop

Luxi: read the node uuid from the cluster

This makes the code incompatible with Ganeti pre-2.4.

Signed-off-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>

a68004b7 11/24/2010 03:55 pm Iustin Pop

Node: add the node group's UUID

This is not used anywhere yet, and the backend are all just adding the
default UUID, not the real one.

The patch also allows displaying the group UUID in the node list.

Signed-off-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>

9b9da389 11/24/2010 03:54 pm Iustin Pop

Utils: add a default UUID

This will be used as a placeholder for the cases when we need a UUID
(any UUID), but we don't have one handy.

Signed-off-by: Iustin Pop <>
Reviewed-by: Balazs Lecz <>

a3e8da03 11/23/2010 04:46 pm Iustin Pop

Merge branch 'devel-0.2' into master

7570569e 11/23/2010 12:58 pm Iustin Pop

Improve the standard deviation computation

This does just two passes, instead of three, over the list. This reduces
the overall runtime well enough (~25%) in some tests, but it's not
reproducible using profiling, so I don't know how much the function
itself is being sped-up....

5e718042 11/19/2010 01:35 pm Iustin Pop

Simu loader: move the loading to non-IO code

While we don't actually have IO code in the Simu loader, we do have the
same interface. So we move the code again to a separate parseData
function which is exported.

b3f0710c 11/19/2010 01:08 pm Iustin Pop

Luxi loader: split parsing from loading

748bfcc2 11/19/2010 01:06 pm Iustin Pop

Rapi loader: split parsing from loading

The change is similar to the text loader change.

dadfc261 11/19/2010 01:00 pm Iustin Pop

Text loader: split parsing from loadData

This change, which will be followed by similar changes in the other
loaders, splits the parsing of the data from the actual loading from
disk. Since the parsing doesn't usually involve IO actions, we will be
able to better test the parsing. The loading becomes a smaller part of...

9d775204 11/11/2010 01:02 pm Iustin Pop

Ignore nodes which are not vm_capable

This break compatibility with Ganeti pre-2.3.

306cccd5 11/09/2010 09:37 am Iustin Pop

Fix tag exclusion weight

Currently, the tag exclusion metric has a weight of one, which means
there might be cases where we won't move instances around because it
upsets the cluster metrics. However, we do want to make a higher effort
for cleaning up tag collisions, so we increase the weight to an...

e3ae9508 10/07/2010 03:42 pm Iustin Pop

Fix some warnings in unittests

03c6d8fa 10/06/2010 03:56 pm Iustin Pop

Improve the error message for tiered alloc option

848b65c9 09/03/2010 06:02 pm Iustin Pop

Use the mingain options in the balancing algorithm

Also adds them in hbal.

4f807a57 09/03/2010 03:35 pm Iustin Pop

Add new CLI options for min gain during balancing

Recent hbal seems to run many steps for small improvements (< 1e-3), so
we should stop early in this case.

We add a new option (-g), that will be used for the minimum gain during
balancing. This check will only become active when the cluster score is...

adc5c176 09/02/2010 03:43 pm Iustin Pop

Add some more debugging functions

These are just variations of the standard debug, but are provided for
simpler code, since lazyness is something causing non-computation of
debug statements.

74e89a14 09/02/2010 03:43 pm Iustin Pop

Fix ReplaceSecondary moves for offline nodes

The addition of a new secondary on a node is doing two memory tests:
- in strict mode, reject if we get into N+1 failure
- reject if the new instance memory is greater than the free memory (not
available memory) on the node...

94d08202 08/30/2010 12:12 pm Iustin Pop

Change iterateAlloc to return the instance list

The Cluster.iterateAlloc and tieredAlloc functions are changed to also
return the updated instance list, since it is needed to have a “full”
cluster view.

4a273e97 08/30/2010 12:12 pm Iustin Pop

Abstract the cluster serialization from hscan.hs

This is currently hardcoded in an internal function in hscan.hs, and we
move it to Text.hs for later use.

02da9d07 08/25/2010 07:40 pm Iustin Pop

Add a new option --save-cluster

This option will in the future be used to serialize the cluster state in
hbal and hspace after the rebalance/allocation steps.

50811e2c 08/25/2010 07:04 pm Iustin Pop

Add unittest for Node text serialization

This checks that the Node text serialization and deserialization
operations are idempotent when combined other.

a070c426 08/25/2010 06:53 pm Iustin Pop

Switch unittest to custom hostnames

Currently, the hostnames are almost fully arbitrary chars, which breaks
the assumption that nodes/instances will be normal DNS hostnames.

This patch adds some custom generators for these hostnames, that will
allow better testing of text loader serialization/deserialization.

3bf75b7d 08/24/2010 07:30 pm Iustin Pop

Move text serialization functions to Text.hs

Currently these are in hscan, and cannot be reused easily.

0ca66853 07/27/2010 09:44 pm Iustin Pop

hail: fix error message for failed multi-evac

Currently we show the instance index, but this makes no sense outside
the current running program. Instead, we show the instance name.

b8262965 07/22/2010 04:57 pm Iustin Pop

Fix another haddock issue

691dcd2a 07/22/2010 06:03 am Iustin Pop

Remove an obsolete function and add Utils tests

223dbe53 07/22/2010 01:42 am Iustin Pop

Add some more imports to QC.hs

This is needed so that in the coverage report we list all modules, even
the ones we don't test at all, such that we get the complete results.

c3c7a0c1 07/22/2010 01:42 am Iustin Pop

Change the meaning of the N+1 fail metric

Currently, this metric tracks the nodes failing the N+1 check. While
this helps (in some cases) to evacuate such nodes, it's not a good
metric since rarely it will change during a step (only at the last
instance moving away). Therefore we replace it with the count of...

8a3b30ca 07/22/2010 01:42 am Iustin Pop

Introduce per-metric weights

Currently all metrics have the same weight (we just sum them together).
However, for the hard constraints (N+1 failures, offline nodes, etc.)
we should handle the metrics differently based on their meaning. For
example, an instance living on a primary offline node is worse than an...

2cae47e9 07/22/2010 01:42 am Iustin Pop

Allow balancing moves to introduce N+1 errors

This patch switches the applyMove function to the extended versions of
Node.addPri and addSec, and passes the override flag based on the state
of the node that we're moving away from.

3e3c9393 07/22/2010 01:42 am Iustin Pop

Introduce a relaxed add instance mode

In case an instance is living on an offline node, it doesn't make sense
to refuse moving it because that would create N+1 failures; failing N+1
is still much better than not running at all. Similarly, if the
secondary node of an instance is offline, meaning the instance doesn't...

2849670b 07/19/2010 02:20 pm Iustin Pop

Remove obsolete Container.maxNameLen

This was only used in one place (hbal), and is obsolete by the change to
the dual name/alias structure.

14c972c7 07/19/2010 02:20 pm Iustin Pop

hbal: print short names in steps list

This was a regression from the name handling changes, as we started
using the original names for the solution list (which is not designed
for parsing/feeding back into ganeti).

fb33aaaf 07/19/2010 02:20 pm Iustin Pop

Remove an obsolete function

printSolution is no longer used, as we print the solution iteratively
now.

6dfa04fd 07/19/2010 12:13 am Iustin Pop

Allow '+' in node list fields

When the field list is prefixed with a plus sign, this will extend the
default field list, instead of replacing it entirely.

16f08e82 07/19/2010 12:13 am Iustin Pop

Update the node list fields

This patch renames the pri/sec to pcnt/scnt, and adds the real primary
and secondary instance lists, the peermap and the index of a node as
selectable options.

124b7cd7 07/19/2010 12:13 am Iustin Pop

Cleanup a node's peer map when possible

If the last secondary instance of a peer is deleted (detected by the new
peer memory value being equal to zero), then the pair (pdx, 0) should be
deleted completely. This is not optimization per se, but rather cleanup...

95446d7a 06/21/2010 12:12 pm Iustin Pop

Fix another haddock special-char issue

db079755 06/21/2010 05:59 am Iustin Pop

Remove JOB_STATUS_GONE and add unittests

… for the serialization/deserialization of the job and opcode status.

Job status 'gone' was not actually used. It can be reintroduced if
needed.

4a007641 06/03/2010 12:08 am Iustin Pop

Fix some lint errors in the unit tests

683b1ca7 06/02/2010 11:55 pm Iustin Pop

Change the Luxi operations structure

Currently, we define the LuxiOp type as a simple enumeration, and leave
the arguments structure to the users of the Ganeti.Luxi module. This is
suboptimal for a couple of reasons: first, we decouple the operation
type from operation arguments, and that means we don't use the type...

9c0a748f 06/01/2010 11:51 pm Iustin Pop

Fix a warning in Loader tests

Incomplete pattern match…

c088674b 06/01/2010 08:54 pm Iustin Pop

Add a few Loader tests

These are not comprehensive, but at least we have a start.

9e35522c 05/28/2010 12:13 pm Iustin Pop

Reduce the warnings during the unittests

Since the unittests are not 'clean' from the p.o.v. of type
declarations, and cannot be made clean in all respects (e.g. orphan
instances), we silence some warnings for the test target, to have a
cleaner output.

88f25dd0 05/28/2010 12:25 am Iustin Pop

Introduce OpCode unittests

f36a8028 05/28/2010 12:00 am Iustin Pop

Introduce suport for optional keys in JObjects

Some keys are optional in the Ganeti opcodes (e.g. ‘node’ in the
OpReplaceDisks), and as such we need to transform them in a Maybe value,
instead of failing.

The patch reworks a bit fromObj and adds maybeFromObj which parses such...

c96d44df 05/27/2010 11:37 pm Iustin Pop

Replace fromJResult with annotateJResult

This patch removes all old uses of fromJResult with the annotated
version, and removes the non-annotated version. All JSON parsing points
should now have annotated errors.

c8b662f1 05/27/2010 11:32 pm Iustin Pop

Add annotations to loadJSArray

This allows, for example, the RAPI backend to detail which information
(instance or node data) fails to parse.

50d26669 05/27/2010 11:23 pm Iustin Pop

Change fromObj error messages

Currently fromObj doesn't detail what we're trying to read, which can
lead to cryptic messages: "Cannot read Int". The patch changes this
function to annotate the error messages with the key/value we're trying
to convert, by using a new version of fromJResult....

82ea2874 05/27/2010 01:11 am Iustin Pop

A few more small Node unit-tests

39d11971 05/25/2010 08:17 pm Iustin Pop

Add more unittests

Instance, Node and Text modules have improved coverage.

3fea6959 05/20/2010 07:45 pm Iustin Pop

Add more unit tests for allocation/balance

The patch adds some simple unit-tests for both the allocation function
(we can allocate small instances on an empty cluster, we can allocate in
tiered more starting from any size) and the balancing functions (one...

3ce8009a 05/20/2010 01:31 pm Iustin Pop

Move two functions from hspace to Cluster.hs

This is done so we can test a longer pipeline.

8423f76b 05/20/2010 01:31 pm Iustin Pop

Make CStats instance of show

This helps debugging via ghci.

381be58a 05/20/2010 12:19 pm Iustin Pop

Another haddoc fix…

c854092b 05/20/2010 12:07 pm Iustin Pop

Accept both full and short names in CLI

This patch introduces some new functionality in the base Element type
and in Container which supports searching for all 'known' names of an
element, such that both short and full names are accept for various
options like '-O' and '--excluded-instances'.

3e4480e0 05/20/2010 12:07 pm Iustin Pop

Stop modifying names for internal computations

Currently the name used internally is modified and holds the shortened
name of the nodes/instances. This has caused issues before, since we
always have to strip the suffix from input data and reapply it if we...

8bcdde0c 05/20/2010 12:07 pm Iustin Pop

Add a new node/instance field

This new field ('alias') will hold the shortened/beautified display
name. When resetting the name, the alias is reset too, and there's a new
function to update only the alias.

49f9627a 05/20/2010 12:07 pm Iustin Pop

Change some test constants

First, we reduce the max size of the disks, since Int on 32bits will
overflow for big simulated clusters. This is a real issue, that will
need fixing in real life, but for now we just "silence" this test.

Second, we increase the amount of time a test is allowed to run,...

3ed46bb7 05/19/2010 04:28 pm Iustin Pop

Fix some haddock comments

8fcf251f 05/19/2010 04:09 pm Iustin Pop

Add more unit tests

This increases the overall coverage by 5%-10% (depending on coverage
type). Some modules are still not unittested at all, as HUnit is a
better choice for them.

1e3dccc8 05/19/2010 04:08 pm Iustin Pop

Shuffle some constants around

… and export more functions. This will help with unit testing.

f4c0b8c5 05/18/2010 07:31 pm Iustin Pop

Remove the noLimit values and always use limits

This patch moves from allowing no-limits for disk/cpu ratios, and always
use a real limit. For disk, it's simple since we use 0, which means no
reservations for disks. For CPU, we set an (arbitrary) limit of 64 v/p,...

e2436511 05/04/2010 02:42 pm Iustin Pop

Fix hspace's KM metrics

We returned the KM_POOL_* metrics as the final state, not as the delta
between the final and the initial state.

e87a419f 04/15/2010 05:16 pm Iustin Pop

Fix Node hiCpu computation

In case we're not enabling limits, let's restrict this to -1, instead of
-1 times the number of pcpus.

9b8fac3d 04/15/2010 12:50 pm Iustin Pop

Add a new function to compute allocation deltas

Given two cluster states, the new function can answer the following
questions:

- how much resources currently allocated
- how much resources finally allocated (delta from above is how much we
can actually allocate on the cluster)...

86ecce4a 04/15/2010 12:27 pm Iustin Pop

Introduce total vcpu tracking in CStats

We add a new field that tracks the available virtual cpus (expressed as
node cpus times the vcpu ratio).

bfefb674 04/14/2010 03:44 pm Iustin Pop

Merge branch 'master' into next

  • master:
    Fix iallocator crash when no solutions exist
    Fix IAllocator multi-evacuate message
57587760 03/31/2010 12:54 pm Iustin Pop

Fix iallocator crash when no solutions exist

Commit 5436576 added an un-guarded `head' call, which crashes with
“Prelude.head: empty list” when no results exists for the per-instance
allocation/relocation calls.

This patch fixes this, and also adds another check for an unguarded...

934c62dc 03/31/2010 12:51 pm Iustin Pop

Fix IAllocator multi-evacuate message

Since Ganeti passes full host names (not common-suffix-stripped), we
need to remove the suffix from the evac_nodes keys too. In case one node
is not part of the cluster, it will lead to a wrong error message, but
for now it fixes the problem.

e41f4ba0 03/09/2010 04:40 pm Iustin Pop

Fix iallocator crash when no solutions exist

Commit 5436576 added an un-guarded `head' call, which crashes with
“Prelude.head: empty list” when no results exists for the per-instance
allocation/relocation calls.

This patch fixes this, and also adds another check for an unguarded...

be811997 02/26/2010 03:42 pm Iustin Pop

Fix a haddock comment issue

For some versions of haddock, this can create problems.

a46f34d7 02/25/2010 03:47 pm Iustin Pop

Abstract instance running states into a list

This removes some manual checks from a few places in the code with a
single list defined once.

5182e970 02/25/2010 03:39 pm Iustin Pop

A number of small fixes from hlint

c939b58e 02/25/2010 02:35 pm Iustin Pop

Fix unused-do-binds for ghc 6.12

GHC 6.12 has some new warnings, which are valid in most cases except
(IMHO) printf usage.

0903280b 02/25/2010 02:34 pm Iustin Pop

Fix unused imports for ghc 6.12

GHC 6.12 has become more picky about unused imports, so we need to
remove/tighten some of them.

ba9349b8 02/23/2010 07:10 pm Iustin Pop

hscan: implement LUXI backend scanning

This allows hscan to work also with NO_CURL (but only for the local
machine, of course).

5ab2b771 02/23/2010 02:53 pm Iustin Pop

Loader: abort for unknown to-be-excluded instances

c424cdc8 02/23/2010 02:13 pm Iustin Pop

balance function: use the movable flag directly

Instead of deciding based on secondary node, use the new flag.

39f979b8 02/23/2010 02:09 pm Iustin Pop

Update the loader pipeline to set the movable flag

This updates the movable flag on instances if they have only one node
(we don't rely on OpMoveInstance) or if they are set so via the command
line options.

This doesn't yet enable the use of the new flag.

a182df55 02/23/2010 01:56 pm Iustin Pop

Add a 'movable' flag on instances

This will be used instead of checking for no secondary and for
simplifying 'do not touch' instances.

10f396e1 02/23/2010 11:40 am Iustin Pop

Add an option for excluding instances from moves

54365762 02/22/2010 04:19 pm Iustin Pop

Implement IAllocator node evacuate request

This patch adds the new request loading/execution (trivial), but the
actual response formatting becomes more difficult as now the response
type differs by request.

Signed-off-by: Iustin Pop <>

12b0511d 02/22/2010 04:19 pm Iustin Pop

Add a tryEvac function

This will be used by the node evacuate IAllocator request type.

Signed-off-by: Iustin Pop <>

1fe81531 02/22/2010 04:19 pm Iustin Pop

Move a type declaration to Node.hs

We'll need AllocElement in both Cluster and IAlloc in the future, so we
move it to Node.hs which is imported by both.

Signed-off-by: Iustin Pop <>

23f9ab76 02/22/2010 04:19 pm Iustin Pop

Change an internal type from Maybe to list

In preparation for multiple responses, we change from Maybe to List
(both used in the container sense).

This allows us to keep the same workflow for all kind of requests.

Signed-off-by: Iustin Pop <>

20c891d0 02/22/2010 04:19 pm Iustin Pop

IAllocator: move some keys into per-request data

Since not all structures will have these keys in the future, we move
them into per-structure keys.

Signed-off-by: Iustin Pop <>

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

f0f21ec4 02/22/2010 03:50 pm Iustin Pop

Add an evac mode CLI option

Signed-off-by: Iustin Pop <>

df18fdfe 02/22/2010 03:50 pm Iustin Pop

Reorder options in CLI.hs

This should be no code change, just reordering of the options.

Signed-off-by: Iustin Pop <>

146b37eb 02/03/2010 01:29 pm Iustin Pop

Fix secondary node selection for existing N+1

In case a secondary node is already N+1 failed, currently the node
selection will accept a node that cannot start (at all) the new instance
as valid. This is wrong, so we add a new simple check to prevent the...

a4a6e623 02/03/2010 10:24 am Iustin Pop

Rewrite the node add checks for simpler layout

This will make it clearer than many if…then choices.

a804261a 01/14/2010 06:38 pm Iustin Pop

Move instance relocation test upper in the chain

Currently we test each instance for relocation in checkMove; however, it
is a little more clear if we pass only the relocatable instances to
checkMove. The patch also slightly rewrites (indendation/style) the...

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

71e635f3 01/12/2010 12:18 pm René Nussbaumer

Fixing a typo in option description

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

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

f5197d89 01/07/2010 12:44 pm Iustin Pop

Change the signatures of the text loader slightly

This is in preparation for the text format changes.

0c860cff 12/11/2009 07:01 pm Iustin Pop

Convert n1_score metric from % to count

This increases the priority of fixing N+1 failures compared to balancing
metrics.

8ce618f3 12/11/2009 06:54 pm Iustin Pop

Merge branch 'master' into next

  • master:
    Use the oper_ram field if available
    rapi, luxi: treat drained nodes as offline
673f0f00 12/11/2009 06:47 pm Iustin Pop

Metric: count of primary instances/offline nodes

This helps with evacuation/failover of instances on 2-node clusters with
one one offline.