ganeti-local
12 years agoFix a docstring in bdev's DRBD8 class
Iustin Pop [Mon, 16 Jul 2012 11:51:20 +0000 (13:51 +0200)]
Fix a docstring in bdev's DRBD8 class

It seems this was not updated since the move to static minors…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoExtend the Template Haskell loadFn model
Iustin Pop [Mon, 16 Jul 2012 11:37:09 +0000 (13:37 +0200)]
Extend the Template Haskell loadFn model

Currently, we only allow field-by-field de-serialisation. Since we
have cases where information about how to un-serialise a field is
split across two JSON fields (e.g. disk type and disk logical_id,
hypervisor and hvparams, etc.), we need to pass the entire object to
custom read functions.

Furthermore, since we will have to generate two actual fields from the
single in-memory field, we need to extend the custom save function so
that they can generate additional fields beyond the "main" field value
they currently generate.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoChange how customFields are built
Iustin Pop [Mon, 16 Jul 2012 11:31:18 +0000 (13:31 +0200)]
Change how customFields are built

Instead of passing an expression (which cannot come from the current
module), we pass a name, which is allowed to reference functions from
the module we're in. Since we currently don't have custom fields, we
don't need to modify any callers.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoImplement lookup of partial names in Config.hs
Iustin Pop [Wed, 18 Jul 2012 09:31:39 +0000 (11:31 +0200)]
Implement lookup of partial names in Config.hs

This uses the recently-moved functions to implement partial lookup of
names on getNode and getInstance, similar to the Python codebase.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoReorganise the lookup functions
Iustin Pop [Wed, 18 Jul 2012 09:03:31 +0000 (11:03 +0200)]
Reorganise the lookup functions

Currently, the LookupResult, MatchPriority and related functions are
locate in Loader.hs, since (so far) only hbal needs them in the
selection of instances. However, with the new functionality on confd
side, we need these functions there too, but we don't want to import
Loader.hs (which pulls in lots of balancing-related code). So we move
all these function to BasicTypes.hs, since that module is a leaf one,
with no other dependencies.

Unittests are slightly adjusted (but they are still tested under the
'Loader' group).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoRemove an unused function
Iustin Pop [Mon, 16 Jul 2012 11:30:04 +0000 (13:30 +0200)]
Remove an unused function

This is not used, as we need a more complex serialisation, which is
done in the saveObjectField function.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoEnsure that disk.params is always defined (and a dict)
Iustin Pop [Wed, 18 Jul 2012 12:18:12 +0000 (14:18 +0200)]
Ensure that disk.params is always defined (and a dict)

Commit cce46164 fixed upgrading from other 2.6 versions, but
accidentally broke upgrading from 2.5 (disk.params was left as None,
which breaks FillDict). The simplest way to handle params is to always
set them to an empty dict (disregarding what they currently contain).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAnother small consistency fix with if branches
René Nussbaumer [Wed, 18 Jul 2012 11:34:36 +0000 (13:34 +0200)]
Another small consistency fix with if branches

While looking at the testability of this piece of code, I found another
consistency problem. We have two if branches instead of one, with
elif's.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix inconsistency in the LUXI protocol w.r.t. args
René Nussbaumer [Wed, 18 Jul 2012 09:13:09 +0000 (11:13 +0200)]
Fix inconsistency in the LUXI protocol w.r.t. args

This inconsistency was found during rebalancing. Hbal failed because,
Ganeti couldn't load the opcode. After digging through the cause, an
inconsistency with the "args" field in the LUXI protocol was triggered
by the TemplateHaskell side where it's done uniformed.

For SubmitJob and SubmitManyJobs we treat args as one argument,
containing the job definition. In every other LUXI call args is actually
a list of arguments. This patch fixes this consistency.

This change is NOT backwards compatible.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix UpgradeConfig of Disk object regards disk params
René Nussbaumer [Tue, 17 Jul 2012 08:18:41 +0000 (10:18 +0200)]
Fix UpgradeConfig of Disk object regards disk params

This bug was found during disk parameter debugging. While looking at the
config some values seem present on the disk parameters, but that's not
expected behaviour. This patch fixes this, and also fixes the "broken"
configs automatically upon masterd restart.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMake Ganeti 2.6.0 rc3 release v2.6.0rc3
René Nussbaumer [Fri, 13 Jul 2012 11:46:34 +0000 (13:46 +0200)]
Make Ganeti 2.6.0 rc3 release

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAllow reinstall even when secondaries are offline
René Nussbaumer [Wed, 11 Jul 2012 12:29:06 +0000 (14:29 +0200)]
Allow reinstall even when secondaries are offline

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoPrepare NEWS file for Ganeti 2.6.0 rc3
René Nussbaumer [Wed, 11 Jul 2012 11:38:34 +0000 (13:38 +0200)]
Prepare NEWS file for Ganeti 2.6.0 rc3

Update NEWS regarding rc3 fixes and document changes in behaviour.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoQA updated to test instance removing when sec. is offline
Agata Murawska [Mon, 9 Jul 2012 10:49:52 +0000 (12:49 +0200)]
QA updated to test instance removing when sec. is offline

Added test checking that it is possible to remove an instance with drbd
disk when non-primary node is offline.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoIgnore offline node errors when removing disks
Agata Murawska [Mon, 9 Jul 2012 09:00:53 +0000 (11:00 +0200)]
Ignore offline node errors when removing disks

When we delete DRBD disks from some instance, we do not want to get
errors due to nodes other than that instance's primary being offline.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAllow instance disc activation with offline secondaries
Iustin Pop [Fri, 6 Jul 2012 13:59:19 +0000 (15:59 +0200)]
Allow instance disc activation with offline secondaries

Currently, this is not allowed, so one can't run a replace-disks; this
breaks any non-invasive method of recovering the redundancy of the
instance if its disks are already stopped (but it still works if the
disks on the primary are active). So let's fix this inconsistency.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoRAPI regression beparams/memory fix
René Nussbaumer [Fri, 6 Jul 2012 09:35:24 +0000 (11:35 +0200)]
RAPI regression beparams/memory fix

For compatibility with the old Ganeti version, we want to keep the
beparams/memory field around for another release. This patch fixes this
regression.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix redistribution of files w.r.t. offline nodes
Iustin Pop [Wed, 4 Jul 2012 15:41:01 +0000 (17:41 +0200)]
Fix redistribution of files w.r.t. offline nodes

Currently, _RedistributeAncillaryFiles computes two lists: the list of
online nodes (for all files redistribution), and the list of
vm_capable nodes, for hypervisor-specific files. However, the
vm_capable list includes offline nodes too, leading to warning
messages:

  WARNING: Copy of file /etc/xen/xend-config.sxp to node node13.example.com failed: Node is marked offline

We fix this by trivially intersecting the vm_capable list with the
online one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix cluster verify error on master-ip-setup script
René Nussbaumer [Wed, 4 Jul 2012 11:08:40 +0000 (13:08 +0200)]
Fix cluster verify error on master-ip-setup script

This error does not show up until we exceed the pool of master
candidates and have nodes which are not master candidates.

The background is that we check for master-ip-setup script on master
candidates and expect them not to be on the other nodes. However, we
distribute a default master-ip-script which break this assumption.
Furthermore, there's no reason why the file should just exists on the
master candidates.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAdd a Makefile rule to test unclean git status
Iustin Pop [Sat, 30 Jun 2012 01:25:45 +0000 (18:25 -0700)]
Add a Makefile rule to test unclean git status

This is trivial, but can be used easily from automated builds to check
that the git tree is clean: files are not modified and untracked files
are not present.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoAdd test helpers to .gitignore
Iustin Pop [Sat, 30 Jun 2012 01:17:42 +0000 (18:17 -0700)]
Add test helpers to .gitignore

Commit 3096524e enabled building of test helpers, but forgot to add
them to .gitignore, resulting in "unclean" git status output.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoFix a typo in NEWS
René Nussbaumer [Tue, 3 Jul 2012 11:55:33 +0000 (13:55 +0200)]
Fix a typo in NEWS

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoRelease Ganeti 2.6.0rc2 v2.6.0rc2
René Nussbaumer [Tue, 3 Jul 2012 08:26:03 +0000 (10:26 +0200)]
Release Ganeti 2.6.0rc2

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoPrepare NEWS file for 2.6.0 rc2
René Nussbaumer [Thu, 28 Jun 2012 14:31:42 +0000 (16:31 +0200)]
Prepare NEWS file for 2.6.0 rc2

We are about to release another version of Ganeti 2.6, so we prepare the
NEWS file with the changes from rc1 to rc2.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoUpdate time on Haskell binaries after build
Iustin Pop [Thu, 28 Jun 2012 23:00:03 +0000 (16:00 -0700)]
Update time on Haskell binaries after build

This patch works around an issue in our build system. Since we don't
use cabal or 'ghc -M', we don't track actual dependencies in our
Makefile; this in turn means that editing a file that only is used in
the main 'htools' binary will keep triggering 'ghc --make' for the
hconfd binary; and this actually takes a bit of time to look at all
the dependencies.

So to work around this, we add a touch after each ghc --make, such
that we trigger the unneeded build at most once.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agohcheck: add two simple type aliases for readability
Iustin Pop [Thu, 28 Jun 2012 22:54:36 +0000 (15:54 -0700)]
hcheck: add two simple type aliases for readability

The same types are reused a couple of times, so let's add a couple of
type aliases for easier change later and readability.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agohcheck: rework output mode
Iustin Pop [Thu, 28 Jun 2012 22:48:47 +0000 (15:48 -0700)]
hcheck: rework output mode

Looking at the output of hcheck, in human readable mode, it looks like
it always starts with a blank line. This is not nice, so I wanted to
redo this to start cleanly.

However, looking at the code, I realised that we need some internal
cleanup; 'perGroupChecks' was doing both pure computation (computing
the score/stats) and I/O work (printing the stats), which is ugly, so
I split that in two; this allows perGroupChecks to be simpler, and we
can therefore first compute the group stats, and start the output with
the mode in which we run.

So right now, hcheck will first output whether we need to run a
rebalance, or if no-simulation is selected, etc., and only then
display the actual stats, making the output a bit more consistent.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agohcheck: reword and fix typo in instance/offline msg
Iustin Pop [Thu, 28 Jun 2012 22:44:45 +0000 (15:44 -0700)]
hcheck: reword and fix typo in instance/offline msg

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoAdd hlint warning for wrong use of 'length'
Iustin Pop [Thu, 28 Jun 2012 22:20:05 +0000 (15:20 -0700)]
Add hlint warning for wrong use of 'length'

While removing split instances check from hcheck, I saw a wrong use of
'length': this should only be used when one needs the actual length of
the list, and not when one wants to check whether the list is empty or
not (in that case, 'null' should be used).

To prevent this in the future, let's add a hlint hint for it, and fix
the warning it generates in hbal.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoRemove can_rebalance functionality from hcheck
Iustin Pop [Thu, 28 Jun 2012 22:15:46 +0000 (15:15 -0700)]
Remove can_rebalance functionality from hcheck

Since hbal can now run rebalances even in the presence of split
instances, we can remove this check and always run the rebalance.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoFix building of hcheck man page
Iustin Pop [Thu, 28 Jun 2012 22:10:59 +0000 (15:10 -0700)]
Fix building of hcheck man page

The code used a space, not a tab, in Makefile.am, which means it
actually broke the variable declaring the man pages.

Furthermore, we add some blank lines in the man page, otherwise the
paragraphs will be run-in together.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoFix tiny typo in htools.rst
Iustin Pop [Thu, 28 Jun 2012 21:51:23 +0000 (14:51 -0700)]
Fix tiny typo in htools.rst

Backtracking through git blame, it turns out than commit 49148d15
changed "\fB20,102400,16384,4\fR" into "**B20,102400,16384,4**". But
of course that's a mistake, since the markup was \fB, not just \f.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoAllow param `modify' during gnt-instance modify
Constantinos Venetsanopoulos [Wed, 27 Jun 2012 15:27:28 +0000 (18:27 +0300)]
Allow param `modify' during gnt-instance modify

With the new gnt-instance modify syntax for addition and removal of
disks/NICs on arbitrary indexes, we hit an assertion if the user
passes `modify' as one of the disk's parameters. E.g::

 gnt-instance modify --disk 2:modify,size=3G instance1
 gnt-instance modify --disk 3:add,size=1G,modify instance2

This patch fixes the bug, by allowing `modify' to be passed as a
parameter (as happens with `add' and `remove'), as long as it is
not done alongside `add' or `remove'. If so, it is treated in the
same way as if none of modify/add/remove is passed --> modify.

Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoCorrect a wrong --help option for --simulate
Iustin Pop [Thu, 28 Jun 2012 04:56:11 +0000 (21:56 -0700)]
Correct a wrong --help option for --simulate

This was not update when the alloc policy was added to the parameter.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd a shell test for hbal and split instances
Iustin Pop [Thu, 28 Jun 2012 04:46:13 +0000 (21:46 -0700)]
Add a shell test for hbal and split instances

This is not perfect, as we only test that hbal completes successfully
and that it show a score improvement, but it's better than nothing.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agohbal: relax restrictions on split instances
Iustin Pop [Thu, 28 Jun 2012 00:51:51 +0000 (17:51 -0700)]
hbal: relax restrictions on split instances

The recent patch series on hcheck made me realise how much pain we
have due to hbal not being able to work (at all) with split instances.

This is sub-optimal; ideally, hbal would degrade its behaviour, but
not completely refuse to work. This patch does this, by marking any
split instances as not movable (since such instances most likely mean
that some manual intervention is done on then), but otherwise
proceeding with the rebalance of the selected node group.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd newline at the end of shelltest files
Agata Murawska [Thu, 28 Jun 2012 09:08:43 +0000 (11:08 +0200)]
Add newline at the end of shelltest files

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd forgotten unittest changes for instance_os_add
René Nussbaumer [Thu, 28 Jun 2012 08:24:06 +0000 (10:24 +0200)]
Add forgotten unittest changes for instance_os_add

The previous patch which fixed disk parameters didn't adapt the
unittests so it lead to failing QA.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoAnnotate disk params on instance_os_add
René Nussbaumer [Wed, 27 Jun 2012 12:29:10 +0000 (14:29 +0200)]
Annotate disk params on instance_os_add

We call _OpenRealBD during the process and this needs disk parameters to
work. This was reported by Constantinos.

The fix is very ugly though.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix a few style issue in hcheck
Iustin Pop [Wed, 27 Jun 2012 19:24:15 +0000 (12:24 -0700)]
Fix a few style issue in hcheck

This fixes a couple of issue I've seen while fixing the List import:

- removes over-use of printf with putStr/show
- wraps some lines
- removes superfluous parentheses in constructs like 'IO (a)'
- makes sure that in type signatures, the '->' are placed at the
  beginning, not end of the line

We probably need to update the style guide for some of these…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoFix old-style import
Iustin Pop [Wed, 27 Jun 2012 19:12:38 +0000 (12:12 -0700)]
Fix old-style import

Commit 1213f9d6 (re)added an old-style import, which fails with recent
compilers.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoStyle fix in hcheck
Agata Murawska [Tue, 26 Jun 2012 08:21:47 +0000 (10:21 +0200)]
Style fix in hcheck

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoStyle fixes in shelltests
Agata Murawska [Mon, 25 Jun 2012 15:00:56 +0000 (17:00 +0200)]
Style fixes in shelltests

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoSimplify stats printing
Agata Murawska [Tue, 26 Jun 2012 09:26:00 +0000 (11:26 +0200)]
Simplify stats printing

PrintGroupStats and printClusterStats had very similar code
structure. This patch abstracts those two into printStats, making it
a little more generic. Also, printStats has its arguments documented
as requested in previous patch series.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoCleaner simulation of rebalance
Agata Murawska [Tue, 26 Jun 2012 12:39:36 +0000 (14:39 +0200)]
Cleaner simulation of rebalance

This replaces the 'if .. then .. else ..' with a large block of code in
'else' branch by separating this code into a separate function.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoSmall reordering and renaming in hcheck
Agata Murawska [Tue, 26 Jun 2012 09:21:17 +0000 (11:21 +0200)]
Small reordering and renaming in hcheck

Reordered functions and shortened one function name.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoMove 'need rebalance' check from cluster check
Agata Murawska [Tue, 26 Jun 2012 09:16:10 +0000 (11:16 +0200)]
Move 'need rebalance' check from cluster check

As suggested by Rene, we should keep the check separate from printing.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAlways print all variables in machine readable version
Agata Murawska [Tue, 26 Jun 2012 09:10:55 +0000 (11:10 +0200)]
Always print all variables in machine readable version

As discussed in cover letter of patch series introducing hcheck, in
machine readable version we should always print values of all variables.
When hbal simulation was not run, FINAL values are equal to INIT values.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoPrint idx <-> uuid mappings in machine readable mode
Agata Murawska [Tue, 26 Jun 2012 15:14:07 +0000 (17:14 +0200)]
Print idx <-> uuid mappings in machine readable mode

As per Iustin Pop's suggestion, we are printing group mappings
from group idx (known only to htools) to group uuid, which identifies
the group uniquely. This is required because group uuid and name
may contain characters such as '-' which are not valid parts of
bash variable name.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoHuman readable group name improved
Agata Murawska [Tue, 26 Jun 2012 15:13:32 +0000 (17:13 +0200)]
Human readable group name improved

Instead of printing group id in human readable version of hcheck,
we now print group name.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoPrint info about ability to rebalance
Agata Murawska [Tue, 26 Jun 2012 08:28:24 +0000 (10:28 +0200)]
Print info about ability to rebalance

As suggested during offline discussion, this patch adds a new bash
variable and description field in hcheck, which informs if the
rebalance was possible. This is to determine if there are split
instances on the cluster, in which case rebalance is impossible.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoImprove readability for hcheck-related changes
Agata Murawska [Tue, 26 Jun 2012 08:14:53 +0000 (10:14 +0200)]
Improve readability for hcheck-related changes

As suggested by Rene, I added comments to types for printKeys
and printFinal. Also, realigned some lines in Hspace.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAnnotate disks upon blockdev_shutdown
René Nussbaumer [Tue, 26 Jun 2012 12:28:17 +0000 (14:28 +0200)]
Annotate disks upon blockdev_shutdown

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoAnnotate disks on blockdev_remove
René Nussbaumer [Tue, 26 Jun 2012 12:11:52 +0000 (14:11 +0200)]
Annotate disks on blockdev_remove

This annotates the disks for the blockdev_remove where it is
appropriate. It leaves out 2 cases were we can't reliably annotate disk
parameters due to lack of knowledge what we should annotate. Those cases
affects only lvs used for drbd, so it doesn't affect the bug reported by
Constantinos.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoAnnotate disk params on blockdev_getmirrorstatus_multi
René Nussbaumer [Tue, 26 Jun 2012 11:32:41 +0000 (13:32 +0200)]
Annotate disk params on blockdev_getmirrorstatus_multi

This is also related to the bug reported by Constantinos,
as we've only one getmirrorstatus_multi call in whole cmdlib, we just
annotate them while we are building the disk list.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoAnnotate disk parameters on blockdev_getmirrorstatus
René Nussbaumer [Tue, 26 Jun 2012 11:24:50 +0000 (13:24 +0200)]
Annotate disk parameters on blockdev_getmirrorstatus

Not annotating them works for DRBD but not for RBD as reported by
Constantinos.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoFix for man entry for htools - added hinfo
Agata Murawska [Fri, 15 Jun 2012 14:38:38 +0000 (16:38 +0200)]
Fix for man entry for htools - added hinfo

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFixes in man page for hinfo
Agata Murawska [Thu, 14 Jun 2012 15:31:19 +0000 (17:31 +0200)]
Fixes in man page for hinfo

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years ago Update to the install file - hinotify dependency
Agata Murawska [Thu, 14 Jun 2012 15:24:22 +0000 (17:24 +0200)]
 Update to the install file - hinotify dependency

Hinotify was not marked as a dependency for hconfd.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoRelease Ganeti 2.6.0rc1 v2.6.0rc1
René Nussbaumer [Mon, 25 Jun 2012 13:40:41 +0000 (15:40 +0200)]
Release Ganeti 2.6.0rc1

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoShelltestrunner tests for hcheck
Agata Murawska [Thu, 21 Jun 2012 10:31:24 +0000 (12:31 +0200)]
Shelltestrunner tests for hcheck

Simple tests for hcheck using shelltestrunner. Among other, we check
that we can run hcheck on multi-group cluster.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoMachine readable hcheck functionality
Agata Murawska [Thu, 21 Jun 2012 12:11:02 +0000 (14:11 +0200)]
Machine readable hcheck functionality

Machine readable output for hcheck.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoHuman readable hcheck functionality
Agata Murawska [Thu, 21 Jun 2012 13:09:27 +0000 (15:09 +0200)]
Human readable hcheck functionality

Full hcheck functionality is implemented in this patch. Hcheck runs
per-group checks, provides summary for the entire cluster and simulates
rebalance if required, the printing the modified metrics.
In this patch, only the human-readable output is available.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAllowing rebalance to run silently
Agata Murawska [Wed, 20 Jun 2012 15:00:57 +0000 (17:00 +0200)]
Allowing rebalance to run silently

Part of hcheck's simulation required us to silently run hbal. For that
purpose we expose iterateDepth and allow it to run silently.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoGeneralize functions used by both hspace and hcheck
Agata Murawska [Thu, 21 Jun 2012 12:30:10 +0000 (14:30 +0200)]
Generalize functions used by both hspace and hcheck

As hspace and hcheck both use machine readable options, they require
similar functions - which are now generalized and moved to CLI and
Utils.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoInitial commit for introducting hcheck tool
Agata Murawska [Thu, 14 Jun 2012 15:38:33 +0000 (17:38 +0200)]
Initial commit for introducting hcheck tool

Introduce infrastructure required to add Hcheck and build it
successfuly.

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoNEWS: Improve formatting, wording
Michael Hanselmann [Fri, 22 Jun 2012 15:03:41 +0000 (17:03 +0200)]
NEWS: Improve formatting, wording

Clarify some things, use ```` where appropriate.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoPrepare the update of the NEWS file
René Nussbaumer [Fri, 22 Jun 2012 08:56:28 +0000 (10:56 +0200)]
Prepare the update of the NEWS file

This updates the NEWS file for the upcoming rc1 release.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoExtend burnin to do NIC changes
Iustin Pop [Tue, 19 Jun 2012 17:06:28 +0000 (19:06 +0200)]
Extend burnin to do NIC changes

This would have caught our previous issue, since QA otherwise doesn't
do add, remove or changes of NICs.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix bug in instance net changes
Iustin Pop [Tue, 19 Jun 2012 17:06:27 +0000 (19:06 +0200)]
Fix bug in instance net changes

_PrepareNicModification returns the invalid type, which triggers an
assert resulting in a mysterious error:

Failure: command execution error:

Without any explanation. We fix this by removing the return value from
_PrepareNicModification, and instead returning the expected type
(since it differs per create/modification) from the (existing)
wrappers for this function. We don't need to return actual changes
from this function as _ApplyNicMods is the function that
computes/returns the formatted changes.

Signed-off-by: Iustin Pop <iustin@google.com>
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpdate the hooks documentation
René Nussbaumer [Tue, 19 Jun 2012 14:24:21 +0000 (16:24 +0200)]
Update the hooks documentation

Also provide some extended unittests to catch those cases.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoQA: Fix modification of HV parameters via RAPI
Michael Hanselmann [Tue, 19 Jun 2012 14:51:54 +0000 (16:51 +0200)]
QA: Fix modification of HV parameters via RAPI

This is basically another case of commit d488adb.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agobdev: Fix DRBD error reporting for syncer rate
Michael Hanselmann [Tue, 19 Jun 2012 10:42:55 +0000 (12:42 +0200)]
bdev: Fix DRBD error reporting for syncer rate

The function is supposed to return a list, not a string. Without this
patch the error message ends up as “C, a, n, ', t,  , c, h, a, n, g, e,
…”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix corner case in quick-check generated tests
Iustin Pop [Mon, 18 Jun 2012 15:51:53 +0000 (17:51 +0200)]
Fix corner case in quick-check generated tests

Thanks to Agata Murawska, a random seed that generates bad test cases
was found ("seed was 1768143307 2118231514, test size 74"). This is
due to the fact that some nodes were generated with tMem=0, fMem=0,
which means that pMem was NaN and thus the node was not comparing
equal to itself.

Worked around by limiting the test case generation to nodes with
positive values; a better fix would be to compare nodes differently
(subset of properties or ignore NaN values).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoChange default for DRBD barriers
Michael Hanselmann [Tue, 19 Jun 2012 08:05:03 +0000 (10:05 +0200)]
Change default for DRBD barriers

Commit 8a69b3a8 changed the DRBD barriers disabled by default if
“--disable-drbd-barriers” is used to “bfd”, where “d” stands for
disk-drain. DRBD's upstream updated their documentation[1] to
say disk drains should always be used.

[1] http://git.drbd.org/?p=drbd-8.3.git;a=commit;h=f952dcfed57acf

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix inconsistent punctuation in rapi docs and opcodes
Iustin Pop [Fri, 15 Jun 2012 15:54:44 +0000 (17:54 +0200)]
Fix inconsistent punctuation in rapi docs and opcodes

While reviewing the RAPI docs (for commit 003306f9), I realised that
the punctuation used in RAPI is inconsistent, especially with regards
to definition lists.

This patch changes all such lists to not have punctuation, except for
one case (the ecode descriptions, which have multiple
paragraphs). Furthermore, it fixes the few opcodes which had docs
ending with punctuation to not do so anymore.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport more information in RAPI group queries
Iustin Pop [Fri, 15 Jun 2012 14:23:54 +0000 (16:23 +0200)]
Export more information in RAPI group queries

Sadly we don't have a way to test that, for example, all
(G|N|I)Q_CONFIG fields are exported in RAPI, so for now we don't test
this; but we should, in the future.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoQA: Fix breakage on cluster initialization
Michael Hanselmann [Fri, 15 Jun 2012 14:00:07 +0000 (16:00 +0200)]
QA: Fix breakage on cluster initialization

The hypervisors are a list and need to be comma-separated.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoVerify the options on diskparameters
René Nussbaumer [Fri, 15 Jun 2012 12:16:50 +0000 (14:16 +0200)]
Verify the options on diskparameters

This prevents from setting for example drbd options on the plain disk
template.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoVerify user supplied dicts against defaults
René Nussbaumer [Fri, 15 Jun 2012 12:04:42 +0000 (14:04 +0200)]
Verify user supplied dicts against defaults

This verifies the user (especially in nested dicts) does not
provide a key which is not seen in the defaults dict for that dict.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoQA: Test some instance parameters depending on hypervisor
Michael Hanselmann [Fri, 15 Jun 2012 13:14:47 +0000 (15:14 +0200)]
QA: Test some instance parameters depending on hypervisor

For example, the “initrd_path” parameter is only available with xen-pvm,
whereas “boot_order” is only available with xen-hvm.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoQA: Verify hypervisors, make available through functions
Michael Hanselmann [Fri, 15 Jun 2012 13:14:57 +0000 (15:14 +0200)]
QA: Verify hypervisors, make available through functions

Some parts of QA should only be run with certain hypervisors (e.g.
testing instance HV parameters). To make that happen we always define
the cluster's hypervisors and provide a function to get the default
hypervisor.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix cfgupgrade unittests
Iustin Pop [Fri, 15 Jun 2012 11:21:52 +0000 (13:21 +0200)]
Fix cfgupgrade unittests

Sorry, I broke the cfgupgrade unittests via 904910c4, since that
commit added the requirement for the "instances" dict in the
configuration.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpgrade wrong iv_names at cfgupgrade time
Iustin Pop [Thu, 14 Jun 2012 15:17:34 +0000 (17:17 +0200)]
Upgrade wrong iv_names at cfgupgrade time

Since Ganeti 2.6 does warn about disks with wrong iv_names, it would
be better to fix them when upgrading to 2.6.

Not sure if this is too brittle and whether we want to add more
safeguards on the contents of the config/instance/disks before
touching them.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoquery2: Add <, >, <=, >= comparison operators
Michael Hanselmann [Wed, 13 Jun 2012 16:35:13 +0000 (18:35 +0200)]
query2: Add <, >, <=, >= comparison operators

These can be used, for example, to get jobs submitted after a certain
timestamp.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix creation of plain instances with --no-wait-for-sync
Iustin Pop [Wed, 13 Jun 2012 10:35:35 +0000 (12:35 +0200)]
Fix creation of plain instances with --no-wait-for-sync

As reported on the devel mailing list by Christos Stavrakakis,
creation of plain instances is broken when the --no-wait-for-sync flag
is passed, because in that case WaitForSync is not called, hence
SetDiskID is not called at all, resulting in a None physical_id being
passed to backend.

We fix that by explicitly calling SetDiskID, which will cover the
pause/resume and os_add RPC calls.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFixed typos, formatting, etc and added a comment
Bernardo Dal Seno [Sat, 17 Mar 2012 22:08:15 +0000 (23:08 +0100)]
Fixed typos, formatting, etc and added a comment

This patch only touches comments and man pages.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix daemon-util with non-root user models
Iustin Pop [Tue, 12 Jun 2012 12:38:00 +0000 (14:38 +0200)]
Fix daemon-util with non-root user models

Commit 4b42c3d6 broke non-root user mode since, while trying to do a
cleanup a move all local variable definitions to the start of the
function; however, the plain_name var is only defined later, so this
actually doesn't work.

Note that enabling set -u doesn't _directly_ work, since we rely on
some variables which are usually undefined (EXTRA_*_ARGS, etc.). It
can be fixed, but in a later patch.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoBump version for beta 2 release v2.6.0beta2
Iustin Pop [Mon, 11 Jun 2012 15:03:41 +0000 (17:03 +0200)]
Bump version for beta 2 release

I've added the changes under beta1, not beta2, since it's easier to
keep it separate.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix epydoc raises L{...} usage
Iustin Pop [Mon, 11 Jun 2012 15:28:06 +0000 (17:28 +0200)]
Fix epydoc raises L{...} usage

For epydoc raise statement, it already expects an exception which will
be hyperlinked; if passing an L{…} construct, it will instead break
the formatting (the @raise will not be recognised, but merged into the
previous paragraph).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoMerge branch 'stable-2.5' into stable-2.6
Iustin Pop [Mon, 11 Jun 2012 13:56:13 +0000 (15:56 +0200)]
Merge branch 'stable-2.5' into stable-2.6

* stable-2.5:
  Fix race condition in test for *FileID functions
  Move KVM keymap from GenerateRuntime to ExecuteRuntime
  Add the keymap directory to the list of runtime KVM dirs

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix race condition in test for *FileID functions
Michael Hanselmann [Wed, 30 Nov 2011 11:49:09 +0000 (12:49 +0100)]
Fix race condition in test for *FileID functions

In this test the “file ID” of a temporary file is compared against the
file ID gathered via an open file descriptor to the same file. For
reasons unknown to me utime(2) is called in-between to update the
inode's a- and mtime. Depending on the file system's timestamp
resolution this can lead to a different file ID.

Found by chance during QA and reproduced by adding a delay before the
call to utime(2).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit fbd554349825752a36c59c1598a512936a22d013)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoMove KVM keymap from GenerateRuntime to ExecuteRuntime
Iustin Pop [Mon, 11 Jun 2012 12:48:09 +0000 (14:48 +0200)]
Move KVM keymap from GenerateRuntime to ExecuteRuntime

Per issue 243, "side-effects" are GenerateRuntime are bad as they
execute only on the initial node of the instance. By moving the
write-out of the keymap file to ExecuteRuntime, it will be done both
at start and at migrate time.

Furthermore, we update the docstring of GenerateKVMRuntime to explain
this, and add a fixme related to the spice per-interface binding.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoAdd the keymap directory to the list of runtime KVM dirs
Iustin Pop [Mon, 11 Jun 2012 12:19:57 +0000 (14:19 +0200)]
Add the keymap directory to the list of runtime KVM dirs

Commit 4f580fef added the keymap support, but missed that this
directory needs to be ensured/created at hypervisor init time.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoFix make -n use
Iustin Pop [Mon, 11 Jun 2012 10:40:15 +0000 (12:40 +0200)]
Fix make -n use

Due to the way $(MAKE) behaves (it forces execution of the commands
that contain it), use of $(MAKE) in a command line together with
side-effects commands will break stuff. It's better to keep it either
on a separate line, or if not possible, move said commands to a
separate make target.

After this patch, make -n distcheck, make -n regen-vcs-version and
possibly other commands now work correctly.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoEnable hlint in lint and reorganise this target
Iustin Pop [Mon, 11 Jun 2012 09:15:59 +0000 (11:15 +0200)]
Enable hlint in lint and reorganise this target

Currently, the lint target does a sequential: pep8, pylint, pylint on
the QA sources. hlint is run only when explicitly requested.

This patch reorganises the lint target by:

- splitting the current lint target into separate pylint (slow),
  pylint-qa (fast), pep8 (fast) targets
- making lint itself depend on the above plus hlint
- both pep8 and hlint are optional, based on whether the said binaries
  were detected at configure time

make -j is slightly faster after this patch (1m18s → 1m7s).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoImprove error message for auto-promote/node modify
Iustin Pop [Fri, 8 Jun 2012 14:23:16 +0000 (16:23 +0200)]
Improve error message for auto-promote/node modify

This has been reported internally 3-4 times already, and the current
version (from 8b437a6e) is still not good enough, it seems.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix QA import of existing instances
Iustin Pop [Fri, 8 Jun 2012 11:48:14 +0000 (13:48 +0200)]
Fix QA import of existing instances

Commit f346a7d9 broke the TestInstanceImport test in QA, since it
dropped the "always generate" parameter for backup import. We add an
override mac parameter so that, no matter what is defined in the
config file, imported instances (can) have a different MAC.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoRemove one obsolete hlint override
Iustin Pop [Fri, 8 Jun 2012 09:44:34 +0000 (11:44 +0200)]
Remove one obsolete hlint override

During the preparations for 2.6, we cleaned up the codebase to use
newer exceptions (e.g. commits 30d25dd879ac58fa), so we can now drop
this override.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoFix prefix bug in Haskell ssconf implementation
Iustin Pop [Fri, 8 Jun 2012 09:40:43 +0000 (11:40 +0200)]
Fix prefix bug in Haskell ssconf implementation

This patch fixes a (brown-bag) bug in the ssconf implementation where
the looked-for filenames were not prefixed with the ssconf file
prefix.

Additionally, a test for this is added (which fails without the fix).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>