ganeti-local
14 years agoAdd support for building without curl
Iustin Pop [Mon, 28 Sep 2009 12:47:18 +0000 (14:47 +0200)]
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
ghc run it through cpp first; and based on whether ‘NO_CURL’ is defined
or not, this toggles RAPI/curl inclusion. The patch also removes the
import of Rapi in QC.hs since it's not actually used in tests.

Invoking make as ‘make HEXTRA=-DNO_CURL’ is enough to trigger the new
build mode.

14 years agoSplit the exernal data loader out of CLI.hs
Iustin Pop [Mon, 28 Sep 2009 12:33:02 +0000 (14:33 +0200)]
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
deals with file I/O doesn't link against these libraries.

14 years agoFix luxi recvMsg for messages bigger than 4K
Iustin Pop [Wed, 2 Sep 2009 22:54:26 +0000 (23:54 +0100)]
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.

14 years agoTest some cases for the cluster score computation
Iustin Pop [Mon, 31 Aug 2009 22:53:24 +0000 (23:53 +0100)]
Test some cases for the cluster score computation

14 years agoAdd some more instance tests
Iustin Pop [Mon, 31 Aug 2009 22:22:47 +0000 (23:22 +0100)]
Add some more instance tests

This include instance text load tests.

14 years agoSplit the balancing algorithm in two parts
Iustin Pop [Sun, 30 Aug 2009 15:55:49 +0000 (17:55 +0200)]
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
got a good result, etc.) into Cluster.hs, and leaves only the iteration
and screen update in hbal.hs.

14 years agoImplement support for 'cheap' moves only
Iustin Pop [Wed, 26 Aug 2009 08:04:38 +0000 (10:04 +0200)]
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.

14 years agoSimplify the wrapIO function
Iustin Pop [Wed, 26 Aug 2009 07:45:41 +0000 (09:45 +0200)]
Simplify the wrapIO function

This fixes one warning from hlint.

14 years agoUse migrate or failover based on instance state
Iustin Pop [Wed, 26 Aug 2009 07:40:36 +0000 (09:40 +0200)]
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.

Of course, the right fix would be for Ganeti to accept a
migrate-or-failover opcode that atomically does the move…

14 years agoUpdate NEWS file for the 0.1.6 release htools-v0.1.6
Iustin Pop [Wed, 19 Aug 2009 10:51:06 +0000 (12:51 +0200)]
Update NEWS file for the 0.1.6 release

14 years agoImprove the error message for command line errors
Iustin Pop [Wed, 19 Aug 2009 11:02:52 +0000 (13:02 +0200)]
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.

14 years agoAdd a simulated cluster data loader
Iustin Pop [Tue, 18 Aug 2009 16:07:54 +0000 (18:07 +0200)]
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.

14 years agoFix a typo in hbal.hs
Guido Trotter [Thu, 4 Jun 2009 12:55:53 +0000 (13:55 +0100)]
Fix a typo in hbal.hs

Signed-off-by: Guido Trotter <ultrotter@google.com>

15 years agoCLI: Handle error better
Iustin Pop [Wed, 15 Jul 2009 17:22:44 +0000 (19:22 +0200)]
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.

15 years agoUnify the command line options and structures
Iustin Pop [Wed, 15 Jul 2009 08:31:51 +0000 (10:31 +0200)]
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.

15 years agoDocument the --vcpus option to hspace
Iustin Pop [Tue, 14 Jul 2009 14:17:26 +0000 (16:17 +0200)]
Document the --vcpus option to hspace

15 years agoFix a few hlint errors
Iustin Pop [Tue, 14 Jul 2009 14:15:25 +0000 (16:15 +0200)]
Fix a few hlint errors

15 years agoMan page updates
Iustin Pop [Tue, 14 Jul 2009 14:01:38 +0000 (16:01 +0200)]
Man page updates

This patch beautifies the man pages for hbal and hspace.

15 years agoCLI: Prevent incompatible options to be selected
Iustin Pop [Tue, 14 Jul 2009 14:00:48 +0000 (16:00 +0200)]
CLI: Prevent incompatible options to be selected

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

15 years agoUpdate documentation for the new luxi backend
Iustin Pop [Tue, 14 Jul 2009 13:17:32 +0000 (15:17 +0200)]
Update documentation for the new luxi backend

15 years agoAdd support for luxi backend in CLI/hspace/hbal
Iustin Pop [Tue, 14 Jul 2009 13:04:47 +0000 (15:04 +0200)]
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
for enabling Luxi.

15 years agoInitial commit of the luxi backend
Iustin Pop [Tue, 14 Jul 2009 12:01:51 +0000 (14:01 +0200)]
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
per-recv/send-call one
  - the failure reporting is not as good as it could be

15 years agoIntroduce timeout in RAPI queries
Iustin Pop [Tue, 14 Jul 2009 09:58:22 +0000 (11:58 +0200)]
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.

15 years agoUpdate NEWS file for the 0.1.5 release htools-v0.1.5
Iustin Pop [Thu, 9 Jul 2009 13:54:51 +0000 (15:54 +0200)]
Update NEWS file for the 0.1.5 release

This is basically a hspace release, so the changelog is small.

15 years agoFix a haddoc issue
Iustin Pop [Thu, 9 Jul 2009 13:58:23 +0000 (15:58 +0200)]
Fix a haddoc issue

15 years agohspace: fix failure handling of tryAlloc results
Iustin Pop [Thu, 9 Jul 2009 13:16:46 +0000 (15:16 +0200)]
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
Cluster.hs

15 years agoChange the tryAlloc/tryReloc workflow
Iustin Pop [Thu, 9 Jul 2009 12:44:24 +0000 (14:44 +0200)]
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
solution, it means that we're using lots of heap space to compute and
store node lists which are thrown away at the end of the step.

This patch changes these two functions and their callers in hail/hspace
to only return the best solution, and error/success counters. This
allows hspace to run in a much smaller space, and reduces GC cost
greatly.

Overall, it is a cleanup, as hail/hspace did a lot of work to chose this
best solution, whereas now it's automatically promoted within
Cluster.concatAllocs.

15 years agoSimplify the Cluster.tryAlloc structures
Iustin Pop [Wed, 8 Jul 2009 17:11:45 +0000 (19:11 +0200)]
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,
    so even though we don't use more than their names, it's logically
    broken
  - we do an extra unpack/repack of the result, while we could simply
    pass it through if allocateOnX returned the correct result

This patch makes the allocateOnX functions return the node list too and
also removes them and applyMove from the export list, as these are only
used within Cluster.hs.

15 years agoSlight change to the internal allocation results
Iustin Pop [Wed, 8 Jul 2009 16:38:12 +0000 (18:38 +0200)]
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
harder to add other elements depending on the success/failure (like the
score for the new node list).

This patch moves the OpResult to outside of the tuple, in effect making
all these ‘OpResult (…)’ which makes the internal tuple elements
consistent. The patch is affecting the applyMove, tryAlloc and
tryRealloc functions, and only briefly the hail and hspace programs.

15 years agoAdd a 'tags' makefile target
Iustin Pop [Wed, 8 Jul 2009 16:25:36 +0000 (18:25 +0200)]
Add a 'tags' makefile target

This uses hasktags for building emacs TAGS.

15 years agohspace: switch output to shell-script format
Iustin Pop [Wed, 8 Jul 2009 14:34:46 +0000 (16:34 +0200)]
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.

15 years agohspace: move instance count and score into CStats
Iustin Pop [Wed, 8 Jul 2009 09:49:17 +0000 (11:49 +0200)]
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
removes special printing in hspace.

15 years agoFix unittests
Iustin Pop [Tue, 7 Jul 2009 16:10:18 +0000 (18:10 +0200)]
Fix unittests

The recent OpResult and CPU values additions broke unittests.

15 years agoExport more stats in hspace
Iustin Pop [Tue, 7 Jul 2009 09:09:09 +0000 (11:09 +0200)]
Export more stats in hspace

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

15 years agoShow errors on stderr instead of stdout
Iustin Pop [Tue, 7 Jul 2009 08:32:52 +0000 (10:32 +0200)]
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.

15 years agoFix score calculation to work with empty clusters
Iustin Pop [Tue, 7 Jul 2009 08:01:30 +0000 (10:01 +0200)]
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
such that clusters with no offline instances (this criteria includes
completely empty clusters) get a score of zero on this component of the
total score.

15 years agohspace: convert N1 error exit into FailN1 result
Iustin Pop [Mon, 6 Jul 2009 15:58:14 +0000 (17:58 +0200)]
hspace: convert N1 error exit into FailN1 result

Currently hspace exits with an error if the cluster is not N+1 compliant
at the beginning of the run. This patch changes hspace such that this
condition is instead treated as a zero-allocation-possible, FailN1 mode.
This allows the same stats to be reported in this case as in the normal
case.

15 years agoSome docstring updates
Iustin Pop [Mon, 6 Jul 2009 14:46:51 +0000 (16:46 +0200)]
Some docstring updates

15 years agohspace: add display of instance spec
Iustin Pop [Mon, 6 Jul 2009 14:40:01 +0000 (16:40 +0200)]
hspace: add display of instance spec

This is mostly for user-friendliness in the default mode, when we don't
specify the instance parameters.

15 years agoOptimize the Utils.stdDev function
Iustin Pop [Mon, 6 Jul 2009 22:20:41 +0000 (00:20 +0200)]
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
have fewer objects created
  - second, we move from “a ^ 2” to “a * a” as the latter has a much
simpler implementation and thus a higher performance

Since the ‘square’ function is obsoleted by the above the patch also
removes it.

15 years agoTake the foldl out of Loader.fixNodes
Iustin Pop [Mon, 6 Jul 2009 21:24:14 +0000 (23:24 +0200)]
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.

15 years agoSimplify Cluster.computeMoves
Iustin Pop [Mon, 6 Jul 2009 21:13:15 +0000 (23:13 +0200)]
Simplify Cluster.computeMoves

This patch changes the function Cluster.computeMoves to use guards and a
couple of subexpressions in order to greatly simplify it.

15 years agoFix hlint-generated warnings
Iustin Pop [Mon, 6 Jul 2009 20:50:18 +0000 (22:50 +0200)]
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
files. The individual changes are also small enough as to be visually
easy to confirm.

15 years agoAdd computation of the failure reason in hspace
Iustin Pop [Sun, 5 Jul 2009 15:56:10 +0000 (18:56 +0300)]
Add computation of the failure reason in hspace

This patch enhances hspace to report why the allocation sequence
stopped, both in absolute error count and for the top reason.

15 years agoReturn correct failure data from Node.add*
Iustin Pop [Sun, 5 Jul 2009 13:09:43 +0000 (16:09 +0300)]
Return correct failure data from Node.add*

This patch alters the Node.addPri/addSec to return correct failure data.
It removes the computeFailN1 function from the module as that used to
combine both mem and disk checks in the same function and thus the real
error reason cannot be deduced when using it.

15 years agoIntroduce a new type for allocation results
Iustin Pop [Sun, 5 Jul 2009 12:53:40 +0000 (15:53 +0300)]
Introduce a new type for allocation results

Currently the allocation/move operations workflow return ‘Maybe a’,
which is very convenient but loses all details about the failure mode.

This patch introduces a new data type which encodes the specific failure
mode. It is not yet used correctly (e.g. all node operations result in
FailN1), but the workflow is updated. Most of the changes are in the
hail/hspace tools, the library code required only trivial adjustments.

15 years agoRemove hn1 and related code
Iustin Pop [Sun, 5 Jul 2009 12:21:56 +0000 (15:21 +0300)]
Remove hn1 and related code

hn1 was deprecated for a while and this patch removes it altogether. The
support code in Cluster.hs is also removed.

15 years agoDisplay two more stats in hspace
Iustin Pop [Fri, 3 Jul 2009 19:40:35 +0000 (22:40 +0300)]
Display two more stats in hspace

This adds two new stats - sum of reserved ram and disk.

15 years agoFix totalResources avail disk computation
Iustin Pop [Fri, 3 Jul 2009 18:37:51 +0000 (21:37 +0300)]
Fix totalResources avail disk computation

This uses the newly-added Node.availDisk to compute the actual available
disk correctl, and display the total allocatable disk in hspace.

15 years agoAdd an availDisk node function
Iustin Pop [Fri, 3 Jul 2009 17:22:06 +0000 (20:22 +0300)]
Add an availDisk node function

This function returns the amount of available disk, which depends on
whether a low disk limit has been configured or not and on the free disk
space of the node.

15 years agoAdd two new autocomputed vars to Nodes
Iustin Pop [Fri, 3 Jul 2009 17:02:48 +0000 (20:02 +0300)]
Add two new autocomputed vars to Nodes

Currently we track the max disk usage/max vcpus as percentages, however
sometimes it's easier to check against minimum free disk or maximum
number of cpus, as units instead of percentages.

This patch adds two new variables, lo_dsk, hi_cpu, which are recomputed
whenever we change the m_dsk/m_cpu 'master' values.

15 years agoAdd a new type for cluster statistics
Iustin Pop [Thu, 2 Jul 2009 21:50:50 +0000 (23:50 +0200)]
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
its return type. This simplifies its callers while complicating only a
little the computation of the stats.

15 years agoEnhance hspace resource display
Iustin Pop [Thu, 2 Jul 2009 10:43:33 +0000 (12:43 +0200)]
Enhance hspace resource display

The display of cluster resources is extracted into a separate function
and enhanced to display more stats.

15 years agoAdd display of more stats in hspace
Iustin Pop [Thu, 2 Jul 2009 10:33:06 +0000 (12:33 +0200)]
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.

15 years agoUpdate NEWS file for the 0.1.4 release htools-v0.1.4
Iustin Pop [Tue, 16 Jun 2009 09:50:30 +0000 (11:50 +0200)]
Update NEWS file for the 0.1.4 release

15 years agoFix a haddock/docstring issue
Iustin Pop [Tue, 16 Jun 2009 09:52:09 +0000 (11:52 +0200)]
Fix a haddock/docstring issue

15 years agoFix some hscan bugs
Iustin Pop [Fri, 12 Jun 2009 22:58:33 +0000 (00:58 +0200)]
Fix some hscan bugs

Currently hscan has a number of bugs:
  - doesn't add the common suffix (csf) to the instance's nodes
  - doesn't export the cpus for neither nodes nor instances
  - doesn't support single-node instances

This patch fixes these issues.

15 years agoSome documentation updates for the new parameters
Iustin Pop [Fri, 12 Jun 2009 21:50:07 +0000 (23:50 +0200)]
Some documentation updates for the new parameters

15 years agoAdd cpu/disk limits in hbal
Iustin Pop [Fri, 12 Jun 2009 21:33:02 +0000 (23:33 +0200)]
Add cpu/disk limits in hbal

15 years agoAdd setting of node limits in hspace
Iustin Pop [Fri, 12 Jun 2009 00:17:09 +0000 (02:17 +0200)]
Add setting of node limits in hspace

15 years agoImplement cpu/disk limits in instance moves
Iustin Pop [Fri, 12 Jun 2009 00:12:27 +0000 (02:12 +0200)]
Implement cpu/disk limits in instance moves

We modify Node.addPri/addSec to take into account the limits on instance
adds.

15 years agoAdd two new node attributes
Iustin Pop [Thu, 11 Jun 2009 23:47:27 +0000 (01:47 +0200)]
Add two new node attributes

Two new min disk free ratio and max cpu usage attributes are added to the
nodes. These will be used in the future to restrict allocation.

15 years agoFix 'unused X' warnings
Iustin Pop [Thu, 11 Jun 2009 23:29:31 +0000 (01:29 +0200)]
Fix 'unused X' warnings

This removes some unused functions and imports to cleanup the warnings.

15 years agoFix the various monomorphism warning
Iustin Pop [Thu, 11 Jun 2009 23:22:20 +0000 (01:22 +0200)]
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).

15 years agoSmall changes to the node list output
Iustin Pop [Thu, 11 Jun 2009 22:12:40 +0000 (00:12 +0200)]
Small changes to the node list output

This is just some cleanup of the node list output, adding pcpu/vcpu
counters, and making the display slightly nicer.

15 years agoAdd cpu ratio to cluster calculation
Iustin Pop [Wed, 10 Jun 2009 21:17:40 +0000 (23:17 +0200)]
Add cpu ratio to cluster calculation

15 years agoUpdate cpu counters correctly after pinst changes
Iustin Pop [Wed, 10 Jun 2009 20:37:34 +0000 (22:37 +0200)]
Update cpu counters correctly after pinst changes

The cpu counters are update on primary instance adds/removes.

15 years agoAdd cpu-count-related attributes to nodes
Iustin Pop [Wed, 10 Jun 2009 20:29:22 +0000 (22:29 +0200)]
Add cpu-count-related attributes to nodes

This patch adds cpu-count related attributes to nodes:
  - total cpus
  - cpus in use
  - ratio of virtual:physical cpus

We also set correctly the cpu values at load time, but we don't do
anything yet while moving instances around. The cpu ratio is shown in
the cluster list.

15 years agoAdd a new vcpus attribute to instances
Iustin Pop [Wed, 10 Jun 2009 19:42:45 +0000 (21:42 +0200)]
Add a new vcpus attribute to instances

This patch adds reading of vcpu count for instances, in preparation for
using the vcpu ratio in cluster scoring.

15 years agoFix reading of total disk space in iallocator
Iustin Pop [Wed, 10 Jun 2009 19:31:05 +0000 (21:31 +0200)]
Fix reading of total disk space in iallocator

IAllocator currently uses a wrong key name for reading the total disk
space (‘disk_usage’ which was copied from RAPI, but the actual
iallocator key is ‘disk_space_total’).

This patch fixes that and also makes iallocator always use this key,
instead of computing the size by itself—with Ganeti 2.0 this is
key is always available.

15 years agoUpdate NEWS and README for the 0.1.3 release htools-v0.1.3
Iustin Pop [Fri, 5 Jun 2009 10:13:20 +0000 (12:13 +0200)]
Update NEWS and README for the 0.1.3 release

Small updates to the documentation and make a new small release.

15 years agoFix the ReplacePrimary instance move
Iustin Pop [Thu, 4 Jun 2009 13:32:59 +0000 (15:32 +0200)]
Fix the ReplacePrimary instance move

During a replace-primary instance move, on the real cluster the instance
is temporarily started on the secondary, and as such we must check that
the secondary node can hold it for this duration. Currently the code
does not, and depending on cluster scoring it will put instances on such
'bad' secondaries (usually without enough memory).

This patch fixes this by adding/removing the instance as a primary on
the secondary node; and then using the result node as the new secondary.
(Since we're in a monad, we could have just tried the allocation and
dropped the result, but this is more clear).

15 years agoUpdate NEWS file for the 0.1.2 release htools-v0.1.2
Iustin Pop [Tue, 2 Jun 2009 06:44:59 +0000 (08:44 +0200)]
Update NEWS file for the 0.1.2 release

15 years agoUpdate the README file with hspace informations
Iustin Pop [Mon, 1 Jun 2009 20:15:34 +0000 (22:15 +0200)]
Update the README file with hspace informations

15 years agoFix hspace with plain type instances
Iustin Pop [Mon, 1 Jun 2009 14:21:51 +0000 (16:21 +0200)]
Fix hspace with plain type instances

This also fixes other required node numbers.

15 years agoAdd a man page for hspace
Iustin Pop [Mon, 1 Jun 2009 14:05:58 +0000 (16:05 +0200)]
Add a man page for hspace

15 years agoRework the tryAlloc/tryReloc functions
Iustin Pop [Mon, 1 Jun 2009 13:48:44 +0000 (15:48 +0200)]
Rework the tryAlloc/tryReloc functions

Currently tryAlloc/tryReloc do not return the new instance, as this is
not needed for IAllocator alloc/reloc requests. However, for computing
the space, the new instance is useful, so we modify these functions to
return this information too.

The patch also improves hspace to have (with default parameters) a
parseable output.

15 years agoAdd an utility function for triples
Iustin Pop [Mon, 1 Jun 2009 13:48:18 +0000 (15:48 +0200)]
Add an utility function for triples

15 years agoInitial add of the hspace tool
Iustin Pop [Mon, 1 Jun 2009 11:59:02 +0000 (13:59 +0200)]
Initial add of the hspace tool

This is a tool that checks how many instances (of same size, specified
by command line arguments) can be added to a cluster while remaining N+1
compliant.

15 years agoSmall doc change
Iustin Pop [Mon, 1 Jun 2009 11:44:53 +0000 (13:44 +0200)]
Small doc change

And an alignment issue.

15 years agoEnsure consistent naming of the tools
Iustin Pop [Mon, 1 Jun 2009 10:25:46 +0000 (12:25 +0200)]
Ensure consistent naming of the tools

This patch makes sure that all references to the name of the software is
ganeti-htools, not simply htools.

15 years agoSmall documentation update
Iustin Pop [Mon, 1 Jun 2009 10:16:21 +0000 (12:16 +0200)]
Small documentation update

15 years agoAdd copyright/license information
Iustin Pop [Mon, 1 Jun 2009 09:55:48 +0000 (11:55 +0200)]
Add copyright/license information

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

15 years agotests: move the test declaration in QC.hs
Iustin Pop [Mon, 1 Jun 2009 09:24:27 +0000 (11:24 +0200)]
tests: move the test declaration in QC.hs

This patch moves the test declaration into QC.hs, so that test.hs has to
be modified only when we add a new test category.

15 years agoSmall whitespace change
Iustin Pop [Sun, 31 May 2009 20:28:12 +0000 (22:28 +0200)]
Small whitespace change

15 years agoMove some alloc functions from hail into Cluster
Iustin Pop [Sun, 31 May 2009 20:22:53 +0000 (22:22 +0200)]
Move some alloc functions from hail into Cluster

These are generic enough to be used from multiple places, they belong
better in Cluster.hs than in the hail source.

15 years agoMove the RqType and Request types to Loader.hs
Iustin Pop [Fri, 29 May 2009 18:02:19 +0000 (20:02 +0200)]
Move the RqType and Request types to Loader.hs

These two will be more generic than now, and belong somewhere else -
Loader.hs is a generic module for data loading, thus we move them there.

15 years agoCleanup an old function
Iustin Pop [Fri, 29 May 2009 17:53:04 +0000 (19:53 +0200)]
Cleanup an old function

Also replace a type with its synonim.

15 years agoLots of documentation updates
Iustin Pop [Fri, 29 May 2009 17:25:34 +0000 (19:25 +0200)]
Lots of documentation updates

This patch does only doc build changes, doc changes and function move
around (for more logical documentation). It should have no impact at all
on the code.

15 years agoChange the check rule in Makefile
Iustin Pop [Fri, 29 May 2009 08:42:01 +0000 (09:42 +0100)]
Change the check rule in Makefile

Since ghc won't trigger recompilation due to the -fhpc flag, it's not
useful to rm && make test, as this will only relink the binary.
Therefore we simplify this rule.

15 years agoA simple test for Container.addTwo
Iustin Pop [Wed, 27 May 2009 22:36:40 +0000 (23:36 +0100)]
A simple test for Container.addTwo

15 years agoAdd some very trivial Instance tests
Iustin Pop [Wed, 27 May 2009 22:10:14 +0000 (23:10 +0100)]
Add some very trivial Instance tests

This is more of an exercise in QuickCheck than strong testing.

15 years agoFinish removal of unused params from PeerMap
Iustin Pop [Wed, 27 May 2009 21:50:22 +0000 (22:50 +0100)]
Finish removal of unused params from PeerMap

This completes the removal started earlier byt removeing the need to
pass the number of nodes to Node.buildPeers, which is now unused.

15 years agoAdd test infrastructure and initial tests
Iustin Pop [Wed, 27 May 2009 21:22:38 +0000 (22:22 +0100)]
Add test infrastructure and initial tests

This patch adds a QuickCheck-based test infrastructure and initial tests
based on it. The PeerMap module has a 100% coverage ☺

Side-note: one has to read the source of QuickCheck to see how to use it
(especially the Batch submodule), the docs are not enough…

15 years agoSome cleanup of the PeerMap module
Iustin Pop [Wed, 27 May 2009 20:50:02 +0000 (21:50 +0100)]
Some cleanup of the PeerMap module

This patch removes some unused functions and does some cleanup of the
remaining ones.

15 years agoRemove unused parameters from PeerMap creation
Iustin Pop [Wed, 27 May 2009 20:09:47 +0000 (21:09 +0100)]
Remove unused parameters from PeerMap creation

We remove some unused arguments (added way back for compatibility with
Arrays, which we didn't use in the end). This makes the code clearer
(and doesn't need the Ndx type to be an instance of Num).

15 years agoRemove an unused type synonim
Iustin Pop [Wed, 27 May 2009 20:01:20 +0000 (21:01 +0100)]
Remove an unused type synonim

15 years agoAdd a separate function for looking up instances
Iustin Pop [Wed, 27 May 2009 19:53:51 +0000 (20:53 +0100)]
Add a separate function for looking up instances

Currently we (wrongly) use lookupNode to lookup instances, just because
the name assoc list has the same type. This patch adds a separate
function for it.

15 years agoAdd type synonyms for the node/instance indices
Iustin Pop [Wed, 27 May 2009 19:25:09 +0000 (20:25 +0100)]
Add type synonyms for the node/instance indices

This is a first step towards full datatype renaming. That requires more
changes, so at first we only want to document clearly what is a node
index, what is an instance index, and what is a plain Int.

15 years agoChange the module import hierarchy
Iustin Pop [Tue, 26 May 2009 23:17:36 +0000 (00:17 +0100)]
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.