Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti @ 61bbbed7

# Date Author Comment
61bbbed7 11/16/2011 03:16 pm Agata Murawska

htools: change behaviour for offline instances

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

8a8ed513 11/16/2011 03:16 pm Agata Murawska

htools: remove 'running' from instance options

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

7dd14211 11/16/2011 03:15 pm Agata Murawska

htools: change runSt type to InstanceStatus

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

3771d104 11/16/2011 03:15 pm Agata Murawska

htools: create InstanceStatus ADT

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

5f828ce4 10/26/2011 05:35 pm Agata Murawska

Generalize the generation of ADT from raw types

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

260d0bda 10/26/2011 05:35 pm Agata Murawska

Luxi support for Query status in htools

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

e86f7f65 10/14/2011 01:37 pm Iustin Pop

Further cleanup in hspace

This moves the checking of results from the allocation functions to a
separate function, so that we have less code duplication. It also does
a bit of simplification in the printing functions.

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

5296ee23 10/14/2011 01:37 pm Iustin Pop

A bit of cleanup in hspace

The node offline/mcpu is identical to hbal's setNodesStatus, so let's
move that to CLI.hs and reuse it in hspace (also, rename it and drop
one 's').

Also, the check for the number of nodes is obsolete, as we compute
that from the disk template....

7eda951b 10/14/2011 01:37 pm Iustin Pop

Add a type synonym for the allocation function sig

Both iterateAlloc and tieredAlloc share the same signature, but it's
not documented nor exported (needed for refactoring).

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

d12f50b2 10/14/2011 01:37 pm Iustin Pop

htools: Simplify Luxi query results parsing

The logic is not entirely correct—the new Query interface exports the
field status, and we don't use that yet. But the new code should be
more readable.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

b20cbf06 10/14/2011 01:37 pm Iustin Pop

Adjust htools code to new Luxi argument format

This partially undoes commit 92678b3, more specifically it removes the
Store data type and the associated code, since all Luxi arguments are
now lists.

Furthermore, since the qfilter field on Query is complex (it's...

00976304 10/12/2011 02:51 pm Michael Hanselmann

Merge branch 'devel-2.5'

  • devel-2.5:
    rpc: Disable HTTP client pool and reduce memory consumption
    Preserve bridge MTU in KVM ifup script
    hail: Fix result for node evacuation
    Fix assertion error on unclean master shutdown

Signed-off-by: Michael Hanselmann <>...

5b0ac1a5 10/12/2011 02:35 pm Michael Hanselmann

Merge branch 'stable-2.5' into devel-2.5

  • stable-2.5:
    rpc: Disable HTTP client pool and reduce memory consumption
    hail: Fix result for node evacuation
    Fix assertion error on unclean master shutdown

Signed-off-by: Michael Hanselmann <>...

2e5c33db 10/12/2011 02:01 pm Iustin Pop

Rename filter and filter_ to qfilter

We currently use 'filter' as the OpCode, QueryRequest and RAPI field
name for representing a query filter. However, since 'filter' is a
built-in function, we actually have to use filter_ throughout the code
in order to not override the built-in function....

92678b3c 10/12/2011 11:47 am Iustin Pop

Haskell support for generic Query in Luxi

Untill now htools did not have support for generic Query in Luxi. This
patch introduces Query as a supported Luxi operation and replaces
QueryNodes, QueryInstances and QueryGroups with Query.

Signed-off-by: Agata Murawska <>...

9d74cb04 10/12/2011 11:47 am Agata Murawska

TH simplification for Luxi

This patch simplifies the generation of save constructors for LuxiOp
by always using showJSON over an array of JSValues, instead of having
to pass showJSON in most cases, except the 5-tuple case.

Signed-off-by: Agata Murawska <>...

05ff7a00 10/12/2011 10:49 am Agata Murawska

Dots in docstings and hlint error fixes for htools

Signed-off-by: Agata Murawska <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

e19ee6e4 10/11/2011 11:25 am Iustin Pop

Remove the oneline output option in hbal

This was, AFAIK, never used, and complicates the output code enough
that it's better to remove it.

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

5dad2589 10/11/2011 11:24 am Iustin Pop

Rework/split hbal's main function

This is just moving code around. A subsequent patch will do a bit more
cleanup and changing the output.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

60de49c3 10/11/2011 11:23 am Iustin Pop

Skip application of 'id' in TH code

This is just beautification when dumping splices to stdout, as ghc
will optimise the 'id' away anyway.

Original generate code:

opToArgs QueryTags kind name = J.showJSON (id kind, id name)

Afterwards:

opToArgs QueryTags kind name = J.showJSON (kind, name)...
1ab94e48 10/07/2011 01:00 pm Michael Hanselmann

hail: Fix result for node evacuation

According to the iallocator documentation the “node-evacuate” call needs
to return a list of jobs, not a list of lists of jobs.

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

a0090487 10/06/2011 11:21 am Agata Murawska

Use TemplateHaskell to create LUXI operations

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

53664e15 10/03/2011 12:17 pm Iustin Pop

Some TH simplifications

Now that the basic code works, let's use some aliases for simpler code
and less ))))))))).

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

72bb6b4e 10/03/2011 12:17 pm Iustin Pop

A few minor test improvements

This patch adds a few niceties to the test suite:

- allows matching test groups case insensitive and emit warnings when
we give test group names that don't match anything
- add a new operator that is similar to assertEqual in Python: it...

23fe06c2 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell to decorate tests with names

This makes error message change from "Test 4 failed …" to "Test
prop_Loader_mergeData failed", which is much more readable. It also
removes the duplication of test suite names in the test.hs file.

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

12c19659 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell to generate opcode serialisation

This replaces the hand-coded opcode serialisation code with
auto-generation based on TemplateHaskell.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

6111e296 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell to build the opID function

This replaces the hand-coded opID with one automatically generated
from the constructor names, similar to the way Python does it, except
it's done at compilation time as opposed to runtime.

Again, the code line delta does not favour this patch, but this...

e9aaa3c6 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell instead of hand-coded instances

This patch replaces the current hard-coded JSON instances (all alike,
just manual conversion to/from string) with auto-generated code based
on Template Haskell
(http://www.haskell.org/haskellwiki/Template_Haskell)....

2c9336a4 10/03/2011 12:17 pm Iustin Pop

Rename some helper functions for consistency

This changes the names for some helper functions so that future
patches are touching less unrelated code. The change replaces
shortened prefixes with the full type name.

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

f047f90f 10/03/2011 12:16 pm Iustin Pop

Split part of Utils.hs into JSON.hs

Utils is a bit big, let's split the JSON stuff (not all of it) into a
separate module that doesn't have any other dependencies.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

b8a2c0ab 09/29/2011 10:16 am Iustin Pop

Add an allocation limit to hspace

This is very useful for testing/benchmarking.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

1bf6d813 09/29/2011 10:16 am Iustin Pop

Small simplification in tryAlloc

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

b0631f10 09/29/2011 10:16 am Iustin Pop

Change how node pairs are generated/used

Currently, the node pairs used for allocation are a simple [(primary,
secondary)] list of tuples, as this is how they were used before the
previous patch. However, for that patch, we use them separately per
primary node, and we have to unpack this list right after generation....

f828f4aa 09/29/2011 10:15 am Iustin Pop

Parallelise instance allocation/capacity computation

This patch finally enables parallelisation in instance placement.

My original try for enabling this didn't work well, but it took a
while (and liberal use of threadscope) to understand why. The attempt...

d7339c99 09/29/2011 10:15 am Iustin Pop

Abstract comparison of AllocElements

This is moved outside of the concatAllocs as it will be needed in
another place in the future.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

129734d3 09/29/2011 10:14 am Iustin Pop

Change type of Cluster.AllocSolution

Originally, this data type was used both by instance allocation (1
result), and by instance relocation (many results, one per
instance). As such, the field 'asSolutions' was a list, and the
various code paths checked whether the length of the list matches the...

2ef8013f 09/23/2011 02:04 pm Iustin Pop

hspace: add short forms for the group policy

This adds a shortened versions of the allocation policies, as writing
out the whole name in the command line can become tedious.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

1c7c4578 09/22/2011 12:44 pm Iustin Pop

htools: add a MonadPlus instance for Result

This will be used to implement more easily 'choice' parsing of input
data, without resorting to syntax (case … of Bad _ -> …).

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

6804faa0 09/14/2011 05:42 pm Iustin Pop

htools: remove dead code

The tryEvac/evacuateInstance functions are no longer used in the new
multi-group world order, so we remove them and change the unit-test to
test the actual IAllocator function.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

7073b3a8 09/14/2011 05:42 pm Iustin Pop

hail: don't select the primary as new secondary

This just adds the primary node of the instance as 'non-allocable'
during the choosing of the new secondary.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

f25508be 09/14/2011 05:42 pm Iustin Pop

hail: add an extra safety check in relocate

If we select the primary as new secondary, better to fail than return
wrong data to Ganeti.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

88df1fa9 08/08/2011 12:29 pm Iustin Pop

Revert deprecation of evacuate mode in hail

As discussed offline, the new node-change mode could be used for
evacuation, but it's not directly useful as it returns a list of
opcodes; therefore, we need to partially revert commits fbe5fcf and
5b53ca7 that removed it (and multi-evacuate, which remains removed)....

97da6b71 07/22/2011 02:33 pm Iustin Pop

htools: rework the algorithm for ChangeAll mode

I think I've identified the problem with the current ChangeAll
mode. The current algorithm works as follows:

- identify a new primary by choosing the node which gives best score
as new secondary
- failover to it...

77ecfa82 07/22/2011 01:53 pm Iustin Pop

htools: replace two hardcoded uses of pri+sec nodes

These two cases use explicit uses of primary and secondary nodes with
Instance.allNodes, which means the code is more flexible if the
internal layout of the instance changes.

I've verified that the output of involvedNodes is not required to be...

bbe9758d 07/22/2011 01:53 pm Iustin Pop

htools: add target_node member to migrate opcode

… and failover too. Not many changes otherwise except for
serialisation and unittests.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

10f055ac 07/22/2011 01:53 pm Iustin Pop

htools: do not change node disk for non-local storage

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

8353b5e1 07/22/2011 01:53 pm Iustin Pop

htools: add more functions for local disk storage

These will be used in Node.hs for proper add/remove instance
code. Furthermore, we restrict the movable status to the right disk
templates only, so that we don't attempt to move the 'wrong' instance
types....

0047d4e2 07/21/2011 02:52 pm Iustin Pop

htools: add two more small unittests

This adds tests for the opToResult and eitherToResult functions from
Types.hs, and changes two other tests for the same module to test JSON
serialisation (which automatically also tests the lower-level to/from
string conversion functions)....

1b0a6356 07/21/2011 02:51 pm Iustin Pop

htools: a few more hlint fixes

Tested only on GHC 7.x, will test on 6.1x too before commit.

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

179c0828 07/21/2011 02:50 pm Iustin Pop

htools: further docstring fixes

This adds parameter documentation for Cluster.iMoveToJob (I think it
was not clear if the new or old node list is needed) and fixes other
docstring style issues.

After this patch, all modules except for CLI.hs (which has many...

9f8b97ce 07/21/2011 02:50 pm Iustin Pop

htools: add JSON instance for EvacMode

This abstracts the JSON parsing of the type EvacMode near its
definition, and simplifies its conversion in IAlloc.parseData.

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

375969eb 07/21/2011 02:49 pm Iustin Pop

htools: add human-readable output to hspace

Currently, hspace can only output a machine-readable format that
(while detailed) is hard to parse quickly by people. This patch adds
(and enables by default) a human-readable output that shows the most
important metrics in a simple format....

6a5e7dbe 07/21/2011 02:38 pm Iustin Pop

Fix job constants use in htools

Commit 56c094b4 added use of job constants, but I didn't pay
attention and ended up mixing things: job constants were used for
opcode ones, and the job ones didn't get converted.

This patch corrects it and uses only C.* constants throughout the Jobs...

47099cd1 07/21/2011 02:20 pm Michael Hanselmann

Rename *_STATUS_WAITLOCK to …_WAITING

This patch renames the {JOB,OP}_STATUS_WAITLOCK constants to {JOB,OP}_STATUS_WAITING, as per design document for chained jobs.

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

4938fa30 07/20/2011 05:44 pm Guido Trotter

Do proper name lookup for the -O option

hspace and hbal treat -O differently, and use aliases for short names
(although hbal succeeds in that, and hspace doesn't). Uniform this with
a name lookup, using the same functions we used for instance
selection/exclusion....

519edd9f 07/19/2011 06:17 pm Iustin Pop

htools: add a machine-readable CLI flag

This will be used in hspace to toggle between "human" readable
and machine readable output formats.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

756df409 07/19/2011 05:54 pm Iustin Pop

htools: move tiered spec map helper to Hspace.hs

This is used just in hspace, so let's help in making Cluster.hs
smaller. We also split the function in two, as computing the spec map
and formatting it are two different tasks.

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

33b9d92d 07/19/2011 05:54 pm Iustin Pop

htools: import the program modules in QC.hs

This adds the binaries code to the coverage, and thus the coverage
finally shows the real coverage over all logic code (except for the
htools.hs code, which is not logic code related to the algorithms, so
it doesn't matter — plus it's also very small)....

1494a4cc 07/19/2011 05:54 pm Iustin Pop

htools: switch hspace to the generic binary

This is the last patch of the binaries conversion.

As information, we now have a single binary that is approx. 5.4MiB in
size, compared to 4 binaries that were approx. 5.1-5.2MiB in size;
this will result in a smaller package and install size, and the single...

7b695a0d 07/19/2011 05:54 pm Iustin Pop

htools: switch hscan to the generic binary

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

201b6c34 07/19/2011 05:54 pm Iustin Pop

htools: switch hbal to the generic binary

In addition, the patch adds a separate Makefile variable for holding
the binary roles to make it more clear what we symlink.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

458a286a 07/19/2011 05:54 pm Iustin Pop

htools: switch hail to the generic binary

This converts the first binary to the generic 'htools' binary.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

1adec4be 07/19/2011 05:12 pm Iustin Pop

htools: add a compatibility module

When compiling with the parallel-3.x library, we get a deprecation
warning, which makes understanding any other error messages
harder. This patch adds a compatibility module that will hold such
code for transitioning libraries....

a5f248ac 07/19/2011 05:12 pm Iustin Pop

htools: remove no-longer-needed tryMG* functionality

… which was deprecated by the previous patch.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

fbe5fcf6 07/19/2011 05:12 pm Iustin Pop

htools: remove ialloc/relocate and multi-evacuate

Since the new node-evacuate mode does both their work and also
supports better multi-group clusters (including handling split
instances).

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

a86fbf36 07/19/2011 05:12 pm Iustin Pop

htools: fix potential bug in ialloc/change-group

Currently, the ChangeAll mode of nodeEvac computes the primary group
of the instance and then uses the resulting group index for computing
the group score. However, during the change-group operation (which...

96a12113 07/18/2011 06:33 pm Iustin Pop

htools: run IAllocator input through checkData

As the IAllocator backend is using a different data path than the
others, it doesn't get the full functionality that loadExternalData
does. This results in the current situation where checkData is not run
on the input cluster state, which means the node memory properties are...

8cd36391 07/18/2011 06:28 pm Iustin Pop

htools: abstract a function for displaying warnings

This will make it possible to reuse this in IAllocator too.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

f9283686 07/18/2011 06:27 pm Iustin Pop

htools: return the final instance map in ialloc

Similar to the previous patch, this returns the final instance map
from the iallocator run, which will allow saving the cluster state for
further examination/post-processing.

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

ce6a0b53 07/18/2011 10:30 am Iustin Pop

htools: implement post-alloc cluster status display

This patch changes the IAllocator result formatting workflow to return
the final node list, which can be then used to display the final node
status too—currently only the initial status can be shown, which is...

4036f63a 07/15/2011 06:56 pm Iustin Pop

htools: return new state from new IAllocator modes

The old modes already return the node list (as part of AllocSolution),
this patch makes the new modes provide this new information.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

5440c877 07/15/2011 06:56 pm Iustin Pop

htools: update the node-evac/change-group result

… per the new design changes. This also requires changes to
updateEvacSolution, as passing in the original instance is not
helpful; we just pass the instance index now and look up the actual
instance in the modified instance map....

d254d6ce 07/15/2011 04:29 pm Iustin Pop

htools: add function for getting all nodes of an instance

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

20b376ff 07/15/2011 04:25 pm Iustin Pop

htools: add change-group IAllocator mode

This builds a lot upon the node-evacuation mode, and its
implementation is therefore quite easy (once node-evac was added).

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

d72ff6c3 07/15/2011 04:24 pm Iustin Pop

htools: add group restrictions to findBestAllocGroup

While a normal multi-group allocation doesn't need to restrict the
list of target groups beyond the unallocable status of some groups,
when we relocate instances from one group to the other we need to
limit the subset of searched groups....

c9a9b853 07/15/2011 04:13 pm Iustin Pop

htools: generalise and rename availableLocalNodes

Currently this function works in the context of an instance, computing
its local group nodes. We can use generalise it to take a group index
argument, so that it's not bound to an instance, and we rename it...

57f07ff2 07/15/2011 04:12 pm Iustin Pop

htools: add ChangeGroup to IAllocator types/loader

This patch updates the types and functions in IAllocator.hs and
Loader.hs to the new design changes (elimination of multi-relocate
mode and replacement with change-group).

It also removes an extra re-export of EvacMode from Loader.hs....

8fd09137 07/15/2011 04:10 pm Iustin Pop

htools: split tryMGAlloc in two

Currently, this function does both identify the best group for an
instance, and format the results (partially). The former functionality
is useful in other contexts too, so let's split the function in two.

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

d52d41de 07/15/2011 04:10 pm Iustin Pop

htools: add node-evacuation of DRBD all nodes

This is much more complicated than either change primary (which is
trivial) and change secondary (which is also simple).

The main strategy is:

- choose a new secondary (that will become the final primary) and...

b4bae394 07/15/2011 04:00 pm Iustin Pop

htools: small optimisation in Cluster.collapseFailures

This makes fewer temporary data structures, and thus brings a bit of
improvement in total runtime.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

8f48f67d 07/15/2011 03:59 pm Iustin Pop

htools: add optional limit to allocation count

Currently, the tieredAlloc/iterateAlloc functions will not return
until the allocation fails; this means unit-testing their
functionality (e.g. that an instance can be allocated) is slow, since
they will allocate all possible instances....

db56cfc4 07/15/2011 03:33 pm Iustin Pop

htools: add node-evacuation of DRBD secondaries

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

9bb5721c 07/15/2011 03:32 pm Iustin Pop

htools: rework compCV so that we can use [Node] too

In some cases, we have a [Node.Node] list, instead of a Node.List
structure. Instead of converting [Node.Node] to the latter, let's
rework compCV and add a compCVNodes such that we skip this
(potentially expensive) step....

3158250d 07/14/2011 01:14 pm Iustin Pop

Fix htool unittest failure due to invalid prereqs

Currently, the test prop_Node_rMem does some reserved memory checks on
nodes, and for the test to work correctly (can add more instances) we
require that the node free memory is greater than zero via a
prerequisite....

bef83fd1 07/14/2011 12:05 pm Iustin Pop

htools: add node-evacuate of DRBD8 primaries

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

47eed3f4 07/14/2011 12:05 pm Iustin Pop

htools: add more IAlloc data types and functions

These move the 'not supported' message deeper into the workflow;
assuming that the workflow as added by this patch is correct, all that
remains is:

- for disk template DRBD8, plug in the currently existing mechanisms...

a30b473c 07/14/2011 12:05 pm Iustin Pop

htools: add two monad-conversion utility functions

For monadic operations, these function will make it easier to convert
other monads (or monad-like structure) to our 'Result' type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

63a78055 07/14/2011 12:05 pm Iustin Pop

htools: add a function for computing evacuated nodes

The new IAllocator interface is based on instances, not nodes, so we
need to backtrack and compute on which nodes we can't allocate
instances during the current operation. This patch adds a function for...

97936d51 07/14/2011 12:05 pm Iustin Pop

htools: rename an internal constant

'emptySolution' is fine while we have only one Solution type
(AllocSolution), but in the future we'll introduce another one and
thus we should rename it.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

1f4ae205 07/14/2011 12:05 pm Iustin Pop

htools: abstract and simplify a multigroup function

In the future, this 'split/associated instance idx list' functionality
will be used by other code, so let's move it to its own code.

The new method of computing the split also requires exporting one more...

247f77b7 07/14/2011 12:05 pm Iustin Pop

hspace: add support for units in the options

This patch converts hspace to allow units in all disk and memory
specifications, and updates the man page accordingly. It also correct
a mistake in the man page for the --max-cpu option.

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

1cb92fac 07/14/2011 12:05 pm Iustin Pop

htools: add parseUnit function

This is similar, but not identical, to Utils.ParseUnit. The biggest
difference is that we don't round up/down; as we only use integral
types, the result will always be rounded down.

Moreover, since (real-world) disk sizes come in SI units, the function...

22fac87d 07/13/2011 07:45 pm Guido Trotter

htools: simplify select tests

Rather than running all possible tests in one go, split them out in
three cases: "normal", undefined default value, undefined list values
(both of which require a valid response before them).

Signed-off-by: Guido Trotter <>...

424ec11d 07/13/2011 05:09 pm Guido Trotter

htools: lookup instance names in select/exclude

Currently we just match the passed name with fqdns. With this change we
do a proper search for either the fqdn or the initial name component, as
in Ganeti itself.

Signed-off-by: Guido Trotter <>...

efe98965 07/13/2011 04:52 pm Guido Trotter

htools: infrastructure for looking up names

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

bfe6c954 07/13/2011 04:52 pm Guido Trotter

htools: Add if' and select as functions

if' is just a functional version of the if-then-else construct. Using it
we can manipulate ifs as functions, and also build other functionality.

select allows to choose a result depending on truth value of statements,...

043a3929 07/13/2011 01:46 pm Iustin Pop

htools: remove obsolete option INodes

hspace no longer uses it, hence it can be removed.

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

a10a476a 07/13/2011 01:45 pm Iustin Pop

htools: add an utility function for disk templates

In the future we'll use this instead of requiring the number of nodes
from the user.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

c4bb977b 07/13/2011 01:44 pm Iustin Pop

htools: define the --disk-template option

Also sorts the export list correctly.

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

6429e8d8 07/13/2011 01:40 pm Iustin Pop

htools: read/save the disk template in Text backend

This requires that we change the signature of loadInst in order to
properly annotate the error messages, which in turn requires more
unittest changes.

Also, this invalidates yet again saved data files…...