ganeti-local
13 years agoAdding backend functionality to call oob helper
René Nussbaumer [Wed, 1 Dec 2010 10:08:47 +0000 (11:08 +0100)]
Adding backend functionality to call oob helper

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

13 years agoAdding ndparams to gnt-cluster init|modify and man page
René Nussbaumer [Tue, 30 Nov 2010 09:20:48 +0000 (10:20 +0100)]
Adding ndparams to gnt-cluster init|modify and man page

This is reverting the revert and adaption to fix the issue which caused
the revert

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

13 years agoMerge branch 'devel-2.3'
Michael Hanselmann [Wed, 1 Dec 2010 13:13:57 +0000 (14:13 +0100)]
Merge branch 'devel-2.3'

* devel-2.3:
  Correct version check for release candidates
  config.py: need explicit %-formatting in errors.OpPrereqError.
  Fix version check
  Add script to check version format

Conflicts:
Makefile.am

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

13 years agoMerge branch 'devel-2.2' into devel-2.3
Michael Hanselmann [Tue, 30 Nov 2010 18:26:46 +0000 (19:26 +0100)]
Merge branch 'devel-2.2' into devel-2.3

* devel-2.2:
  Correct version check for release candidates
  Fix version check
  Add script to check version format

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

13 years agoCorrect version check for release candidates
Michael Hanselmann [Tue, 30 Nov 2010 17:50:44 +0000 (18:50 +0100)]
Correct version check for release candidates

The tilde needs to be escaped and I forgot the space which should be
used instead.

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

13 years agoconfig.py: need explicit %-formatting in errors.OpPrereqError.
Adeodato Simo [Tue, 30 Nov 2010 16:05:47 +0000 (16:05 +0000)]
config.py: need explicit %-formatting in errors.OpPrereqError.

Signed-off-by: Adeodato Simo <dato@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoTrivial style fixes
Adeodato Simo [Tue, 30 Nov 2010 15:01:25 +0000 (15:01 +0000)]
Trivial style fixes

Add missing closing brackets and fix a typo.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFurther cleanups on QA
Iustin Pop [Mon, 29 Nov 2010 14:47:06 +0000 (14:47 +0000)]
Further cleanups on QA

This is more of an RFC. The patch attempts to address two issues:

- running conditional tests is ugly right now
- we don't know what tests we skipped

By using the new RunTestIf, we solve both. But a significant number of
test decisions are more complex than just “is test enabled”, so those
remain to be run via RunTest, which means we don't get logging of when
they're not run. Hence the logging is not complete… Sugesstions on how
to solve it are welcome.

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

13 years agoCheck for editor-specific settings at build time
Michael Hanselmann [Mon, 29 Nov 2010 18:54:29 +0000 (19:54 +0100)]
Check for editor-specific settings at build time

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

13 years agoRemove editor-specific settings from cfgupgrade*
Michael Hanselmann [Mon, 29 Nov 2010 18:55:14 +0000 (19:55 +0100)]
Remove editor-specific settings from cfgupgrade*

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

13 years agoAdd OpQuery opcode
Michael Hanselmann [Fri, 19 Nov 2010 20:32:19 +0000 (21:32 +0100)]
Add OpQuery opcode

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

13 years agoLUQueryNodes: Convert to new query model
Michael Hanselmann [Fri, 19 Nov 2010 20:25:51 +0000 (21:25 +0100)]
LUQueryNodes: Convert to new query model

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

13 years agocmdlib: Add base for query classes
Michael Hanselmann [Fri, 19 Nov 2010 20:26:04 +0000 (21:26 +0100)]
cmdlib: Add base for query classes

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

13 years agoAdd node query definition
Michael Hanselmann [Fri, 12 Nov 2010 15:17:43 +0000 (16:17 +0100)]
Add node query definition

This includes a bunch of helper functions which can be helpful for other
queries, too. Unittests are included.

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

13 years agoAdd simple query filter parser
Michael Hanselmann [Fri, 19 Nov 2010 19:41:26 +0000 (20:41 +0100)]
Add simple query filter parser

This parser reads only the format described by the query2
design document: either an empty filter or an OR operator
with equality checks as operands.

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

13 years agoAdd utility class for definition-based data queries
Michael Hanselmann [Fri, 22 Oct 2010 17:40:07 +0000 (19:40 +0200)]
Add utility class for definition-based data queries

While not immediately visible, using definition-based queries will allow
for a number of optimizations and simplifications. This patch just
contains the utility class used for executing queries.

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

13 years agoAdd query constants
Michael Hanselmann [Fri, 12 Nov 2010 17:28:01 +0000 (18:28 +0100)]
Add query constants

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

13 years agobootstrap: Set master node's {c,m}time on cluster init
Michael Hanselmann [Mon, 29 Nov 2010 19:16:23 +0000 (20:16 +0100)]
bootstrap: Set master node's {c,m}time on cluster init

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

13 years agoQA: Fix upload of RAPI users file
Michael Hanselmann [Mon, 29 Nov 2010 18:25:54 +0000 (19:25 +0100)]
QA: Fix upload of RAPI users file

After moving the users file to a directory, we must ensure the
directory exists.

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

13 years agoRAPI: Implement OS parameters for instance reinstallation
Michael Hanselmann [Thu, 25 Nov 2010 21:02:38 +0000 (22:02 +0100)]
RAPI: Implement OS parameters for instance reinstallation

Dictionaries are hard to encode into query strings, therefore the
“/2/instances/[instance_name]/reinstall” resource is changed to accept
its parameters via the request body. The old query string parameters are
still accepted for backwards compatibility.

To allow clients to detect whether a server supports the new body
parameters, a new feature string is added to the “/2/features” resource.
Some people might not like this, but it reuses existing functionality.

The RAPI client and its unittests are updated.

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

13 years agoRevert "InitCluster support for ndparams"
Michael Hanselmann [Mon, 29 Nov 2010 17:41:29 +0000 (18:41 +0100)]
Revert "InitCluster support for ndparams"

This reverts commit fd7f5b411ca61be2e4eff638773ba6c0fac7eb32.

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

13 years agoRevert "Adding ndparams to gnt-cluster init|modify and man page"
Michael Hanselmann [Mon, 29 Nov 2010 17:40:14 +0000 (18:40 +0100)]
Revert "Adding ndparams to gnt-cluster init|modify and man page"

This reverts commit cb1ef9736dec68d6786359bc7d019f0bbee48c61. QA was
broken by this commit.

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

13 years agoMove “rapi_users” file into separate directory
Michael Hanselmann [Wed, 24 Nov 2010 17:37:07 +0000 (18:37 +0100)]
Move “rapi_users” file into separate directory

This reduces the number of notifications in “ganeti-rapi”. Until now it
was notified for every change in …/lib/ganeti and had to check whether
the users file was affected. A symlink is always created in cfgupgrade
to not break tools referring to the old name.

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

13 years agoobjects: Add QueryFieldDefinition
Michael Hanselmann [Fri, 12 Nov 2010 17:28:13 +0000 (18:28 +0100)]
objects: Add QueryFieldDefinition

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

13 years agoIncrease timeout for connection on remote import
Michael Hanselmann [Thu, 25 Nov 2010 19:47:44 +0000 (20:47 +0100)]
Increase timeout for connection on remote import

The source cluster has to shut down an instance before it can be
exported. Doing so can take a while, but the default connection timeout
is only 60 seconds. Adding the shutdown timeout on the receiving cluster
should help.

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

13 years agoUse IPv6 for import/export
Michael Hanselmann [Thu, 25 Nov 2010 17:21:40 +0000 (18:21 +0100)]
Use IPv6 for import/export

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

13 years agobackend: Add support for IPv6 in import/export
Michael Hanselmann [Thu, 25 Nov 2010 17:21:05 +0000 (18:21 +0100)]
backend: Add support for IPv6 in import/export

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

13 years agoimpexpd: Implement support for IPv6
Michael Hanselmann [Thu, 25 Nov 2010 17:20:35 +0000 (18:20 +0100)]
impexpd: Implement support for IPv6

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

13 years agoAdding ndparams to gnt-cluster init|modify and man page
René Nussbaumer [Fri, 26 Nov 2010 14:04:34 +0000 (15:04 +0100)]
Adding ndparams to gnt-cluster init|modify and man page

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

13 years agoAdding ndparams to gnt-node add|modify and man page
René Nussbaumer [Thu, 25 Nov 2010 15:15:44 +0000 (16:15 +0100)]
Adding ndparams to gnt-node add|modify and man page

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

13 years agoAdd node parameters to ganeti(7)
René Nussbaumer [Mon, 29 Nov 2010 10:01:58 +0000 (11:01 +0100)]
Add node parameters to ganeti(7)

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

13 years agoInitCluster support for ndparams
René Nussbaumer [Mon, 29 Nov 2010 10:10:14 +0000 (11:10 +0100)]
InitCluster support for ndparams

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

13 years agoSimplify QA commands
Iustin Pop [Mon, 29 Nov 2010 02:34:57 +0000 (02:34 +0000)]
Simplify QA commands

Currently, 95% of the QA commands are executed in the same way: on the
master, based on a command list and with expectancies for succes:

    AssertEqual(StartSSH(master['primary'],
                         utils.ShellQuoteArgs(cmd)).wait(), 0)

The rest 5% are variations on this theme (maybe the command needs to
fail, or the node is different, etc.). Based on this, we can simplify
the code significantly if we abstract the common theme into a new
AssertCommand() function. This saves ~250 lines of code in the QA suite,
around 8% of the entire QA code size.

Additionally, the output was very cryptic before (the famous "QA error:
1 != 0" messages), whereas now we show a clear error message (node,
command, exit code and failure mode).

The patch replaces single quotes with double quotes in all the parts of
the code that I touch; let me know if that's not OK…

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

13 years agoFix typo in _ANS1_TIME_REGEX
Iustin Pop [Sun, 28 Nov 2010 14:47:41 +0000 (14:47 +0000)]
Fix typo in _ANS1_TIME_REGEX

Thanks Balasz!

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

13 years agoImprove unittests for the utils module
Iustin Pop [Sat, 27 Nov 2010 18:58:24 +0000 (18:58 +0000)]
Improve unittests for the utils module

This just a random collection of unittest improvements. Coverage
increases from 73% to 76%.

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

13 years agoMove compilation of some regexes to init time
Iustin Pop [Sat, 27 Nov 2010 18:07:19 +0000 (18:07 +0000)]
Move compilation of some regexes to init time

I have found a few regexes which are static and thus can be moved to
load time, rather than run time, creation.

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

13 years agoFix breakage from previous commit e695efb
Iustin Pop [Sat, 27 Nov 2010 17:34:20 +0000 (17:34 +0000)]
Fix breakage from previous commit e695efb

Wrong file name in Makefile.am and wrong naming (.unittest vs
_unittest).

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

13 years agoAdd missing paramter and unittests for this case
Iustin Pop [Sat, 27 Nov 2010 16:21:49 +0000 (16:21 +0000)]
Add missing paramter and unittests for this case

While git-am'ing the blockdev_prefix patch, I modified the hv_xen.py
file but forgot to amend the patch :(, so here it is.

Furthermore, to detect such inconsistencies in the future, a unittest is
added that cross-checks the default parameters in constants.py and the
hypervisor PARAMETERS dict.

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

13 years agoAdding blockdev_prefix to hypervisor options
Maciej Bliziński [Fri, 26 Nov 2010 17:40:07 +0000 (17:40 +0000)]
Adding blockdev_prefix to hypervisor options

Allows to install Red Hat based systems, for example Oracle Linux.
Tested with OEL.

The hypervisor by default offers a device named 'sda'.  If the SCSI
module is already loaded, the disk device can't be created due to naming
conflict, and the disk is not available.  A workaround is to modify the
initrd by removing the scsi driver from it.  This helps, but doesn't
allow to install the OS.

Red Hat's installer, anaconda, runs parted, which tries to execute a
check against /dev/sda and fails.  This makes anaconda think that the
disk is faulty, and not available.  The best way to work around this, is
to declare 'xvda' as the xen disk device.  Red Hat version of parted
package contains a patch which makes parted skip the SCSI test if device
name starts with 'xvd'.

This patch allows to pass -H xen-pvm:blockdev_prefix="xvd" and
successfully run the Red Hat installer.

Signed-off-by: Maciej Bliziński <blizinski@google.com>
[iustin@google.com: added the new parameter to XenHvm PARAMS]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRPC call_node_info: change protocol
Iustin Pop [Fri, 26 Nov 2010 18:42:39 +0000 (18:42 +0000)]
RPC call_node_info: change protocol

Currently, the call_node_info RPC does always check both the VG free
space and the hypervisor information. However, in ⅔ of the uses, we only
care about one or the other. Therefore, we change it so that if any of
the passed parameters is None, we don't perform the respective check. We
also modify its callers to only pass in what they need.

This also helps if the "default" hypervisor is broken and we want to
create an instance for another hypervisor.

With this patch, the duration of this rpc changes from 500ms to 90ms for
a normal LVM+Xen PVM node, when we only require the LVM data; when we
only require the hypervisor data, it doesn't change (as the “xm list”
time is dominant).

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

13 years agoasyncnotifier tests: simplify the setup code
Iustin Pop [Fri, 26 Nov 2010 16:23:32 +0000 (16:23 +0000)]
asyncnotifier tests: simplify the setup code

First change is to replace "range(len(self.NOTIFIERS)))" with
self.NOTIFIERS, as range(len(range(N))) ≡ range(N).

Sencond change is switch from an explicit indexing to use of zip.
Unittests still pass :)

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

13 years agoCluster rename: skip offline nodes
Iustin Pop [Fri, 26 Nov 2010 15:25:30 +0000 (15:25 +0000)]
Cluster rename: skip offline nodes

This only tries to upload the ssh_known_hosts_file to the online nodes,
eliminating a timeout and warning for offline nodes.

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

13 years agoFix missed CheckArguments on ndparams for SetNodeParams
René Nussbaumer [Thu, 25 Nov 2010 14:00:04 +0000 (15:00 +0100)]
Fix missed CheckArguments on ndparams for SetNodeParams

In the previous patch where I modified LUSetNodeParams to take ndparams
into account I missed this additional check of parameters in the Logical
Unit. This patch adds ndparams to the recognized parameter lists which
has to be filled out if nothing else is.

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

13 years agoThe default value for ndparams should be None not {}
René Nussbaumer [Thu, 25 Nov 2010 15:11:44 +0000 (16:11 +0100)]
The default value for ndparams should be None not {}

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

13 years agoFix per-vg checks in instance disk conversion
Iustin Pop [Thu, 25 Nov 2010 13:40:30 +0000 (13:40 +0000)]
Fix per-vg checks in instance disk conversion

Since we now have just two possibilities (plaint to drbd or drbd to
plain), we can assume (+an assert) that we come from LVM and access
directly logical_id[0] for the VG on which it is stored.

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

13 years agoFix version check
Michael Hanselmann [Wed, 24 Nov 2010 19:50:46 +0000 (20:50 +0100)]
Fix version check

Don't ask … all I say is distcheck.

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

13 years agoRemoved _CheckNodesFreeDisk function
Dmitry Chernyak [Thu, 25 Nov 2010 00:14:39 +0000 (03:14 +0300)]
Removed _CheckNodesFreeDisk function

Was substituted by _CheckNodesFreeDiskPerVG.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMake instance creation VG-aware
Dmitry Chernyak [Thu, 25 Nov 2010 00:14:38 +0000 (03:14 +0300)]
Make instance creation VG-aware

Also should work disk growing, instance moving and prerequisite checks.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
[iustin@google.com: small style fixes]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoIntroduced VG-aware disk space checks
Dmitry Chernyak [Thu, 25 Nov 2010 00:14:37 +0000 (03:14 +0300)]
Introduced VG-aware disk space checks

Implemented _CheckNodesFreeDiskPerVG and _ComputeDiskSizePerVG functions
for VG-aware iterations.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
[iustin@google.com: some style fixes (long lines, etc.)]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdded "vg" argument to the --disk syntax
Dmitry Chernyak [Thu, 25 Nov 2010 00:14:36 +0000 (03:14 +0300)]
Added "vg" argument to the --disk syntax

Added "vg" argument to the "gnt-instance ... --disk" syntax specification.
Now is ok to write:

gnt-instance add ... --disk N:size=NNg,vg=VG_NAME ...

But not all internal structures are ready to handle this yet.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
[iustin@google.com: removed changes to design-2.0.rst]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd script to check version format
Michael Hanselmann [Wed, 24 Nov 2010 19:18:14 +0000 (20:18 +0100)]
Add script to check version format

Only versions of the format “x.y.z” and “x.y.z~(rc|beta)N” (for N>0) are
allowed.

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

13 years agoMerge branch 'devel-2.3'
Iustin Pop [Wed, 24 Nov 2010 17:12:38 +0000 (17:12 +0000)]
Merge branch 'devel-2.3'

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

13 years agoMerge branch 'devel-2.2' into devel-2.3
Iustin Pop [Wed, 24 Nov 2010 17:01:57 +0000 (17:01 +0000)]
Merge branch 'devel-2.2' into devel-2.3

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

13 years agoFix coverage reports
Iustin Pop [Wed, 24 Nov 2010 16:06:32 +0000 (16:06 +0000)]
Fix coverage reports

Currently, the coverage reports include the unittests themselves, and
this skewes unfairly the reports, as the coverage for the tests is very
high (since they all run).

To fix this, we export the ganeti temp dir from run-in-temp-dir, and we
use that to exclude the tests directory. The patch also fixes a but
related to multiple directories to be omitted (--omit a --omit b is
wrong, it needs to be --omit a,b).

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

13 years agoAdding --node-parameters command line flag
René Nussbaumer [Wed, 24 Nov 2010 12:14:03 +0000 (13:14 +0100)]
Adding --node-parameters command line flag

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

13 years agoAdding ndparams to their OpCodes and LU calls
René Nussbaumer [Wed, 24 Nov 2010 10:59:35 +0000 (11:59 +0100)]
Adding ndparams to their OpCodes and LU calls

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

13 years agoAdd consistency test for mcpu dispatch table
Michael Hanselmann [Fri, 19 Nov 2010 20:42:52 +0000 (21:42 +0100)]
Add consistency test for mcpu dispatch table

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

13 years agocmdlib: Use _POutputFields where possible
Michael Hanselmann [Fri, 19 Nov 2010 20:19:54 +0000 (21:19 +0100)]
cmdlib: Use _POutputFields where possible

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

13 years agoUpdate query2 design document
Michael Hanselmann [Fri, 12 Nov 2010 17:30:39 +0000 (18:30 +0100)]
Update query2 design document

While starting to implement this, I found a number of deficiencies:

- Drop regular expressions. As it turned out, only very few fields for
  instances used them, all of which can easily be turned into static
  field names.
- Use two separate calls with a request and response description each.
- Add forgotten list of fields to query request.
- Add value status for case where a field is not available for an item,
  e.g. NIC 3 for an instance with only one network interface.
- Add "timestamp" field type.
- Updated examples.

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

13 years agoBasic stuff to allocate disks on different VGs
Dmitry Chernyak [Mon, 22 Nov 2010 22:02:25 +0000 (01:02 +0300)]
Basic stuff to allocate disks on different VGs

Extend allocation functions to be aware of different vg names.  Suppose,
vg_name is helded in disk.physical_id[0] (already was) LUCreateInstance
is modified to be aware of new "vg" argument of the disk specification.

cfg.GetVGName() will only be used when no VG is specified.

The "add" and "remove" for plain and drbd instances should be correct.
The "move" for plain instance should be correct.

Signed-off-by: Dmitry Chernyak <dmi.chernyak@gmail.com>
[iustin@google.com: fixed missing parameters in two cases and tabs]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdding convenience getter for ndparams
René Nussbaumer [Mon, 22 Nov 2010 13:15:41 +0000 (14:15 +0100)]
Adding convenience getter for ndparams

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

13 years agoRAPI: implement no_install during instance creation
Lance Albertson [Mon, 22 Nov 2010 21:28:11 +0000 (15:28 -0600)]
RAPI: implement no_install during instance creation

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

13 years agoutils._RunCmdPipe: simplify the timeout logic
Iustin Pop [Mon, 22 Nov 2010 21:21:04 +0000 (22:21 +0100)]
utils._RunCmdPipe: simplify the timeout logic

There are two issues: first, it's simpler to assign directly to pt
instead of via another local variable. Second, this code doesn't make
sense:
  if lt < 0:
    break
  pt = max(0, lt)

If lt is indeed < 0, then the code will break. Otherwise, lt ≥ 0, and
max(0, lt) will always be equal to lt. So we remove the extra
assignment.

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

13 years agoutils._RunCmdPipe: fix poller timeout usage
Iustin Pop [Mon, 22 Nov 2010 20:57:59 +0000 (21:57 +0100)]
utils._RunCmdPipe: fix poller timeout usage

This patch makes a simple timeout test (e.g. testTimeoutKill) go from
13K poll syscalls to just 6. The code didn't take into account that
RunningTimeout talks in seconds while the poller object expects
milliseconds.

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

13 years agoFix utils unittest TestRunCmd.testTimeoutKill
Iustin Pop [Mon, 22 Nov 2010 20:42:52 +0000 (21:42 +0100)]
Fix utils unittest TestRunCmd.testTimeoutKill

Currently the test executes "/bin/sh -c 'trap "" TERM …" via the shell,
which means we have two shells involved (the parent one and the child
one, which does the trap). For some weird reason, this works for older
OSes: the first shell exec's the second one, whereas on squeeze it forks
and only then exec. This might be due to changes in Python or bash or
whatever.

In any case, the point is that this is a hacky way to call a shell, so
we change this to simply execute the desired shell directly, without any
intermediate shells (I don't understand why it was written as such
originally).

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

13 years agoRAPI: export the node group UUID in the node query
Iustin Pop [Mon, 22 Nov 2010 16:48:57 +0000 (16:48 +0000)]
RAPI: export the node group UUID in the node query

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

13 years agoAdding oob_program in the same style as beparams
René Nussbaumer [Fri, 19 Nov 2010 13:22:48 +0000 (14:22 +0100)]
Adding oob_program in the same style as beparams

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

13 years agoMerge branch 'devel-2.3'
Iustin Pop [Fri, 19 Nov 2010 16:26:30 +0000 (17:26 +0100)]
Merge branch 'devel-2.3'

* devel-2.3:
  Updates NEWS and configure.ac for 2.3.0~rc1
  Update NEWS & configure.ac for the 2.2.2 release
  Fix documentation regarding conversion to drbd
  Fix documentation regarding conversion to drbd
  Reinstall instance: disallow offline secondaries
  QA: check that doubly modifying an OS state is OK
  Fix breakage in OS state modify
  QA: add tests for gnt-cluster modify -B
  LUSetClusterParms: fix validation of beparams
  Add unittests for TemporaryReservationManager
  TempReservationManager: Reserved() doesn't work

Conflicts:
man/gnt-instance.sgml (ported to the RST version)

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

13 years agoTemporarily remove the interactive tests
Iustin Pop [Fri, 19 Nov 2010 16:22:17 +0000 (17:22 +0100)]
Temporarily remove the interactive tests

make check < /dev/null breaks these tests. Until we have change RunCmd
to override stdin, we need to remove them.

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

13 years agoSupport timeouts in RunCmd
René Nussbaumer [Tue, 9 Nov 2010 13:02:50 +0000 (14:02 +0100)]
Support timeouts in RunCmd

Further investigations have to be done for merging some of these bits
together with import-export daemon which uses similiar logic.

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

13 years agoUpdates NEWS and configure.ac for 2.3.0~rc1 v2.3.0rc1
Iustin Pop [Fri, 19 Nov 2010 13:10:54 +0000 (14:10 +0100)]
Updates NEWS and configure.ac for 2.3.0~rc1

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

13 years agoMerge branch 'devel-2.2' into devel-2.3
Iustin Pop [Fri, 19 Nov 2010 13:01:14 +0000 (14:01 +0100)]
Merge branch 'devel-2.2' into devel-2.3

* devel-2.2:
  Update NEWS & configure.ac for the 2.2.2 release
  Fix documentation regarding conversion to drbd

Conflicts:
NEWS         (integrated 2.2 changes)
configure.ac (kept our version)

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

13 years agoUpdate NEWS & configure.ac for the 2.2.2 release v2.2.2
Iustin Pop [Fri, 19 Nov 2010 10:42:35 +0000 (11:42 +0100)]
Update NEWS & configure.ac for the 2.2.2 release

This imports the 2.1.8 NEWS entry and adds the 2.2.2 one, then updates the
configure.ac version.

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

13 years agoFix documentation regarding conversion to drbd
Iustin Pop [Fri, 19 Nov 2010 10:17:12 +0000 (11:17 +0100)]
Fix documentation regarding conversion to drbd

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

13 years agoFix documentation regarding conversion to drbd
Iustin Pop [Fri, 19 Nov 2010 10:17:12 +0000 (11:17 +0100)]
Fix documentation regarding conversion to drbd

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

13 years agoReinstall instance: disallow offline secondaries
Iustin Pop [Thu, 18 Nov 2010 09:37:34 +0000 (10:37 +0100)]
Reinstall instance: disallow offline secondaries

Currently, reinstallation of a DRBD instance with the secondary node offline does:

node1# gnt-instance reinstall -f instance1
Waiting for job 139053 for instance1...
Thu Nov 18 01:36:09 2010  - WARNING: Could not prepare block device disk/0 on node node3 (is_primary=False, pass=1): Node is marked offline
Thu Nov 18 01:36:09 2010  - WARNING: Could not shutdown block device disk/0 on node node3: Node is marked offline
Job 139053 for instance1 has failed: Failure: command execution error:
Disk consistency error

Since this fails anyway, let's check the secondary nodes, thus
preventing any modifications to the instance (e.g. OS type change):

node1# gnt-instance reinstall -f instance1
Waiting for job 139058 for instance1...
Job 139058 for instance1 has failed: Failure: prerequisites not met for this operation:
error type: wrong_state, error details:
Instance secondary node offline, cannot reinstall: node3

The patch needs modifications to the _CheckNodeOnline function, in order
to display meaningful messages ("Can't use offline node" would be very
confusing for an instance reinstall, since we didn't select a node
manually).

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

13 years agoQA: check that doubly modifying an OS state is OK
Iustin Pop [Thu, 18 Nov 2010 09:23:48 +0000 (10:23 +0100)]
QA: check that doubly modifying an OS state is OK

This would have prevented the bug fixed in the previous patch :(

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

13 years agoFix breakage in OS state modify
Iustin Pop [Thu, 18 Nov 2010 09:20:06 +0000 (10:20 +0100)]
Fix breakage in OS state modify

I was using the feedback_fn function incorrectly (it doesn't
automatically expand the arguments).

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

13 years agoMerge branch 'devel-2.2' into devel-2.3
Iustin Pop [Wed, 17 Nov 2010 15:28:23 +0000 (16:28 +0100)]
Merge branch 'devel-2.2' into devel-2.3

* devel-2.2:
  QA: add tests for gnt-cluster modify -B
  LUSetClusterParms: fix validation of beparams

Conflicts:
lib/cmdlib.py (reverted & applied manually the change)

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

13 years agoQA: add tests for gnt-cluster modify -B
Iustin Pop [Wed, 17 Nov 2010 10:53:10 +0000 (11:53 +0100)]
QA: add tests for gnt-cluster modify -B

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

13 years agoLUSetClusterParms: fix validation of beparams
Iustin Pop [Wed, 17 Nov 2010 10:52:04 +0000 (11:52 +0100)]
LUSetClusterParms: fix validation of beparams

Since the contents of the dict is validated via the ForceDictType, we can
simply require that it is a dict here. The previous check was wrong, as it was
copied from the HV checks (which also doesn't verify the leaf dict type).

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

13 years agoAdding unittests for RunningTimeout
René Nussbaumer [Tue, 16 Nov 2010 13:46:07 +0000 (14:46 +0100)]
Adding unittests for RunningTimeout

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

13 years agoMove locking.RunningTimeout to utils
René Nussbaumer [Tue, 9 Nov 2010 12:43:30 +0000 (13:43 +0100)]
Move locking.RunningTimeout to utils

As we need this functionality in other places than just locking it makes
sense to move it to utils rather than keeping it in locking

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

13 years agoSome further man tweaks
Iustin Pop [Sat, 13 Nov 2010 20:46:57 +0000 (21:46 +0100)]
Some further man tweaks

This fixes one non-defined @CUSTOM_@ entry, and replaces two hardcoded
paths with further configure-time variables.

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

13 years agoRemove last vestiges of docbook
Iustin Pop [Sat, 13 Nov 2010 20:30:44 +0000 (21:30 +0100)]
Remove last vestiges of docbook

This patch removes the last traces of docbook.

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

13 years agoRemove the SGML man sources
Iustin Pop [Sat, 13 Nov 2010 20:28:34 +0000 (21:28 +0100)]
Remove the SGML man sources

… finally!

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

13 years agoSwitch man pages from SGML to RST
Iustin Pop [Sat, 13 Nov 2010 19:41:14 +0000 (20:41 +0100)]
Switch man pages from SGML to RST

This patch changes the Makefile rules to build the man pages from the
RST sources instead of the SGML ones.

Note: pandoc quotes by default the ‘@’ character in manpage output, so
we explicitely undo this before writing the .in file.

Note 2: The docs unittest has switched from checking cmdsynopsis
elements to search for either '**command**' or '| **command**' at the
beggining of lines. This is not as safe as the sgml checker, but it
should be fine.

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

13 years agoAdd RST version of ganeti man page
Iustin Pop [Sat, 13 Nov 2010 19:30:50 +0000 (20:30 +0100)]
Add RST version of ganeti man page

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

13 years agoAdd RST version of ganeti-os-interface man page
Iustin Pop [Sat, 13 Nov 2010 18:43:24 +0000 (19:43 +0100)]
Add RST version of ganeti-os-interface man page

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

13 years agoAdd RST version of ganeti-cleaner man page
Iustin Pop [Sat, 13 Nov 2010 17:06:12 +0000 (18:06 +0100)]
Add RST version of ganeti-cleaner man page

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

13 years agoAdd RST version of ganeti-confd man page
Iustin Pop [Sat, 13 Nov 2010 19:24:40 +0000 (20:24 +0100)]
Add RST version of ganeti-confd man page

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

13 years agoAdd RST version of ganeti-rapi man page
Iustin Pop [Sat, 13 Nov 2010 19:22:53 +0000 (20:22 +0100)]
Add RST version of ganeti-rapi man page

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

13 years agoAdd RST version of ganeti-noded man page
Iustin Pop [Sat, 13 Nov 2010 19:17:35 +0000 (20:17 +0100)]
Add RST version of ganeti-noded man page

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

13 years agoAdd RST version of ganeti-watcher man page
Iustin Pop [Sat, 13 Nov 2010 19:14:32 +0000 (20:14 +0100)]
Add RST version of ganeti-watcher man page

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

13 years agoAdd RST version of ganeti-masterd man page
Iustin Pop [Sat, 13 Nov 2010 19:08:41 +0000 (20:08 +0100)]
Add RST version of ganeti-masterd man page

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

13 years agoAdd RST version of gnt-os man page
Iustin Pop [Sat, 13 Nov 2010 19:02:53 +0000 (20:02 +0100)]
Add RST version of gnt-os man page

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

13 years agoAdd RST version of gnt-job man page
Iustin Pop [Sat, 13 Nov 2010 18:59:21 +0000 (19:59 +0100)]
Add RST version of gnt-job man page

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

13 years agoAdd RST version of gnt-debug man page
Iustin Pop [Sat, 13 Nov 2010 18:55:47 +0000 (19:55 +0100)]
Add RST version of gnt-debug man page

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

13 years agoAdd RST version of gnt-backup man page
Iustin Pop [Sat, 13 Nov 2010 18:50:32 +0000 (19:50 +0100)]
Add RST version of gnt-backup man page

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

13 years agoAdd RST version of gnt-node man page
Iustin Pop [Sat, 13 Nov 2010 18:33:40 +0000 (19:33 +0100)]
Add RST version of gnt-node man page

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