ganeti-local
16 years agoImprove the documentation of query output fields
Iustin Pop [Mon, 28 Jan 2008 14:45:23 +0000 (14:45 +0000)]
Improve the documentation of query output fields

The gnt-node and gnt-instance list commands have a customizable list of
output fields, but the list is not up to date (in the man page) and not
easily understandable from the ‘--help’ output.

This patch updates the man pages and adds the available fields and
default fields in the ‘--help’ output, as part of the description.

Example:
Usage
=====
  gnt-node list

Lists the nodes in the cluster. The available fields are (see the man page for
details): name, pinst_cnt, pinst_list, sinst_cnt, sinst_list, pip, sip,
dtotal, dfree, mtotal, mnode, mfree, bootid. The default field list is (in
order): name, dtotal, dfree, mtotal, mnode, mfree, pinst_cnt, sinst_cnt.

Reviewed-by: imsnah,ultrotter

16 years agoAdd QA tests for gnt-instance modify
Iustin Pop [Mon, 28 Jan 2008 14:45:02 +0000 (14:45 +0000)]
Add QA tests for gnt-instance modify

This patch adds QA tests for most of the possible parameters in the
instance modify operation (exception being the MAC), and modifies the
sample QA file to run this test.

It also tests the no-modification test, but that is a weak one: we only
test that the exit code is one, not that the command gave a proper
response ("... please give at least one parameter") as opposed to a
traceback.

Reviewed-by: imsnah

16 years agoAdd option for the number of VCPUs in instance listing
Iustin Pop [Mon, 28 Jan 2008 14:44:46 +0000 (14:44 +0000)]
Add option for the number of VCPUs in instance listing

Reviewed-by: ultrotter

16 years agoChange the install directory for the tools
Iustin Pop [Mon, 28 Jan 2008 14:44:31 +0000 (14:44 +0000)]
Change the install directory for the tools

Currently, the tools are installed under $prefix/share/ganeti. This
prevents installing other things in a nice way under share/ganeti (like
arch-independent OS definitions), therefore we want the tools to live
under share/ganeti/tools.

A second change is that since these are programs, they would better live
under libdir than datadir - we might have to change them later to
binaries in which case 'share' is definitely not the way to go.

This patch therefore changes the install directory for the tools to
$prefix/lib/ganeti/tools.

Reviewed-by: imsnah

16 years agoFix VG listing broken by r510
Iustin Pop [Mon, 28 Jan 2008 14:44:19 +0000 (14:44 +0000)]
Fix VG listing broken by r510

LVM code sometimes adds an extra separator at the end of the field list.
Make the code strip it if exists.

Reviewed-by: imsnah

16 years agoMake backend._GetVGInfo check the validity of 'vgs'
Iustin Pop [Mon, 28 Jan 2008 14:44:06 +0000 (14:44 +0000)]
Make backend._GetVGInfo check the validity of 'vgs'

Currently, the function backend._GetVGInfo only checks for errors via
the exit code of the 'vgs' command. However, there are other ways of
failure so we need to also check for valid output before parsing.

Furthermore, the checks on the exit code were reported via a 'raise
LVMError', however this exception is not handled anywhere and so the
remote caller will not get reasonable data.

This patch does two main things:
  - change the calling protocol for this function to not raise an error,
    and instead return the same type of argument always (dict) with the
    requested keys but values changed into None; this allows in the
    parent rpc call node_info to have valid memory information but
    "error" value for disk space, if there's an error with disks
  - check the validity of the output so that in case we fail to parse
    it, we don't abort with a backtrace in the node daemon but instead
    return the default result value (containing errors), and log these
    cases in the node daemon log file

We also bump the protocol version to 11.

Reviewed-by: ultrotter

16 years agoFix checking of node free disk in CreateInstance
Iustin Pop [Mon, 28 Jan 2008 14:42:28 +0000 (14:42 +0000)]
Fix checking of node free disk in CreateInstance

This patch does two things:
  - checks that the result values from call_node_info are valid integer
    values and aborts otherwise
  - skips disk space computation for the DT_DISKLESS case

The most important point of the patch is the verification of results
from the rpc call, as it prepares for a patch that allows failures to be
better reported from the remote node.

Reviewed-by: ultrotter

16 years agoAbstract node memory checking into a separate function
Iustin Pop [Mon, 28 Jan 2008 14:42:12 +0000 (14:42 +0000)]
Abstract node memory checking into a separate function

The checking of a node's free memory (via rpc.call_node_info) is done in
both start instance an failover. This patch abstracts this call,
together with the appropriate error handling, into a separate function
called _CheckNodeFreeMemory.

The patch also has some related changes:
  - the check is done in prereq and not in exec for start instance
  - the redundant check in exec for failover has been removed

Reviewed-by: ultrotter

16 years agoChange a hardcoded path into its proper constant
Iustin Pop [Mon, 28 Jan 2008 14:42:00 +0000 (14:42 +0000)]
Change a hardcoded path into its proper constant

The function backend.UploadFile still uses "/etc/hosts" directly instead
of the existing constant; this patch fixes this.

Reviewed-by: ultrotter

16 years agoAllow use of 'diskless' disk template in burnin
Iustin Pop [Mon, 28 Jan 2008 14:41:47 +0000 (14:41 +0000)]
Allow use of 'diskless' disk template in burnin

Even if this doesn't have any practical use for actually creating
instances, it can be used for very fast burnin and testing just the
add/start/stop/remove functionality.

This has also revealed a bug in export/import related to diskless
instances, so it's educational value is proved.

Reviewed-by: ultrotter

16 years agoFix run directory for the fake hypervisor
Iustin Pop [Mon, 28 Jan 2008 14:41:35 +0000 (14:41 +0000)]
Fix run directory for the fake hypervisor

Currently the fake hypervisor has hardcoded ‘/var/run’ as a base
directory for its store. This patch adds a constant RUN_DIR that is used
for both the fake hypervisor and for BDEV_CACHE_DIR.

Reviewed-by: ultrotter

16 years agoFix the init.d script
Iustin Pop [Mon, 28 Jan 2008 14:41:20 +0000 (14:41 +0000)]
Fix the init.d script

The script (which is geared towards Debian) is actually not fully
compliant, as lintian generates a warning on it - the S runlevel is not
a valid one in the "Stop" stanza. This patch removes "S" from the stop
list.

Reviewed-by: imsnah

16 years agoFix a typo in a devel/upload comment
Guido Trotter [Mon, 28 Jan 2008 13:41:21 +0000 (13:41 +0000)]
Fix a typo in a devel/upload comment

Files are uploaded to $prefix/sbin, not $prefix/bin

Reviewed-by: iustinp

16 years agoAdd tool to ease testing of unsubmitted patches
Guido Trotter [Mon, 28 Jan 2008 13:41:09 +0000 (13:41 +0000)]
Add tool to ease testing of unsubmitted patches

The upload tool can be used to submit the current code to an arbitrary list of
nodes. This helps developers in easily testing their changes before submitting
them.

Reviewed-by: iustinp

16 years agoAdd a missing parenthesis
Guido Trotter [Mon, 28 Jan 2008 13:40:57 +0000 (13:40 +0000)]
Add a missing parenthesis

It was wrongly deleted when converting

if a in dict.keys():
to
if a in dict:

Reviewed-by: imsnah

16 years agoAdd a few aliases for startup/shutdown
Guido Trotter [Mon, 28 Jan 2008 13:40:42 +0000 (13:40 +0000)]
Add a few aliases for startup/shutdown

These aliases are widely used to think of these operations and save some typing
too. Even though there is some thought to make start/stop the default operation
name I don't think this should happen for 1.2, for now adding it as an alias is
fine.

Reviewed-by: iustinp

16 years agoAdd the first command alias
Guido Trotter [Mon, 28 Jan 2008 13:40:25 +0000 (13:40 +0000)]
Add the first command alias

Alias activate_block_devs to activate-disks, for ganeti 1.1 compatibility.

Reviewed-by: iustinp

16 years agoAdd support for command aliases
Guido Trotter [Mon, 28 Jan 2008 13:40:12 +0000 (13:40 +0000)]
Add support for command aliases

Passing a new aliases dict to generic main we can easily support aliases for
compatibility reasons or simply useability.

Reviewed-by: iustinp

16 years agoAllow selection of hypervisor type in QA
Iustin Pop [Mon, 28 Jan 2008 10:45:01 +0000 (10:45 +0000)]
Allow selection of hypervisor type in QA

This patch allows the selection of the hypervisor type for the QA
process; this is useful when testing hypervisor-independent changes that
don't require a Xen setup.

The patch also fixes the OS name in the sample QA config file provided.

Reviewed-by: imsnah

16 years agoCheck that we have a valid export list
Guido Trotter [Mon, 28 Jan 2008 09:43:38 +0000 (09:43 +0000)]
Check that we have a valid export list

Before iterating over the list of exports present on a node, check that what
ganeti returned is actually a list. This solves the case when one of the nodes
is down, and an error value is returned.

This fixes issue 21

Reviewed-by: iustinp

16 years agoFix "gnt-instance modify --initrd"
Iustin Pop [Mon, 28 Jan 2008 09:02:02 +0000 (09:02 +0000)]
Fix "gnt-instance modify --initrd"

The new QA tests for instance modify uncovered a bug in the modify
initrd operation when setting the initrd to none.

Reviewed-by: imsnah

16 years agoFix gnt-instance modify breakage due to hvm_boot_order
Iustin Pop [Sun, 27 Jan 2008 17:10:39 +0000 (17:10 +0000)]
Fix gnt-instance modify breakage due to hvm_boot_order

As reported by hypnoce@gmail.com, this is missing a check on None. As we don't
care about uppercase, we keep the check simple by removing the lower() call.

Reviewed-by: ultrotter

16 years agoFix the make dist rule
Iustin Pop [Fri, 18 Jan 2008 16:08:26 +0000 (16:08 +0000)]
Fix the make dist rule

In revision 459 I added a bug in the make dist rule in the sense that
the archive will include *all* of test/data directory, including the
.svn directory if it exists.

This patch fixes that problem and adds a distcheck hook that tests for
such errors in the future (files/directories matching the .svn and .git
patterns).

It also fixes a typo in the NEWS file.

Reviewed-by: imsnah

16 years agoBump version numbers for the 1.2.1 release v1.2.1
Iustin Pop [Wed, 16 Jan 2008 15:11:53 +0000 (15:11 +0000)]
Bump version numbers for the 1.2.1 release

Reviewed-by: imsnah

16 years agoShow the HVM boot order in instance info
Iustin Pop [Wed, 16 Jan 2008 15:11:19 +0000 (15:11 +0000)]
Show the HVM boot order in instance info

Reviewed-by: imsnah

16 years agoTwo small style fixes
Iustin Pop [Wed, 16 Jan 2008 15:10:54 +0000 (15:10 +0000)]
Two small style fixes

Reviewed-by: imsnah

16 years agoMerge SVN commits 483..488 to the 1.2 branch
Iustin Pop [Wed, 16 Jan 2008 15:10:31 +0000 (15:10 +0000)]
Merge SVN commits 483..488 to the 1.2 branch

Reviewed-by: imsnah

16 years agoIntegrate svn revision 481 in the 1.2 branch
Guido Trotter [Fri, 11 Jan 2008 12:20:59 +0000 (12:20 +0000)]
Integrate svn revision 481 in the 1.2 branch

Reviewed-by: iustinp

16 years agoMerge svn revisions 471...475 into ganeti-1.2
Guido Trotter [Thu, 10 Jan 2008 14:36:46 +0000 (14:36 +0000)]
Merge svn revisions 471...475 into ganeti-1.2

The gnt-backup documentation fixes are relevant for version 1.2 too. Apply them
to the branch.

Reviewed-by: iustinp

16 years agoMerge revs 433..469 into the 1.2 branch
Iustin Pop [Wed, 9 Jan 2008 17:00:50 +0000 (17:00 +0000)]
Merge revs 433..469 into the 1.2 branch

Squashed commit of the following:

commit e692d5bd7d35dd049f3f01159a116b82d3e0b7b4
Author: Alexander Schreiber <schreiberal@gmail.com>
Date:   Wed Jan 9 13:02:21 2008 +0000

    Add boot_order entry to Instance object.

    First step to support custom boot device order for HVM instances, add a
    location to actually store that information for the instance.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@469 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 2da627cb541371f2241cb14b06ab30c8b7c657d6
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 16:16:43 2008 +0000

    Add the new OpCreateInstance parameters to burnin

    Reviewed-by: schreiberal

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@468 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit a3837015a4f1b049e8faff1c953ab761e01052ba
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 16:16:23 2008 +0000

    Fix gnt-instance modify breakage introduced in r462

    Reviewed-by: schreiberal

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@467 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit d9057cabda8f064b1d1f0bf0eb47ccc89427995f
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 11:04:21 2008 +0000

    Update manpages with the kernel/initrd options

    This patch modifes the ‘gnt-instance’ instance manpage with the new
    ‘--kernel’ and ‘--initrd’ options.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@466 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 7b70b7f0b5aef04f92550fde554affe2fae8376b
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 11:04:06 2008 +0000

    Change the Xen PVM to use the new kernel options

    This patch changes the hypervisor to use the new kernel and initrd
    instance attributes. They kernel is handled as expected (use the custom
    or the default one), but the initrd is treated a little bit special, in
    order to keep compatibility with previous behaviour:
      - if customized and not found, raise an error
      - if default and not found, do not use one

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@465 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit bffaf136bb99e63467f419f0692b92cfa08e5714
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 11:03:49 2008 +0000

    Make ‘gnt-instance info’ show kernel/initrd paths

    This patch changes the info subcommand to nicely show the kernel and
    initrd paths.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@464 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 5457df981ad8283834a8935aefb24c2bc9069854
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 11:03:30 2008 +0000

    Allow defining the kernel/initrd at creation time

    This patch adds support for defining the kernel/initrd at instance
    creation time, using the same interface as in instance modify.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@463 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit f536e1f1bb8d7bfc94f03fcf6c8d7a1a9119d87b
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 11:03:11 2008 +0000

    Add support for modifying the kernel/initrd path

    This patch adds support in ‘gnt-instance modify’ to set the kernel and
    initrd paths. The user can pass either 'default' or 'none' (none is not
    valid for kernel).

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@462 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 2905c2ece9e28d78920ef9df2fd46a9e7a076e3c
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Jan 8 11:02:30 2008 +0000

    Add kernel/initrd paths to the instance object

    This patch adds two new attributes to the instance object:
      - kernel_path
      - object_path

    The code ignores them and the configuration handling is not broken by
    this addition.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@461 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 34fecc72771ef7daa6cf7ff9363f3c3ff9638ed7
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Jan 7 16:34:46 2008 +0000

    Fix a typo in the ‘gnt-instance’ manpage

    Reviewed-by: schreiberal

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@460 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 4215af52a35a3623b1672fbf99edcc2c72f0934f
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Jan 7 16:34:19 2008 +0000

    Fix ‘make distcheck’ breakage introduced in r455

    This patch fixes the ‘make distcheck’ breakage caused by missing test data in
    the archive and missing handling of builddir!=srcdir case.

    Reviewed-by: schreiberal

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@459 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 4434d07a6d104dbf055e04594948fcd15a51423b
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Jan 7 13:30:29 2008 +0000

    Improve verify-disks: broken/missing LV detection

    This patch improves the ‘gnt-cluster verify-disks’ command by adding
    support for detecting broken volume groups and missing logical volume
    names.

    As such, we don't try anymore to activate disks for instances that are
    not likely to succeed anyway, and instead report them.

    Reviewed-by: schreiberal

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@458 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit b9f29ddfc982db5bf59655397fa866035f0be325
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Jan 7 13:29:02 2008 +0000

    Activate logical volumes at Assemble() time

    This patch changes the Assemble() method for logical volumes from a noop
    to do a `lvchange -ay` on the logical volume; this ensures that if the
    logical volume is not active, we are able to activate and use it.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@457 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit a73ea0d86ea23c2b1df0f42212a9eb2c3f18a895
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Jan 7 13:28:13 2008 +0000

    Improve speed of activating block devs

    This patch fixes the double attach operation in bdev.AttachOrAssemble,
    which was an indentation mistake in the first place.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@456 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 5d05c83ef17ee4523e2b71fbc15696a453afd573
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Jan 7 11:22:40 2008 +0000

    Add unittest for DRBD8 drdbsetup show parser

    This patch changes the bdev.DRBD8._GetDevInfo to take a string instead
    of a minor, separates the `drbdsetup show` invocation into a new
    separate method (bdev.DRBD8._GetShowData) and modifies the rest of the
    DRBD8 class to make the appropriate calls.

    It also adds a unittest script and data files for testing various cases
    of device output.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@455 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 1797a68e524f6ade53bac5118d9883e71fb52dfb
Author: Alexander Schreiber <schreiberal@gmail.com>
Date:   Fri Dec 28 10:05:49 2007 +0000

    Document variable MAC support to gnt-instance.

    Document the ability to set and change the MAC address for instances.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@454 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit b02fb72d5ef17e5ca2a8963197a75aa71ce6d77d
Author: schreiberal <schreiberal@a6b21a0d-9e31-0410-a73f-d369b950c04d>
Date:   Thu Dec 27 15:31:11 2007 +0000

    Allow instance MAC address to be set.

    Allow the MAC address of an instance to be specified optionally during
    instance creation and later to be changed via instance modify.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@453 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 9ac4534b27e31bb936aa0012ae898ca32368c41b
Author: schreiberal <schreiberal@a6b21a0d-9e31-0410-a73f-d369b950c04d>
Date:   Fri Dec 21 14:00:15 2007 +0000

    HVM proof-of-concept documentation

    Update documentation to document the HVM proof-of-concept.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@452 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 4afa472fd2d2cd7e7204a323d982e9817da3f751
Author: schreiberal <schreiberal@a6b21a0d-9e31-0410-a73f-d369b950c04d>
Date:   Thu Dec 20 16:47:52 2007 +0000

    Proof-of-Concept HVM support for Ganeti.

    This patch implements a first proof-of-concept for HVM support in Ganeti.
    Due to the nature of this patch, it is intended for test environments
    only.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@451 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit fc92f1eb05d43b5621275915c09c0403e381a5a5
Author: schreiberal <schreiberal@a6b21a0d-9e31-0410-a73f-d369b950c04d>
Date:   Thu Dec 20 13:59:30 2007 +0000

    Error handling for instance config file creation

    Wrap error handling around creating the instance config file.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@450 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 096950534e83773e9ee149a85889fa4e84c8d5c8
Author: schreiberal <schreiberal@a6b21a0d-9e31-0410-a73f-d369b950c04d>
Date:   Thu Dec 20 09:58:35 2007 +0000

    Use a generic Xen hypervisor interface.

    Abstract the parts of the Xen hypervisor interface shared by both PVM and
    HVM into a generic interface, subclass the special case PVM from that.

    Prepatch for adding HVM support.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@449 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 00a2845a00e3572f9b0fe7fb8a8eb763b7c0ee58
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 19 11:11:05 2007 +0000

    Make utils.RunCmd() deal with interleaved stdout/stderr

    Currently, RunCmd is written with the assumption that programs will have
    a small stderr output, therefore we read the child's stdout (which can
    be big, so we don't want to block the child) and then the stderr (which
    is small, so it shouldn't block).

    However, with the ‘gnt-cluster verify-disks’ command, we ourselves
    generate heavy stderr, therefore we break the ganeti-watcher which runs
    the verify-disks via utils.RunCmd.

    This patch turns the RunCmd command into an poll-based one, which means
    any kind of interleaved output by a child on stdout/stderr will be
    handled correctly. Of course, since the output is buffered in memory,
    there are other ways to break RunCmd(). But at least this should fix the
    common case.

    Reviewed-by: hansmi

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@448 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 8e6df0fe4ba1a6a8769a26a86591231f5f078109
Author: Alexander Schreiber <schreiberal@gmail.com>
Date:   Tue Dec 18 14:25:31 2007 +0000

    Internal API change for instance console access.

    Change the internal hypervisor API for GetShellCommandForConsole, we
    now call it with the instance instead of just the instance name.

    This is a prep patch for HVM, since HVM needs more than just the instance
    name to determine a way of console access.

    (this is a resend due to mail adress tyop)

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@447 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 53951532ba072fdcb61cb5c51538f97b544202b3
Author: Alexander Schreiber <schreiberal@gmail.com>
Date:   Tue Dec 18 14:05:11 2007 +0000

    cleanup for hypervisor constants

    Move constant definitions for hypervisor into constants.py

    Reviewed-by: ultrotter

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@446 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 1086209f9f889fcf357537bdcf74ac55b7800c08
Author: Guido Trotter <ultrotter@gmail.com>
Date:   Tue Dec 18 11:04:36 2007 +0000

    Specify hint as a named argument

    hint is declared as a named argument for the LogWarning function. Make its
    caller pass it naming it.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@445 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 5db0c4f28225785b658dca02a7d28525314d2e39
Author: Alexander Schreiber <schreiberal@gmail.com>
Date:   Mon Dec 17 14:53:35 2007 +0000

    Add instance port support.

    Extends the instance object by adding a port item, also adds changes
    to print this port via gnt-instance info.

    Reviewed-by: iustinp

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@444 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 6add91021c6ddafeca3951a6784397fbf0057a4e
Author: Iustin Pop <iustinp@gmail.com>
Date:   Mon Dec 17 14:50:23 2007 +0000

    Make note about minimum version of drbd 8 required

    Since 8.0.6 and lower have issues that break Ganeti's usage of drbd,
    this patch notes the required version of DRBD.

    Reviewed-by: ultrotter

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@443 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 99b843a942f505083d3811b0ded5e06f3611e2c1
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 12 15:18:10 2007 +0000

    Handle ^C while trying to acquire the lock

    When waiting for the lock and pressing ^C, the user will get a backtrace
    as the KeyboardInterrupt exception is not handled. The patch adds a
    simple method of handling it.

    Note that this is not about ^C in any other place.

    Reviewed-by: schreiberal,imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@441 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit d69fa648261be67e82df13891c399494b0d5b29a
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 12 13:13:49 2007 +0000

    Update the man page for ‘gnt-cluster’

    This adds some information about the new ‘verify-disks’ command.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@440 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 8684fde81e03e644fd6310262700e4f20920a075
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 12 13:13:38 2007 +0000

    Modify ‘ganeti-watcher’ to run verify-disks

    This patch modifies the watcher to run the ‘gnt-cluster verify-disks’
    command and to log its output (if any).

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@439 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 3d3e0821289abb7faa40e3bbcc353383c3695b19
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 12 13:13:27 2007 +0000

    Add the ‘gnt-cluster verify-disks’ command

    This patch adds the OpVerifyDisks handling in mcpu.py and the
    verify-disks command in the gnt-cluster script, which for every instance
    computed by LUVerifyDisks submits a new OpActivateInstanceDisks request.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@438 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit 573b4a5aefd6651dbb1108a57ecb846b7fa424e8
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 12 13:13:13 2007 +0000

    Add LUVerifyDisks

    This patch adds a new LUVerifyDisks that implements the OpVerifyDisks.
    The algorithm is that by determining not-used logical volumes for
    instances that are supposed to be running, we presume from there that
    the DRBD devices are not online and therefore one should
    ‘activate-disks’ for those instances.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@437 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit accd7a00b1375f63061ca4461099fe37f8a30159
Author: Iustin Pop <iustinp@gmail.com>
Date:   Wed Dec 12 13:13:02 2007 +0000

    Add a new OpVerifyDisks opcode

    This patch adds the definition of a new opcode that will be used to
    compute the list of instances with not-online disks.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@436 a6b21a0d-9e31-0410-a73f-d369b950c04d

commit c58b3735487746702cc7e393fc5ff895f9d3f236
Author: Iustin Pop <iustinp@gmail.com>
Date:   Tue Dec 11 16:25:02 2007 +0000

    Return more data in rpc.call_volume_list

    Currently, the volume_list call returns only the volume size. However,
    it is useful to also have two other things: the 'inactive' state of the
    volume (which might trigger a ‘vgchange -a y’ on the volume group) and
    the online state (which shows if the volume is in use or not).

    Since this modifies an RPC call, we also bump the protocol version,
    although the single user of the call didn't care about the dictionary
    values, only about the keys.

    Reviewed-by: imsnah

    git-svn-id: https://ganeti.googlecode.com/svn/trunk/ganeti@435 a6b21a0d-9e31-0410-a73f-d369b950c04d

This merge:
Reviewed-by: ultrotter, imsnah

16 years agoBranch ganeti-1.2 from trunk/ganeti v1.2.0
Iustin Pop [Tue, 4 Dec 2007 15:25:42 +0000 (15:25 +0000)]
Branch ganeti-1.2 from trunk/ganeti

Reviewed-by: imsnah

16 years agoBump version numbers for 1.2.0 release
Iustin Pop [Tue, 4 Dec 2007 15:20:31 +0000 (15:20 +0000)]
Bump version numbers for 1.2.0 release

Reviewed-by: imsnah

16 years agoOn OS creation errors, write logfile path to ganeti-noded's logfile.
Michael Hanselmann [Tue, 4 Dec 2007 11:21:58 +0000 (11:21 +0000)]
On OS creation errors, write logfile path to ganeti-noded's logfile.

Reviewed-by: schreiberal

16 years agoOutput reading fix for backend.NodeVolumes()
Alexander Schreiber [Tue, 4 Dec 2007 11:18:42 +0000 (11:18 +0000)]
Output reading fix for backend.NodeVolumes()

Use result.stdout instead of result.output to avoid potential confusion
by merged in error messages from stderr.

Reviewed-by: iustinp

16 years agoLog instance startup errors correctly
Iustin Pop [Tue, 4 Dec 2007 11:04:53 +0000 (11:04 +0000)]
Log instance startup errors correctly

Currently, the Hypervisor error raised on ‘xm create’ failure doesn't
contain the actual output from the command, thus what we log to the node
daemon log is not helpful enough. This patch fixes that.

Reviewed-by: schreiberal

16 years agoModify GetVolumeList so output on stderr from lvs doesn't break it.
Alexander Schreiber [Tue, 4 Dec 2007 10:37:08 +0000 (10:37 +0000)]
Modify GetVolumeList so output on stderr from lvs doesn't break it.

Reviewed-by: imsnah

16 years agoFix the unittest for locking.
Alexander Schreiber [Mon, 3 Dec 2007 14:32:24 +0000 (14:32 +0000)]
Fix the unittest for locking.

Reviewed-by: imsnah

16 years agoVarious code style fixes for strings.
Michael Hanselmann [Mon, 3 Dec 2007 14:03:26 +0000 (14:03 +0000)]
Various code style fixes for strings.

- When line wrapping is needed, move spaces to the next line.
- Remove embedded line breaks from error messages.

Reviewed-by: schreiberal

16 years agoAdd comment about PEP 318 to qa_utils.py.
Michael Hanselmann [Mon, 3 Dec 2007 13:54:56 +0000 (13:54 +0000)]
Add comment about PEP 318 to qa_utils.py.

Reviewed-by: iustinp

16 years agoRemove DRBD version from SECURITY document.
Michael Hanselmann [Mon, 3 Dec 2007 13:54:33 +0000 (13:54 +0000)]
Remove DRBD version from SECURITY document.

Reviewed-by: schreiberal

16 years agoRemove orphaned closing tag.
Alexander Schreiber [Fri, 30 Nov 2007 13:15:47 +0000 (13:15 +0000)]
Remove orphaned closing tag.

Reviewed-by: iustinp

16 years agoFix parsing of drbdsetup show output
Iustin Pop [Fri, 30 Nov 2007 10:22:56 +0000 (10:22 +0000)]
Fix parsing of drbdsetup show output

This fixes the parsing of integers in the drbdsetup show output with
newer pyparsing versions.

Basically, the convert-to-int action that we use was taken from the
example documentation of an older pyparsing version that automatically
uses only the second element if the result is returned as a tuple, but
this was deprecated for a while and removed in 1.4.3.

Based on a nice report by Jorge Cabello <jorge@aspl.es>, and
confirmation about pyparsing behaviour from its author. Thanks!

Reviewed-by: imsnah

16 years agoReplace hardcoded lock dir
Iustin Pop [Thu, 29 Nov 2007 16:52:22 +0000 (16:52 +0000)]
Replace hardcoded lock dir

This patch replaces the hardcoded ‘/var/lock/’ directory with one based on
LOCALSTATEDIR.

Reviewed-by: imsnah

16 years agoMake utils.RunCmd log failures when using debug
Iustin Pop [Thu, 29 Nov 2007 16:03:23 +0000 (16:03 +0000)]
Make utils.RunCmd log failures when using debug

This patch adds logging of command failures to the debug log in case the
user either started the command (gnt-*) or the node daemon with the
debug flag.

Reviewed-by: imsnah

16 years agoFix the ganeti-os-interface manpage
Guido Trotter [Wed, 28 Nov 2007 18:35:21 +0000 (18:35 +0000)]
Fix the ganeti-os-interface manpage

lexgrog cannot parse the current ganeti-os-interface.7 manpage, which in turn
leads to a lintian warning. In order to fix this the NAME section must have the
standard format which doesn't allow multiple words in the first field.

Reviewed-by: iustinp

16 years agoUpdate version numbers for release 1.2b3 v1.2b3
Iustin Pop [Wed, 28 Nov 2007 12:17:15 +0000 (12:17 +0000)]
Update version numbers for release 1.2b3

Reviewed-by: imsnah

16 years agoFix logging of some checks in LUClusterVerify
Iustin Pop [Tue, 27 Nov 2007 14:15:17 +0000 (14:15 +0000)]
Fix logging of some checks in LUClusterVerify

Currently, the results of ConfigWriter.VerifyConfig() are lost. Make
sure we log them too in cluster verify.

Reviewed-by: ultrotter

16 years agoUpdate install.sgml with the name of the example OS
Iustin Pop [Tue, 27 Nov 2007 13:07:44 +0000 (13:07 +0000)]
Update install.sgml with the name of the example OS

We want the name of the example OS to be nicer for packagers, so update
the install documentation accordingly.

Also, put in a notice about using the latest release OS version, so if
we forget to update this doc, we are not completely wrong.

Reviewed-by: schreiberal

16 years agoRevert "Remove extra docdir variable from Makefile.am"
Iustin Pop [Mon, 26 Nov 2007 16:00:03 +0000 (16:00 +0000)]
Revert "Remove extra docdir variable from Makefile.am"

This reverts commit 397, as the support in autoconf for docdir is
present since 2.59c, and this is too new for some distributions.

Reviewed-by: imsnah

16 years agoAdd checking of python modules at ./configure time
Iustin Pop [Mon, 26 Nov 2007 15:48:37 +0000 (15:48 +0000)]
Add checking of python modules at ./configure time

This patch adds checking for our external python modules at the
./configure stage, as it's better to check than rely on documentation.

The patch adds one autoconf macro from the autoconf macro archive
(http://autoconf-archive.cryp.to)

Reviewed-by: imsnah

16 years agoDrop the Rename method of DRBD8 devices
Iustin Pop [Mon, 26 Nov 2007 08:39:02 +0000 (08:39 +0000)]
Drop the Rename method of DRBD8 devices

Since we now do changes of remote peers in two steps (Attach with no
network information and then Attach with the new peer's data), we don't
need this operation anymore.

Reviewed-by: imsnah

16 years agoSplit the change of peer in secondary replace in two operations
Iustin Pop [Mon, 26 Nov 2007 08:38:47 +0000 (08:38 +0000)]
Split the change of peer in secondary replace in two operations

This patch splits the single operation of replace peer into two distinct
phases, in order to make a single change to the instance configuration:
  - detach from network
  - if at least one drbd device succeeded, make one change to the
    instance, pointing all disks to the new peer
  - attach to the new peer

This should eliminate the case when a failure in the second reattach can
leave the instance with two secondaries.

Reviewed-by: imsnah

16 years agoRelax even more the identification of DRBD8 devices
Iustin Pop [Mon, 26 Nov 2007 08:38:32 +0000 (08:38 +0000)]
Relax even more the identification of DRBD8 devices

This patch adds a new success condition for identifying DRBD8 devices:
if the local device is correct, but the network peer is not, we shutdown
the network and attach to the correct one (this also handles going to
standalone mode).

This new check (and its actions) is based on the fact that we don't pass
incorrect data from the master to the node (otherwise we could start
syncing with an incorrect peer.

Reviewed-by: imsnah

16 years agoAdd support for DRBD8 devices to work standalone
Iustin Pop [Mon, 26 Nov 2007 08:38:12 +0000 (08:38 +0000)]
Add support for DRBD8 devices to work standalone

This patch adds a check in _AssembleNet so that if we are passed None
value in the unique_id, we instead switch to standalone mode.

Reviewed-by: imsnah

16 years agoCall more hooks during QA tests.
Michael Hanselmann [Thu, 22 Nov 2007 14:11:26 +0000 (14:11 +0000)]
Call more hooks during QA tests.

Reviewed-by: schreiberal

16 years agoSort list returned by ListVisibleFiles.
Michael Hanselmann [Thu, 22 Nov 2007 14:10:53 +0000 (14:10 +0000)]
Sort list returned by ListVisibleFiles.

If we didn't sort this list, files would be in arbitrary order.

Reviewed-by: iustinp

16 years agoAdd man page for the ganeti-master script
Iustin Pop [Thu, 22 Nov 2007 13:51:35 +0000 (13:51 +0000)]
Add man page for the ganeti-master script

This patch adds a simple man page for the master startup script and
modifies the footer.sgml fragment to include it.

Reviewed-by: imsnah

16 years agoCreate /var/run/ganeti before noded startup
Iustin Pop [Thu, 22 Nov 2007 13:51:17 +0000 (13:51 +0000)]
Create /var/run/ganeti before noded startup

The /var/run directory can be a tmpfs mount, so even if we make it at
install time (or include it in the package) it can go away. Therefore,
test for its existence and create it in the startup script.

Reviewed-by: imsnah

16 years agoRemove extra docdir variable from Makefile.am
Iustin Pop [Thu, 22 Nov 2007 13:51:02 +0000 (13:51 +0000)]
Remove extra docdir variable from Makefile.am

The docdir variable is defined by autoconf, so we don't need to define
it ourselves. This way, the target documentation directory can
be changed via ./configure instead of patching Makefile.am.

In truth, we should install the pdf and html files using the pdf and
html targets, since configure defines pdfdir=htmldir=docdir; but
installing them in docdir is good enough.

Reviewed-by: imsnah

16 years agoList loading hooks in QA.
Michael Hanselmann [Thu, 22 Nov 2007 12:17:07 +0000 (12:17 +0000)]
List loading hooks in QA.

Reviewed-by: schreiberal

16 years agoAdd hook for logging.
Michael Hanselmann [Thu, 22 Nov 2007 11:25:45 +0000 (11:25 +0000)]
Add hook for logging.

This may help to debug problems in QA tests.

Reviewed-by: schreiberal

16 years agoAbort if tests for disk templates remote_raid1 and drbd are enabled.
Michael Hanselmann [Wed, 21 Nov 2007 16:58:01 +0000 (16:58 +0000)]
Abort if tests for disk templates remote_raid1 and drbd are enabled.

Reviewed-by: iustinp

16 years agoFlush stdout after printing a message during burnin.
Michael Hanselmann [Wed, 21 Nov 2007 16:57:28 +0000 (16:57 +0000)]
Flush stdout after printing a message during burnin.

Reviewed-by: iustinp

16 years agoImplement disk templates for burnin from QA.
Michael Hanselmann [Wed, 21 Nov 2007 16:56:49 +0000 (16:56 +0000)]
Implement disk templates for burnin from QA.

Reviewed-by: iustinp

16 years agoReplace disk template drbd8 with drbd where missing.
Michael Hanselmann [Wed, 21 Nov 2007 16:55:48 +0000 (16:55 +0000)]
Replace disk template drbd8 with drbd where missing.

Reviewed-by: iustinp

16 years agoCode style fixes for burnin.
Michael Hanselmann [Wed, 21 Nov 2007 15:29:43 +0000 (15:29 +0000)]
Code style fixes for burnin.

Reviewed-by: iustinp

16 years agoAdd two comments to qa-sample.yaml.
Michael Hanselmann [Wed, 21 Nov 2007 15:29:13 +0000 (15:29 +0000)]
Add two comments to qa-sample.yaml.

Reviewed-by: iustinp

16 years agoFix logging in drbd _ShutdownNet method
Iustin Pop [Wed, 21 Nov 2007 11:34:36 +0000 (11:34 +0000)]
Fix logging in drbd _ShutdownNet method

We didn't test for failure, just always logged the output.

Reviewed-by: imsnah

16 years agoCorrect the -s parameter in gnt-node output
Iustin Pop [Wed, 21 Nov 2007 09:36:42 +0000 (09:36 +0000)]
Correct the -s parameter in gnt-node output

This fixed the previous commit (-s => -s ip).

Reviewed-by: ultrotter

16 years agoAdd the -s option in the output of 'gnt-node'
Iustin Pop [Wed, 21 Nov 2007 09:15:39 +0000 (09:15 +0000)]
Add the -s option in the output of 'gnt-node'

Since on dual-homed clusters one always needs to add '-s' to the
gnt-node add command, make this appear in the output of 'gnt-node' (when
run without arguments).

Reviewed-by: imsnah

16 years agoAdd description of “gnt-instance startup --force” to manpage.
Michael Hanselmann [Tue, 20 Nov 2007 14:49:34 +0000 (14:49 +0000)]
Add description of “gnt-instance startup --force” to manpage.

This was reported by Henning Sprang in issue #14. Also add a missing word
in the description of “gnt-instance reboot”.

Reviewed-by: iustinp

16 years agoMake sure aliases written to /etc/hosts are unique.
Michael Hanselmann [Tue, 20 Nov 2007 09:18:27 +0000 (09:18 +0000)]
Make sure aliases written to /etc/hosts are unique.

Reviewed-by: iustinp

16 years agoAdd function to return list with unique elements.
Michael Hanselmann [Tue, 20 Nov 2007 09:17:58 +0000 (09:17 +0000)]
Add function to return list with unique elements.

Reviewed-by: ultrotter

16 years agoAdd basic QA tests for DRBD 8.
Michael Hanselmann [Mon, 19 Nov 2007 18:38:14 +0000 (18:38 +0000)]
Add basic QA tests for DRBD 8.

Reviewed-by: schreiberal

16 years agoFix a typo in a warning message
Guido Trotter [Fri, 16 Nov 2007 18:36:23 +0000 (18:36 +0000)]
Fix a typo in a warning message

Reviewed-by: schreiberal

16 years agoDon't remove master's hostname from /etc/hosts on cluster destroy.
Michael Hanselmann [Fri, 16 Nov 2007 14:28:53 +0000 (14:28 +0000)]
Don't remove master's hostname from /etc/hosts on cluster destroy.

This fixes issue #13.

Reviewed-by: schreiberal

16 years agoUse spaces to indent and fix typo in tag.
Michael Hanselmann [Fri, 16 Nov 2007 14:28:14 +0000 (14:28 +0000)]
Use spaces to indent and fix typo in tag.

Reviewed-by: schreiberal

16 years agoFix typo in function name.
Michael Hanselmann [Fri, 16 Nov 2007 12:43:14 +0000 (12:43 +0000)]
Fix typo in function name.

Reviewed-by: schreiberal

16 years agoSuggest disabling of automatic xen domain save
Guido Trotter [Thu, 15 Nov 2007 06:08:35 +0000 (06:08 +0000)]
Suggest disabling of automatic xen domain save

By default xen tries to save running virtual machines at system shutdown and
restore them at reboot. Make sure we suggest to disable this feature in the
installation manual.

Reviewed-by: iustinp

16 years agoComplete the apt-get list in the install manual
Guido Trotter [Thu, 15 Nov 2007 06:04:31 +0000 (06:04 +0000)]
Complete the apt-get list in the install manual

The install manual was missing python-pyparsing and python-simplejson from the
apt-get install list. Adding them.

Thanks to Henning Sprang for spotting this issue.

Reviewed-by: iustinp

16 years agoWhen an assembly error occurs log it too
Guido Trotter [Wed, 14 Nov 2007 21:52:44 +0000 (21:52 +0000)]
When an assembly error occurs log it too

Right now an assembly error produces an exception but not a log message. This
is bad because the exception suggests looking at the log, but the log itself
has a lot of errors which are not really a problem and only some which really
is. In order to make it clear where in the log the problem occurred we log a
message too, before raising the exception.

Reviewed-by: iustinp

16 years agoUse setUp/tearDown for tests using temporary files.
Michael Hanselmann [Wed, 14 Nov 2007 15:56:03 +0000 (15:56 +0000)]
Use setUp/tearDown for tests using temporary files.

Reviewed-by: schreiberal

16 years agoWrap line longer than 80 characters.
Michael Hanselmann [Wed, 14 Nov 2007 15:55:38 +0000 (15:55 +0000)]
Wrap line longer than 80 characters.

Reviewed-by: ultrotter

16 years agoCompare file contents directly in unittests.
Michael Hanselmann [Wed, 14 Nov 2007 15:55:13 +0000 (15:55 +0000)]
Compare file contents directly in unittests.

Reviewed-by: schreiberal, ultrotter

16 years agoGive more details on errors when trying to run “lvdisplay”.
Michael Hanselmann [Wed, 14 Nov 2007 14:05:26 +0000 (14:05 +0000)]
Give more details on errors when trying to run “lvdisplay”.

Reviewed-by: schreiberal

16 years agoCreate /var/run/ganeti directory on “make install”.
Michael Hanselmann [Wed, 14 Nov 2007 14:05:08 +0000 (14:05 +0000)]
Create /var/run/ganeti directory on “make install”.

Reviewed-by: schreiberal

16 years agoBump version numbers. v1.2b2
Michael Hanselmann [Tue, 13 Nov 2007 23:03:20 +0000 (23:03 +0000)]
Bump version numbers.

Reviewed-by: iustinp

16 years agoRun ganeti-watcher script from QA code instead of cron.
Michael Hanselmann [Tue, 13 Nov 2007 19:31:54 +0000 (19:31 +0000)]
Run ganeti-watcher script from QA code instead of cron.

This makes the tests much more reliably because it avoids race conditions.
It also helps to speed them up a lot.

Reviewed-by: iustinp

16 years agoSmall changes and fixes in ganeti-watcher.
Michael Hanselmann [Tue, 13 Nov 2007 19:31:25 +0000 (19:31 +0000)]
Small changes and fixes in ganeti-watcher.

- Use constants for keys.
- Fix bug through which automatic instance restarts wouldn't be limited

Reviewed-by: iustinp

16 years agoFix call to TestInstanceConsecutiveFailures.
Michael Hanselmann [Tue, 13 Nov 2007 19:30:52 +0000 (19:30 +0000)]
Fix call to TestInstanceConsecutiveFailures.

Reviewed-by: iustinp

16 years agoFix unittests broken by revision 360.
Michael Hanselmann [Tue, 13 Nov 2007 15:39:49 +0000 (15:39 +0000)]
Fix unittests broken by revision 360.

Reviewed-by: schreiberal

16 years agoFix --node option for “gnt-backup list”.
Michael Hanselmann [Tue, 13 Nov 2007 15:04:01 +0000 (15:04 +0000)]
Fix --node option for “gnt-backup list”.

Reviewed-by: iustinp

16 years agoFix a wrong comparison in _RecursiveAssembleBD
Iustin Pop [Mon, 12 Nov 2007 23:11:48 +0000 (23:11 +0000)]
Fix a wrong comparison in _RecursiveAssembleBD

We want to prevent sending too many 'None' children to a device.
However, the test as it is today is wrong, as we want to test the
situation after adding a new child, and not before. This patch fixes
this by testing greater-or-equal instead of just greater.

Reviewed-by: imsnah

16 years agoFix another breakage in SetEtcHostsEntry
Iustin Pop [Mon, 12 Nov 2007 23:11:25 +0000 (23:11 +0000)]
Fix another breakage in SetEtcHostsEntry

The code assumes all lines have at least two elements which are
whitespace separated - i.e. it does not deal with empty lines or comment
lines with no spaces. This patch fixes this.

Also, the patch replaces the blank between IP and the canonical name
with a tab (restoring previous behaviour).

Reviewed-by: imsnah

16 years agoCall fsync() after modifying /etc/hosts.
Michael Hanselmann [Mon, 12 Nov 2007 17:10:18 +0000 (17:10 +0000)]
Call fsync() after modifying /etc/hosts.

This is a critical file. Breaking it would be very bad. Thus, if the system
crashes before the data is synched to the disk, it should have the complete
file afterwards.

Reviewed-by: iustinp

16 years agoFix functions for /etc/hosts.
Michael Hanselmann [Mon, 12 Nov 2007 17:09:49 +0000 (17:09 +0000)]
Fix functions for /etc/hosts.

- Combine hostname and aliases on one line
- Fix bug with wrongfully removed newline characters
- Use wrapper for SetEtcHostsEntry in cmdlib

Reviewed-by: iustin

16 years agoRollback commit 356.
Michael Hanselmann [Mon, 12 Nov 2007 17:03:50 +0000 (17:03 +0000)]
Rollback commit 356.

16 years agoAdd functions for known_hosts files.
Michael Hanselmann [Mon, 12 Nov 2007 16:44:28 +0000 (16:44 +0000)]
Add functions for known_hosts files.

Reviewed-by: TODO

16 years agoAdd missing descriptions to {Add,Remove}EtcHostsEntry.
Michael Hanselmann [Mon, 12 Nov 2007 10:57:07 +0000 (10:57 +0000)]
Add missing descriptions to {Add,Remove}EtcHostsEntry.

Reviewed-by: schreiberal

16 years agoRelax replace_disks_all meaning for drbd8
Iustin Pop [Mon, 12 Nov 2007 03:56:03 +0000 (03:56 +0000)]
Relax replace_disks_all meaning for drbd8

In order to make the replace secondary action to be done via the same
opcode parameters for both remote_raid1 and drbd, we must allow the
LUReplaceDisks to change replace_disks_all for drbd with non-empty
remote_node into replace_disks_sec.

This fixes gnt-node evacuate and also allows gnt-instace replace-disks
to have the same syntax for both remote_raid1 and drbd (when replacing
the secondary).

Reviewed-by: ultrotter