ganeti-local
14 years agoAdd force_variant slot to Create/ReinstallInstance
Guido Trotter [Fri, 2 Oct 2009 15:48:38 +0000 (16:48 +0100)]
Add force_variant slot to Create/ReinstallInstance

These two opcode need to know whether an unknown variant must be forced
through or not.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoUpdate client os lists to name+variant format
Guido Trotter [Fri, 2 Oct 2009 13:53:26 +0000 (14:53 +0100)]
Update client os lists to name+variant format

List of OSes are displayed by gnt-os list, rapi, and gnt-instance
reinstall --select-os, and checked by burnin. In all of these show the
list with name+variant, if the os has variants.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agognt-os diagnose: show os variants
Guido Trotter [Fri, 2 Oct 2009 13:41:38 +0000 (14:41 +0100)]
gnt-os diagnose: show os variants

We already show the per-node os variants, also show the global ones.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agocli.CalculateOSNames
Guido Trotter [Fri, 2 Oct 2009 13:36:32 +0000 (14:36 +0100)]
cli.CalculateOSNames

Given an os and its variants, return a list of "full" os names.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoAdd "variants" field to LUDiagnoseOS
Guido Trotter [Fri, 2 Oct 2009 13:34:52 +0000 (14:34 +0100)]
Add "variants" field to LUDiagnoseOS

If selected this field will contain a list of os variants supported on
all nodes.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoAdd per-node variants list to OS diagnose output
Guido Trotter [Fri, 2 Oct 2009 12:37:58 +0000 (13:37 +0100)]
Add per-node variants list to OS diagnose output

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoOSFromDisk: handle variants when loading os
Guido Trotter [Fri, 2 Oct 2009 15:00:13 +0000 (16:00 +0100)]
OSFromDisk: handle variants when loading os

When we load an OS from disk, we need _TryOSFromDisk to get the real
name, without any variant. This allows any functionality that uses the
instance OS to handle a name with a variant.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoOSEnvironment: populate OS_VARIANT
Guido Trotter [Fri, 2 Oct 2009 11:15:49 +0000 (12:15 +0100)]
OSEnvironment: populate OS_VARIANT

According to the design on api_version >= 15 the OS variant is the part
of the OS name after the "+" sign. If none is found, we just pass in the
first variant an OS declares (which is bound to exist, as we check for
it in _TryOSFromDisk).

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoPopulate OS variants if an api >= 15 is present
Guido Trotter [Fri, 2 Oct 2009 10:47:55 +0000 (11:47 +0100)]
Populate OS variants if an api >= 15 is present

Adding the file name to the os_files dict will fill in the full path and
get it checked, if present we also read it and split into lines, one per
declared variant.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoAdd slot and constant for supported OS variants
Guido Trotter [Fri, 2 Oct 2009 10:27:40 +0000 (11:27 +0100)]
Add slot and constant for supported OS variants

The slot will contain a list of variants, and the variants file constant
contains the file in the os dir which is supposed to hold the list.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoTryOSFromDisk: only check actual os scripts for +x
Guido Trotter [Fri, 2 Oct 2009 10:39:59 +0000 (11:39 +0100)]
TryOSFromDisk: only check actual os scripts for +x

Currently all checked files in the loop are os scripts, so nothing will
change, but in the future we only want the +x bit on actual os scripts,
not necessarily all files.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoTryOSFromDisk: s/os_scripts/os_files/
Guido Trotter [Fri, 2 Oct 2009 10:37:57 +0000 (11:37 +0100)]
TryOSFromDisk: s/os_scripts/os_files/

We'll be using this dict/loop to check more than just scripts, so we're
renaming the variables appropriately.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoConvert os api version file name to a constant
Guido Trotter [Fri, 2 Oct 2009 10:26:24 +0000 (11:26 +0100)]
Convert os api version file name to a constant

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoFix rpc.call_os_get to actually return the OS
Guido Trotter [Fri, 2 Oct 2009 16:30:00 +0000 (17:30 +0100)]
Fix rpc.call_os_get to actually return the OS

Since nobody ever read the actual OS object, this bug was introduced in
the rpc conversion.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoAdd support for using the bootloader in xen-pvm
Jun Futagawa [Tue, 29 Sep 2009 07:43:15 +0000 (16:43 +0900)]
Add support for using the bootloader in xen-pvm

This patch adds three optional parameters:
  - 'use_bootloader', whether use or not the bootloader
  - 'bootloader_path', absolute path to the bootloader
  - 'bootloader_args', extra arguments to the bootloader

Syntax:
  gnt-cluster modify --hypervisor-parameters \
    xen-pvm:bootloader_path=/usr/bin/pygrub,use_bootloader=False
  gnt-instance modify -H use_bootloader=True instance1.example.com

If use_bootloader is True, each domU can boot with its own kernel
instead of using the dom0 kernel.

Signed-off-by: Jun Futagawa <jfut@integ.jp>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: ultortter

14 years agoDisallow "xrange" function
Michael Hanselmann [Fri, 2 Oct 2009 15:44:29 +0000 (17:44 +0200)]
Disallow "xrange" function

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

14 years agoReplace all xrange() with range()
Michael Hanselmann [Fri, 2 Oct 2009 15:33:33 +0000 (17:33 +0200)]
Replace all xrange() with range()

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

14 years agoMore locking tests race conditions fixes
Michael Hanselmann [Fri, 2 Oct 2009 12:04:44 +0000 (14:04 +0200)]
More locking tests race conditions fixes

There were more race conditions. By adding a notify function to
SharedLock.acquire we can prevent them.

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

14 years agocheck-python-code: Show line number for problems
Michael Hanselmann [Fri, 2 Oct 2009 10:14:11 +0000 (12:14 +0200)]
check-python-code: Show line number for problems

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoLUSetNodeParams: autopromote self when needed
Guido Trotter [Thu, 1 Oct 2009 16:29:29 +0000 (17:29 +0100)]
LUSetNodeParams: autopromote self when needed

If we're de-offlining or de-draining a node we need to promote it to MC
if we have not enough, or the config will be corrupt.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoAbstract self-promotion decision
Guido Trotter [Thu, 1 Oct 2009 15:57:34 +0000 (16:57 +0100)]
Abstract self-promotion decision

During node add we decide whether to self promote to an MC. Abstract
this decision making to a separate function.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoFix master candidate removal
Guido Trotter [Thu, 1 Oct 2009 16:13:41 +0000 (17:13 +0100)]
Fix master candidate removal

Currently during a master candidate removal, when it's possible to
promote another node, the removal operation fails because of a corrupt
config before it's even possible to do the promotion. Fixing this by
doing the promotion before, excluding the current node.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoLUSetNodeParams: Don't break config on mc demotion.
Guido Trotter [Wed, 30 Sep 2009 16:25:29 +0000 (17:25 +0100)]
LUSetNodeParams: Don't break config on mc demotion.

If --force is used to demote an MC, but then there are not enough MCs in
the cluster, the configuration gets corrupted until a node is promoted.

In order to avoid that we only allow demotion with --force if the node
is offlined or drained at the same time, and we don't have any other
node available to promote.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>

14 years agoMaster candidate stats, return one more value
Guido Trotter [Thu, 1 Oct 2009 15:36:19 +0000 (16:36 +0100)]
Master candidate stats, return one more value

Other than returning the current number of candidates, and the number of
desired and possible candidates, we also return the maximum possible
number, even if greater than our desires. All callers for now ignore
this third value.

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

14 years agoSingleActionPipeCondition =~ s/Action/Notify/
Guido Trotter [Wed, 30 Sep 2009 18:37:17 +0000 (19:37 +0100)]
SingleActionPipeCondition =~ s/Action/Notify/

With this patch we simplify usage on the SingleActionCondition (which
wasn't a condition at all) by making it a real condition. This way we
can just wait() on it, or notifyAll() as we would on a normal one. The
only catch is that notifyAll can be called only once, and wait can only
be called before notifyAll has, but luckily our PipeCondition, now quite
simplified, takes care of this, by providing a new SingleActionCondition
each time the previous one has been notified.

No Start/StopUsing function are needed anymore, and thus the condition
is a lot more robust, and there's no way file descriptors can be left
open, as they are closed in a finally block, in the same function where
they were opened, by the last thread exiting the class.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agotestNotification: add more checking about order
Guido Trotter [Thu, 1 Oct 2009 13:09:35 +0000 (14:09 +0100)]
testNotification: add more checking about order

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoAbstract base condition test cases
Guido Trotter [Thu, 1 Oct 2009 12:56:32 +0000 (13:56 +0100)]
Abstract base condition test cases

This way they can be used to test different condition classes.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoMove the "done" queue inside _ThreadedTestCase
Guido Trotter [Thu, 1 Oct 2009 09:41:36 +0000 (10:41 +0100)]
Move the "done" queue inside _ThreadedTestCase

All (ok, all but one) _ThreadedTestCase users have a done Queue, so we
move its building in the _ThreadedTestCase setUp

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoAbstract "base" condition code in a separate class
Guido Trotter [Wed, 30 Sep 2009 17:30:07 +0000 (18:30 +0100)]
Abstract "base" condition code in a separate class

Each condition has an underlying lock, the acquire and release methods,
and a few helper methods to check that it's called in the proper way.

Abstract them to a separate class so we can have more than one without
duplicating this code.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agolocking.SharedLock: Fix bug in delete function
Michael Hanselmann [Thu, 1 Oct 2009 15:22:02 +0000 (17:22 +0200)]
locking.SharedLock: Fix bug in delete function

SharedLock.__acquire_unlocked uses keyword parameters. Just passing
the timeout would set the “shared” parameter.

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

14 years agoRename LockSet.acquire parameter “blocking” to “timeout”
Michael Hanselmann [Tue, 29 Sep 2009 15:20:06 +0000 (17:20 +0200)]
Rename LockSet.acquire parameter “blocking” to “timeout”

Also remove the “blocking” parameter from LockSet.remove and
GanetiLockManager.remove. There's no point in implementing timeouts on removal
unless we need them.

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

14 years agoTry to fix locking unittests
Michael Hanselmann [Wed, 30 Sep 2009 16:24:43 +0000 (18:24 +0200)]
Try to fix locking unittests

Our automated test system found a few problems in the new locking
unittests. This patch should fix them, although I wasn't able to
reproduce the problem. All are race conditions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoChange SharedLock to new pipe(2)-based condition
Michael Hanselmann [Mon, 28 Sep 2009 15:44:19 +0000 (17:44 +0200)]
Change SharedLock to new pipe(2)-based condition

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoAdd _PipeCondition class
Michael Hanselmann [Mon, 28 Sep 2009 15:43:53 +0000 (17:43 +0200)]
Add _PipeCondition class

_PipeCondition is a condition implemented using pipe(2) and poll(2).
It allows the implementation of timeouts without using a busy-wait loop
with time.sleep.

Unlike Python's built-in threading.Condition class and to save file
descriptors and an internal queue, it can only be used to notify
all waiters. Ganeti's use case for this condition class doesn't
require the ability to notify only one waiter.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoAdd _SingleActionPipeCondition class
Michael Hanselmann [Tue, 29 Sep 2009 14:12:12 +0000 (16:12 +0200)]
Add _SingleActionPipeCondition class

This class will be used as a basic block for pipe(2)-based
conditions. Upon initialization it creates a pipe and can be
notified once (hence the “single action” in the name). A
callable helper class is used to wait for notifications.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoSharedLock: implement timeouts
Michael Hanselmann [Thu, 24 Sep 2009 12:21:18 +0000 (14:21 +0200)]
SharedLock: implement timeouts

This patch greatly simplifies the SharedLock code and implements
timeouts for the acquire() and delete() functions. A wrapper around
Python's threading.Condition class must be used to ensure thread
safety when check whether there are any waiters left.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoExtend confd instances ips query
Luca Bigliardi [Wed, 30 Sep 2009 13:51:11 +0000 (14:51 +0100)]
Extend confd instances ips query

The query now accepts a link parameter.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoMerge remote branch 'origin/master' into mogu
Iustin Pop [Wed, 30 Sep 2009 12:57:24 +0000 (14:57 +0200)]
Merge remote branch 'origin/master' into mogu

* origin/master:
  Fix burnin's verbose mode
  Final NEWS update and version increase for 2.0.4
  Encode the actual exception raised by LU execution
  Move the luxi error handling into errors.py
  Fix the confusing ssh/hostname message in node add
  Add man page for ganeti-cleaner
  Update NEWS file for version 2.0.4
  Automatically cleanup _temporary_ids at save
  Separate the computation of all config IDs
  Change config upgrade to be explicit
  Fix unittest breakage due to new test file
  Fix /proc/drbd parsing in presence of gaps
  repair-size: ensure child disks have sane sizes
  Fix yet another bug in LURepairDiskSizes
  Fix a bug in LURepairDiskSizes

Conflicts:
NEWS          (trivial, the RST change)
lib/cmdlib.py (trivial, some small change in 2.0)
lib/config.py (due to the cherry-picks and UUID changes in 2.1)

Signed-off-by: Iustin Pop <iustin@google.com>

14 years agoImprove description of migrate/failover post hooks env
Luca Bigliardi [Tue, 29 Sep 2009 17:07:37 +0000 (18:07 +0100)]
Improve description of migrate/failover post hooks env

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoUpdate env vars for instances in hooks documentation
Luca Bigliardi [Tue, 29 Sep 2009 16:15:36 +0000 (17:15 +0100)]
Update env vars for instances in hooks documentation

Remove variables which are listed at the beginning of the section and variables
which are not declared when building hooks env.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agoFix burnin's verbose mode v2.0.4
Iustin Pop [Tue, 29 Sep 2009 15:48:42 +0000 (17:48 +0200)]
Fix burnin's verbose mode

The timestamp need special formatting, which was done for the internal
buffer storage but not for the messages logged in verbose mode. This
patch unifies the formatting for these two cases.

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

14 years agoFinal NEWS update and version increase for 2.0.4
Iustin Pop [Tue, 29 Sep 2009 10:19:59 +0000 (12:19 +0200)]
Final NEWS update and version increase for 2.0.4

QA passed successfully, let's try to have a release.

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

14 years agoAdd initial confd client unittests
Guido Trotter [Thu, 24 Sep 2009 16:31:31 +0000 (17:31 +0100)]
Add initial confd client unittests

Some basic tests for the confd client library

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoconfd/client: make it possible to update peer list
Guido Trotter [Tue, 29 Sep 2009 08:25:33 +0000 (09:25 +0100)]
confd/client: make it possible to update peer list

Until now the peers have to be the same all the time. Adding a new
function to update the list, and call it from the constructor to avoid
duplicating code.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoRemove ‘-u’ from masterd shebang
Iustin Pop [Tue, 29 Sep 2009 09:06:55 +0000 (11:06 +0200)]
Remove ‘-u’ from masterd shebang

This is not needed anymore - the original change was more than a year
ago when masterd was in its incipient phase.

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

14 years agoconfd/client: pass self to upcalls
Guido Trotter [Mon, 28 Sep 2009 15:53:30 +0000 (16:53 +0100)]
confd/client: pass self to upcalls

It may be handy for upcalls to know which client called them, and call
it back. So we create a new "client" field in the upcall target,
containing the current client instance

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agodevel/upload.in: make it more project generic
Guido Trotter [Mon, 28 Sep 2009 09:23:53 +0000 (10:23 +0100)]
devel/upload.in: make it more project generic

Only install ganeti specific files if they exist. This way we can call
ganeti's devel/upload in another sub-projects (eg. nbma) and have it
uploaded to a host as well, without having to create a new script there.

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

14 years agoConfdFilterCallback: fix a bug in expire
Guido Trotter [Fri, 25 Sep 2009 17:15:05 +0000 (18:15 +0100)]
ConfdFilterCallback: fix a bug in expire

The HandleExpire function takes the whole "up" structure, and not just
the salt.

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

14 years agoganeti-confd: cleanup imports
Guido Trotter [Fri, 25 Sep 2009 16:56:00 +0000 (17:56 +0100)]
ganeti-confd: cleanup imports

Many functionalities of confd have been moved to other classes/modules,
and the main confd daemon doesn't reference these modules directly
anymore.

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

14 years agoganeti-confd: don't depend on the os log dir
Guido Trotter [Fri, 25 Sep 2009 14:51:00 +0000 (15:51 +0100)]
ganeti-confd: don't depend on the os log dir

ganeti-confd doesn't need to log anything related to os installations.

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

14 years agoEncode the actual exception raised by LU execution
Iustin Pop [Thu, 27 Aug 2009 13:02:50 +0000 (15:02 +0200)]
Encode the actual exception raised by LU execution

Currently, the actual exception raised during an LU execution (one of
OpPrereqError, OpExecError, HooksError, etc.) is lost because the
jqueue.py code simply sets that to a str(err), and the code in cli.py
simply passes that string to OpExecError.

This patch moves to encoding the errors as per errors.EncodeError and
changes the cli code to parse and raise that (if possible).

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

14 years agoMove the luxi error handling into errors.py
Iustin Pop [Thu, 27 Aug 2009 13:01:23 +0000 (15:01 +0200)]
Move the luxi error handling into errors.py

Currently the luxi error handling is hardcoded as special encoding on
the masterd-side and special decoding on the client side. This patch
moves it to errors.py such that other parts of the code can reuse the
same encoding.

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

14 years agoFix the confusing ssh/hostname message in node add
Iustin Pop [Fri, 25 Sep 2009 15:34:47 +0000 (17:34 +0200)]
Fix the confusing ssh/hostname message in node add

Before, it used to say:

  ssh/hostname verification failed node1.example.com -> hostname mismatch, got
  node2

Now it says for wrong hostnames (maybe too verbose):

  ssh/hostname verification failed (checking from node1.example.com): hostname
  mismatch, expected node2.example.com but got node3

And for non-FQDN hostnames:

  ssh/hostname verification failed (checking from node1.example.com): hostname
  not FQDN: expected node2.example.com but got node2

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

14 years agoAdd man page for ganeti-cleaner
Michael Hanselmann [Fri, 25 Sep 2009 15:25:47 +0000 (17:25 +0200)]
Add man page for ganeti-cleaner

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

14 years agoRemove secrets and kill confd on cluster leave
Guido Trotter [Fri, 25 Sep 2009 14:11:08 +0000 (15:11 +0100)]
Remove secrets and kill confd on cluster leave

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoImplement ConfdFilterCallback
Guido Trotter [Wed, 23 Sep 2009 15:05:19 +0000 (16:05 +0100)]
Implement ConfdFilterCallback

This callback can be stacked with another one, and will filter duplicate
or old results, making handling of results easier.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfd client: add module level documentation
Guido Trotter [Thu, 24 Sep 2009 15:34:25 +0000 (16:34 +0100)]
Confd client: add module level documentation

Populate the docstring with documentation on the client library's usage.

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

14 years agoUpdate NEWS file for version 2.0.4
Iustin Pop [Fri, 25 Sep 2009 14:11:29 +0000 (16:11 +0200)]
Update NEWS file for version 2.0.4

We don't bump up the version yet, pending more QA tests.

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

14 years agoAdd uuid on node/instance add and cluster init
Iustin Pop [Fri, 25 Sep 2009 11:53:34 +0000 (13:53 +0200)]
Add uuid on node/instance add and cluster init

This patch does a little bit of cleanup first, since we want to call
GenerateUniqueID without reacquiring the lock.

Note that we don't necessarily need to do this for the cluster, since at
first startup ConfigWriter will do it anyway. But it's better to
explicitely do this instead of relying on the automated upgrade.

Additionally this patch adds ctime/mtime population at cluster init
time. mtime is not necessarily needed (master will update it
automatically, but we're doing it anyway for consistency).

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

14 years agoFix RAPI QA, broken by NIC parameters changes
Iustin Pop [Fri, 25 Sep 2009 11:38:03 +0000 (13:38 +0200)]
Fix RAPI QA, broken by NIC parameters changes

This also adds the new nic.links query field.

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

14 years agoAutomatically cleanup _temporary_ids at save
Iustin Pop [Wed, 23 Sep 2009 16:39:05 +0000 (18:39 +0200)]
Automatically cleanup _temporary_ids at save

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

14 years agoSeparate the computation of all config IDs
Iustin Pop [Wed, 23 Sep 2009 15:37:46 +0000 (17:37 +0200)]
Separate the computation of all config IDs

We will need this in another place, so we abstract the 'compute all
current IDs' functionality into a separate function. We also change the
name of the _ComputeAllLVs to _AllLVs to match the other _All*s
functions.

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

14 years agoChange config upgrade to be explicit
Iustin Pop [Tue, 22 Sep 2009 13:54:20 +0000 (15:54 +0200)]
Change config upgrade to be explicit

Currently the config upgrade is done at each object instantiation, that
means that ganeti-noded will run UpgradeConfig on all objects received
remotely (instances, disks, nics). This is not so good, so this patch
changes it so that only the ConfigWriter runs this method at
configuration load time.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit 90d726a80ce40a4990a26566211514e863985efc)

14 years agoMerge commit 'origin/next'
Iustin Pop [Fri, 25 Sep 2009 12:22:58 +0000 (14:22 +0200)]
Merge commit 'origin/next'

* commit 'origin/next': (74 commits)
  Fix gnt-node modify online help
  Fix gnt-job info entry in gnt-job(8)
  locking: Don't swallow exceptions
  Add check for duplicate MACs in instance add
  scripts/gnt-node: fix a help string
  Optimise multi-job submit
  Extend gnt-debug with more debugging options
  Return cluster tags from LUQueryClusterInfo
  Add script to clean archived jobs after 21 days
  rapi: export more static node information
  Pass the correct signal to handlers
  cli: Use ToStdout/ToStderr instead of print
  Fix small typo in gnt-node
  Simplify handling of boolean args in rapi
  Fix checks in LUSetNodeParms for the master node
  Improve the example startup script
  Fix insserv dependencies
  Fix a typo in InitCluster
  Ignore results from drained nodes in iallocator
  Ship the ethers hook
  ...

14 years agoWrap documentation to max 72 characters per line
Michael Hanselmann [Thu, 24 Sep 2009 14:01:27 +0000 (16:01 +0200)]
Wrap documentation to max 72 characters per line

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

14 years agoSet Vim textwidth in each documentation file
Michael Hanselmann [Wed, 23 Sep 2009 15:36:36 +0000 (17:36 +0200)]
Set Vim textwidth in each documentation file

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

14 years agoAdd missing import sys to lib/daemon.py
Iustin Pop [Thu, 24 Sep 2009 14:50:29 +0000 (16:50 +0200)]
Add missing import sys to lib/daemon.py

It does “print >> sys.stderr, …” but there is no import sys.

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

14 years agoAdd documentation on manual cluster cleanup
Iustin Pop [Thu, 24 Sep 2009 14:12:07 +0000 (16:12 +0200)]
Add documentation on manual cluster cleanup

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

14 years agoAdd implementation details for 2.1 locking changes
Michael Hanselmann [Fri, 18 Sep 2009 15:29:54 +0000 (17:29 +0200)]
Add implementation details for 2.1 locking changes

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

14 years agoKVMHypervisor: wrap long line
Guido Trotter [Thu, 24 Sep 2009 12:48:38 +0000 (13:48 +0100)]
KVMHypervisor: wrap long line

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

14 years agoExport the uuid in RAPI
Iustin Pop [Wed, 23 Sep 2009 17:11:32 +0000 (19:11 +0200)]
Export the uuid in RAPI

This also simplifies a little the field declaration in RAPI.

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

14 years agoExport and show the cluster uuid in cluster info
Iustin Pop [Wed, 23 Sep 2009 17:07:54 +0000 (19:07 +0200)]
Export and show the cluster uuid in cluster info

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

14 years agoMan page updates for the uuid field
Iustin Pop [Wed, 23 Sep 2009 17:04:36 +0000 (19:04 +0200)]
Man page updates for the uuid field

Also corrects wrong indentation in the gnt-instance.sgml file.

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

14 years agoImplement uuid in gnt-node/instance list and info
Iustin Pop [Wed, 23 Sep 2009 17:01:58 +0000 (19:01 +0200)]
Implement uuid in gnt-node/instance list and info

The patch modifies LUQueryInstanceData to return the uuid too and also
adds support for it in the gnt-* scripts.

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

14 years agoSimplify handling of regular fields in LUQuery*
Iustin Pop [Wed, 23 Sep 2009 16:58:28 +0000 (18:58 +0200)]
Simplify handling of regular fields in LUQuery*

For fields that correspond directly to an object's field, we can
simplify the handling. The patch also adds the new 'uuid' fields to
objects so that it can be queried.

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

14 years agoAutomatically fill in missing UUIDs
Iustin Pop [Wed, 23 Sep 2009 16:44:06 +0000 (18:44 +0200)]
Automatically fill in missing UUIDs

The patch also starts using the current UUIDs (in the new attributes)
while computing the _AllIDs list.

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

14 years agoAdd uuid attributes to configuration entities
Iustin Pop [Wed, 23 Sep 2009 16:43:46 +0000 (18:43 +0200)]
Add uuid attributes to configuration entities

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

14 years agoAutomatically cleanup _temporary_ids at save
Iustin Pop [Wed, 23 Sep 2009 16:39:05 +0000 (18:39 +0200)]
Automatically cleanup _temporary_ids at save

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

14 years agoSeparate the computation of all config IDs
Iustin Pop [Wed, 23 Sep 2009 15:37:46 +0000 (17:37 +0200)]
Separate the computation of all config IDs

We will need this in another place, so we abstract the 'compute all
current IDs' functionality into a separate function. We also change the
name of the _ComputeAllLVs to _AllLVs to match the other _All*s
functions.

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

14 years agoNode init: copy hmac key as well
Guido Trotter [Thu, 24 Sep 2009 09:06:13 +0000 (10:06 +0100)]
Node init: copy hmac key as well

Without this confd will not start when a node is added to the cluster.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoUnpack the confd reply as an object, from the dict
Guido Trotter [Wed, 23 Sep 2009 14:56:33 +0000 (15:56 +0100)]
Unpack the confd reply as an object, from the dict

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

14 years agoInstall guide: talk about routing mode
Guido Trotter [Tue, 22 Sep 2009 16:23:39 +0000 (17:23 +0100)]
Install guide: talk about routing mode

The networking section is updated to talk about both routing and
bridging.

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

14 years agoUpdate hypervisor installation section
Guido Trotter [Tue, 22 Sep 2009 15:12:59 +0000 (16:12 +0100)]
Update hypervisor installation section

Currently the section is called "Installing Xen" and also mentions KVM.
Updating the title and also make it slightly less xen-centric.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agodocument the nic link meaning in routed mode
Guido Trotter [Tue, 22 Sep 2009 14:49:36 +0000 (15:49 +0100)]
document the nic link meaning in routed mode

Currently this feature is hypervisor specific, but under kvm we use it
by default (aka: if the user hasn't specified another network script
which overrides our auto-generated one) to specify the routing table.
This was already hinted as a possibility in the manpages, but never
explicitely stated as a reality, so we update gnt-cluster(8) to actually
say this, and gnt-{backup,instance}(8) to point to gnt-cluster(8) for
more information.

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

14 years agoKVM nic script: enable interface forwarding
Guido Trotter [Thu, 24 Sep 2009 09:50:59 +0000 (10:50 +0100)]
KVM nic script: enable interface forwarding

If forwarding is enabled globally this is a no-op. If instead it's
enabled only for some special interfaces where instance traffic has to
go to/comes from (for example a gre tunnel) then it's useful to
explicitely enable it for the instances interfaces as well.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoKVM nic script: use routed link as table
Guido Trotter [Tue, 22 Sep 2009 14:18:50 +0000 (15:18 +0100)]
KVM nic script: use routed link as table

In order to be able to maintain the node network standard routing
untouched while routing instance traffic through a different dedicated
interface (eg: a gre tunnel) we need to specify the instance routing
path inside a separate table, which will also contain different default
gateway values. This patch fixes the kvm default network script to use
the nic link, if present, as a routing table to use instead of the
default one.

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

14 years agoConfd client library: enable optional logging
Guido Trotter [Wed, 23 Sep 2009 11:19:47 +0000 (12:19 +0100)]
Confd client library: enable optional logging

If a logger is passed in, we log some debugging messages that might help
someone who's debugging a confd client to understand what's going on.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfd client: make confd port configurable
Guido Trotter [Wed, 16 Sep 2009 15:58:53 +0000 (16:58 +0100)]
Confd client: make confd port configurable

The port can be now chosen at library init time, with a default of
calling GetDaemonPort.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfd client: Change callback model
Guido Trotter [Wed, 16 Sep 2009 15:56:32 +0000 (16:56 +0100)]
Confd client: Change callback model

We move to one callback in total, rather than one per call, and call it
both for server replies and request expiring.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoConfd client: make SendRequest args optional
Guido Trotter [Wed, 16 Sep 2009 16:12:25 +0000 (17:12 +0100)]
Confd client: make SendRequest args optional

By default "None" will be used as an args value

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

14 years agoChange config upgrade to be explicit
Iustin Pop [Tue, 22 Sep 2009 13:54:20 +0000 (15:54 +0200)]
Change config upgrade to be explicit

Currently the config upgrade is done at each object instantiation, that
means that ganeti-noded will run UpgradeConfig on all objects received
remotely (instances, disks, nics). This is not so good, so this patch
changes it so that only the ConfigWriter runs this method at
configuration load time.

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

14 years agoConfd: add instances IPs query
Luca Bigliardi [Tue, 22 Sep 2009 14:24:30 +0000 (15:24 +0100)]
Confd: add instances IPs query

Extend confd to answer queries about instances IPs.

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

14 years agoFix utils.MatchNameComponent for full matches
Iustin Pop [Tue, 22 Sep 2009 13:02:41 +0000 (15:02 +0200)]
Fix utils.MatchNameComponent for full matches

While ‘test1’ matches both ‘test1’ and ‘test1.example’, it has a full,
exact match and we should return it if that is the case.

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

14 years agoDesign doc changes for UUID tracking of objects
Iustin Pop [Mon, 21 Sep 2009 14:14:38 +0000 (16:14 +0200)]
Design doc changes for UUID tracking of objects

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

14 years agoFix _RemoveDisk for file based instances
Guido Trotter [Mon, 21 Sep 2009 14:11:25 +0000 (15:11 +0100)]
Fix _RemoveDisk for file based instances

During 621b7678 two typos were introduced which prevent file based
instances removal to work correctly. Fixing both of them to what they
were meant to be.

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

14 years agoRe-wrap locking changes design to 76 chars per line
Michael Hanselmann [Mon, 21 Sep 2009 13:23:12 +0000 (15:23 +0200)]
Re-wrap locking changes design to 76 chars per line

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

14 years agoRevert "Include NEWS file in documentation"
Michael Hanselmann [Mon, 21 Sep 2009 12:54:20 +0000 (14:54 +0200)]
Revert "Include NEWS file in documentation"

This reverts commit 350ecfecca136f50877898774c6b40014b5c2b1c. It broke
distcheck.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

14 years agognt-instance info: fix nic display
Guido Trotter [Mon, 21 Sep 2009 10:59:21 +0000 (11:59 +0100)]
gnt-instance info: fix nic display

In branch-2.1 the conversion of NICs to Tuples has been unified to the
_NICListToTuple function, which is used by both hook generation and
instance info generation. Unfortunately the ip and mac fields got
swapped from what instance info expected, so the mac is shown as ip, and
vice versa. Fixing this.

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

14 years agocmdlib._CreateDisks fix a broken result.Raise
Guido Trotter [Mon, 21 Sep 2009 10:13:43 +0000 (11:13 +0100)]
cmdlib._CreateDisks fix a broken result.Raise

The format string has the ": %s" at the end, but no argument is passed,
which of course raises a TypeError. Removing ": %s" as it's added by
the RpcResult Raise() method anyway.

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

14 years agoInclude NEWS file in documentation
Michael Hanselmann [Fri, 18 Sep 2009 15:24:27 +0000 (17:24 +0200)]
Include NEWS file in documentation

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