ganeti-local
14 years agoUse OpenSSL module instead of binary to generate certs
Michael Hanselmann [Thu, 18 Feb 2010 18:09:56 +0000 (19:09 +0100)]
Use OpenSSL module instead of binary to generate certs

This saves us one dependency and saves us from complicated handling of
external files if we need key and certificate separated from each other.

At the same time, the number of bits used for RSA keys is increased from
1024 to 2048.

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

14 years agoutils.SignalHandler: Add support for handler function
Michael Hanselmann [Fri, 12 Feb 2010 12:48:00 +0000 (13:48 +0100)]
utils.SignalHandler: Add support for handler function

This is useful if something else needs to be notified on signal arrival.

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

14 years agoutils: Add function to set O_NONBLOCK on file descriptor
Michael Hanselmann [Fri, 12 Feb 2010 15:21:21 +0000 (16:21 +0100)]
utils: Add function to set O_NONBLOCK on file descriptor

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

14 years agoutils: Add function to set FD_CLOEXEC on file descriptor
Michael Hanselmann [Fri, 12 Feb 2010 12:45:50 +0000 (13:45 +0100)]
utils: Add function to set FD_CLOEXEC on file descriptor

This will be used by another patch adding a utility function to start a daemon.

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

14 years agoutils: Add function to retry call on EINTR
Michael Hanselmann [Fri, 12 Feb 2010 16:04:04 +0000 (17:04 +0100)]
utils: Add function to retry call on EINTR

There are quite a few places where we have to (or should) retry function calls
on EINTR. This utility function simplifies it.

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

14 years agoMerge branch 'devel-2.1'
Michael Hanselmann [Thu, 18 Feb 2010 12:40:51 +0000 (13:40 +0100)]
Merge branch 'devel-2.1'

* devel-2.1:
  Reset tempfile module after fork where useful
  Move RunInSeparateProcess to ganeti.utils
  Add function to reset tempfile module after fork
  Fix ssh host key checking with no-key-check
  Simplify a bit _GetWantedNodes
  Fix a wrong docstring
  ganeti-noded: Fix bug when export didn't succeed for all disks
  Remove boiler-plate code about node/instance names

Conflicts:
lib/cmdlib.py: Trivial

14 years agoMerge branch 'stable-2.1' into devel-2.1
Michael Hanselmann [Thu, 18 Feb 2010 12:22:40 +0000 (13:22 +0100)]
Merge branch 'stable-2.1' into devel-2.1

* stable-2.1:
  Fix ssh host key checking with no-key-check

14 years agoReset tempfile module after fork where useful
Michael Hanselmann [Wed, 17 Feb 2010 15:53:41 +0000 (16:53 +0100)]
Reset tempfile module after fork where useful

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

14 years agoMove RunInSeparateProcess to ganeti.utils
Michael Hanselmann [Wed, 17 Feb 2010 15:46:46 +0000 (16:46 +0100)]
Move RunInSeparateProcess to ganeti.utils

This function could be useful in other places and this
way we can easily unittest it.

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

14 years agoAdd function to reset tempfile module after fork
Michael Hanselmann [Wed, 17 Feb 2010 15:31:28 +0000 (16:31 +0100)]
Add function to reset tempfile module after fork

On fork, the tempfile module's pseudo random generator is
not reset. If several processes (e.g. two children or parent
and child) try to create a temporary file, they'll conflict.
This function can be used to reset the name generator which
contains the pseudo random generator.

A unittest is included. It is in a separate script because
it changes a variable in the tempfile module to speed up the
test.

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

14 years agoFix ssh host key checking with no-key-check
Iustin Pop [Thu, 18 Feb 2010 09:12:19 +0000 (10:12 +0100)]
Fix ssh host key checking with no-key-check

In case we add a node with “--no-ssh-key-check”, this should override
any default yes/ask values in the system-wide (or user) ssh key check.

Currently this only works in batch mode, whereas in non-batch we only
override a 'no'. The patch fixes SshRunner such that in non-batch mode
we enforce the value of StrictHostKeyChecking in all cases.

Bug found and initial investigation by Theo Van Dinter.

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

14 years agoSimplify a bit _GetWantedNodes
Iustin Pop [Wed, 17 Feb 2010 16:42:48 +0000 (17:42 +0100)]
Simplify a bit _GetWantedNodes

This should have been done in the _ExpandNodeName patch.

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

14 years agoFix a wrong docstring
Iustin Pop [Wed, 17 Feb 2010 15:23:40 +0000 (16:23 +0100)]
Fix a wrong docstring

There's no such thing as OpProgrammerError (I found this as I wrote it
in code in another place, and pylint complained).

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

14 years agoganeti-noded: Fix bug when export didn't succeed for all disks
Michael Hanselmann [Tue, 16 Feb 2010 18:29:06 +0000 (19:29 +0100)]
ganeti-noded: Fix bug when export didn't succeed for all disks

snap_disks can contain boolean values. They weren't handled correctly.
The error message was “Error while executing backend function: Invalid
object passed to FromDict: expected dict, got <type 'bool'>”.

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

14 years agoRemove boiler-plate code about node/instance names
Iustin Pop [Wed, 17 Feb 2010 12:47:43 +0000 (13:47 +0100)]
Remove boiler-plate code about node/instance names

Currently we have lots of duplication of the error-checking (and proper
exception raising) around node/instance name expansion. LUCreateInstance
is the only place where we have abstracted this.

This patch creates two functions (ExpandNodeName and ExpandInstanceName)
that will either raise the proper exception or return the expanded name.
This allows a lot of cleanup of duplicate code.

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

14 years agoMerge branch 'devel-2.1'
Michael Hanselmann [Mon, 15 Feb 2010 17:04:26 +0000 (18:04 +0100)]
Merge branch 'devel-2.1'

* devel-2.1: (31 commits)
  Add unittest for utils._FingerprintFile
  Release all node locks during disk replace
  Unify a few re.compile calls in DRBD
  Auto-enable early release for offline old nodes
  Skip line-length warnings in man
  Revert "Workaround man page output for long PREFIX dirs"
  Run instance hooks on more nodes
  Add {NEW,OLD}_{PRIMARY,SECONDARY} vars to hooks
  Workaround man page output for long PREFIX dirs
  Pass debug mode to noded for OS-related calls
  Convert scripts to pass options to the JobExecutor
  Add the options attribute to cli.JobExecutor
  Add debug mode to burnin
  Update scripts to pass 'opts' to SubmitOpCode
  Implement generic CLI options->opcode updates
  Change the debug CLI option to integer/count
  Add a generic 'debug_level' attribute to opcodes
  Fix bug introduced in commit 413b747
  Fix dumpers/loaders after __slots__ cleanup
  Fix locking bug causing high CPU usage
  ...

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

14 years agoMerge remote branch 'origin/stable-2.1' into devel-2.1
Michael Hanselmann [Mon, 15 Feb 2010 17:03:45 +0000 (18:03 +0100)]
Merge remote branch 'origin/stable-2.1' into devel-2.1

* origin/stable-2.1:
  Fix bug introduced in commit 413b747
  Fix locking bug causing high CPU usage
  Fix confd procotol design description
  Implement instance rename QA tests
  Fix "gnt-instance rename" functionality

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

14 years agoAdd unittest for utils._FingerprintFile
Michael Hanselmann [Fri, 12 Feb 2010 17:48:03 +0000 (18:48 +0100)]
Add unittest for utils._FingerprintFile

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

14 years agoRelease all node locks during disk replace
Iustin Pop [Mon, 15 Feb 2010 13:34:07 +0000 (14:34 +0100)]
Release all node locks during disk replace

This patch extends commit 7ea7bcf by releasing all node locks in disk
replace for the early release mode. The rationale behind this is:

- LUCreateInstance already releases all node locks while waiting for
  disk synchronization, and does an instance startup later
- WaitForSync only runs (for disk template 'drbd') 'lvs' and read
  /proc/drbd on the primary node, which should be (modulo bugs in LVM)
  safe for parallel run

In any case, the worst I could foresee is a node having N lvs commands
run in parallel on it, while being a primary for disk storage. Based on
create instance doing this safely, and the fact that burnin with more
than two instances per node is safe, I think this can be applied.

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

14 years agoUnify a few re.compile calls in DRBD
Iustin Pop [Mon, 15 Feb 2010 10:44:00 +0000 (11:44 +0100)]
Unify a few re.compile calls in DRBD

These are both cleanups and, in the case of _MassageProcData, switching
from a weaker RE to a stronger one (we now need cs: in the line,
previosuly any line starting with \d+: was accepted).

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

14 years agoAuto-enable early release for offline old nodes
Iustin Pop [Mon, 15 Feb 2010 09:27:59 +0000 (10:27 +0100)]
Auto-enable early release for offline old nodes

In case the old node is offline, we won't be able to talk to it to
remove the storage, and in most cases the node is powered
off/unreachable.

In this case, it makes no sense to delay the storage release, so we
enable automatically early_release mode, gaining parallelism during node
evacuation.

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

14 years agoAdd command line options for instance removal on export
Michael Hanselmann [Fri, 29 Jan 2010 17:44:42 +0000 (18:44 +0100)]
Add command line options for instance removal on export

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

14 years agoImplement opcode parameter to remove instance after export
Michael Hanselmann [Fri, 29 Jan 2010 17:41:26 +0000 (18:41 +0100)]
Implement opcode parameter to remove instance after export

This will be useful for instance moves.

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

14 years agoAdding design doc for cluster merger
René Nussbaumer [Fri, 12 Feb 2010 10:39:13 +0000 (11:39 +0100)]
Adding design doc for cluster merger

Signed-off-by: René Nussbaumer <rn@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(applied slightly modified patch)

14 years agoUpdate inter-cluster instance move design with HMAC verification
Michael Hanselmann [Fri, 12 Feb 2010 12:18:36 +0000 (13:18 +0100)]
Update inter-cluster instance move design with HMAC verification

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

14 years agoSkip line-length warnings in man
Iustin Pop [Thu, 11 Feb 2010 16:35:36 +0000 (17:35 +0100)]
Skip line-length warnings in man

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

14 years agoRevert "Workaround man page output for long PREFIX dirs"
Iustin Pop [Thu, 11 Feb 2010 16:31:41 +0000 (17:31 +0100)]
Revert "Workaround man page output for long PREFIX dirs"

This reverts commit 83d9f4366f3aa9ae360e27bfe6619402793e9eb5.

man is still unable to wrap some long lines, so we simply revert this patch
(and filter out the specific message in autotools/check-man).

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

14 years agoRun instance hooks on more nodes
Iustin Pop [Thu, 11 Feb 2010 15:06:24 +0000 (16:06 +0100)]
Run instance hooks on more nodes

This should fix issue 68: some hooks should be run on more nodes than
currently. GrowDisk runs on both nodes, remove run the post hook on the
instance's nodes, and failover and migrate run the post hook on the
source node too.

Thanks to Maxence for the initial investigation and patch.

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

14 years agoAdd {NEW,OLD}_{PRIMARY,SECONDARY} vars to hooks
Iustin Pop [Thu, 11 Feb 2010 14:42:49 +0000 (15:42 +0100)]
Add {NEW,OLD}_{PRIMARY,SECONDARY} vars to hooks

Per issue 71, the migrate and failover need special variables for
keeping the nodes consistent during instance migrations.

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

14 years agoWorkaround man page output for long PREFIX dirs
Iustin Pop [Thu, 11 Feb 2010 12:58:26 +0000 (13:58 +0100)]
Workaround man page output for long PREFIX dirs

A long PREFIX variable (to configure) will result in very long
LOCALSTATEDIR, which when concatenated with lib/ganeti/ (and even more
items under it) will go over the 80 char line length we enforce in the
man checker.

To workaround this, we change two things:

- use a specific REPLACE_VARS_MAN which adds breaking points after each
  slash in paths
- replace some <filename> entries with <literallayout> so that docbook
  generates a non-fill block around them (only a few cases need this
  after the breaking points are added

Note that with normal prefixes (e.g. / or /usr/local) this won't happen.

The patch also fixes a wording in the watcher man page.

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

14 years agoPass debug mode to noded for OS-related calls
Iustin Pop [Wed, 10 Feb 2010 15:50:25 +0000 (16:50 +0100)]
Pass debug mode to noded for OS-related calls

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

14 years agoConvert scripts to pass options to the JobExecutor
Iustin Pop [Wed, 10 Feb 2010 10:30:33 +0000 (11:30 +0100)]
Convert scripts to pass options to the JobExecutor

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

14 years agoAdd the options attribute to cli.JobExecutor
Iustin Pop [Tue, 9 Feb 2010 14:43:23 +0000 (15:43 +0100)]
Add the options attribute to cli.JobExecutor

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

14 years agoAdd debug mode to burnin
Iustin Pop [Tue, 9 Feb 2010 13:15:00 +0000 (14:15 +0100)]
Add debug mode to burnin

There are two entry points to job execution in burnin, ExecOp and
ExecOrQueue, and these are modified to call the new _SetDebug method on
the opcodes.

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

14 years agoUpdate scripts to pass 'opts' to SubmitOpCode
Iustin Pop [Tue, 9 Feb 2010 13:10:40 +0000 (14:10 +0100)]
Update scripts to pass 'opts' to SubmitOpCode

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

14 years agoImplement generic CLI options->opcode updates
Iustin Pop [Tue, 9 Feb 2010 13:02:18 +0000 (14:02 +0100)]
Implement generic CLI options->opcode updates

This patch changes SubmitOpCode and SubmitOrSend such that we have a
single function that does generic CLI options to opcode attributes
function. This will allow, once all scripts pass the opts argument to
SubmitOpCode, to pass the debug parameter or the dry-run one to the LUs.

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

14 years agoChange the debug CLI option to integer/count
Iustin Pop [Wed, 10 Feb 2010 16:54:22 +0000 (17:54 +0100)]
Change the debug CLI option to integer/count

This changes from boolean to integer/count (for a future differentiation
based on the actual debug level). All the uses of the code only test
it's boolean status, so it still works as an integer value.

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

14 years agoAdd a generic 'debug_level' attribute to opcodes
Iustin Pop [Tue, 9 Feb 2010 13:01:59 +0000 (14:01 +0100)]
Add a generic 'debug_level' attribute to opcodes

Also automatically fix opcodes which have this missing in the LU init
routine.

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

14 years agoFix bug introduced in commit 413b747
Michael Hanselmann [Wed, 10 Feb 2010 13:47:52 +0000 (14:47 +0100)]
Fix bug introduced in commit 413b747

While commit 413b747 fixed the issue of poll(2) returning too
soon, it didn't work when the poll(2) call should've been
blocking. This is now fixed and verified.

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

14 years agoFix dumpers/loaders after __slots__ cleanup
Iustin Pop [Wed, 10 Feb 2010 11:55:43 +0000 (12:55 +0100)]
Fix dumpers/loaders after __slots__ cleanup

Commit 154b958 changed (correctly) the __slots__ usage, but this broke
dumpers/loaders since we relied directly on the own class __slots__
field.

To compensate, we introduce a simple function for computing the slots
across all parent classes (if any), and use this instead of __slots__
directly.

Note: the _all_slots() function is duplicated between objects.py and
opcodes.py, but the only other options is to introduce a lang.py for
such very basic language items.

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

14 years agoFix locking bug causing high CPU usage
Michael Hanselmann [Wed, 10 Feb 2010 12:45:52 +0000 (13:45 +0100)]
Fix locking bug causing high CPU usage

Iustin Pop noticed unusually high CPU usage with 2.1's master
daemon, even with very simple opcodes like OP_TEST_DELAY. As
it turns out, we inadvertently passed seconds as milliseconds
to a call to poll(2). Due to the way the loop around the call
works it didn't break competely, but caused higher CPU usage
by the poll(2) call returning too early.

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

14 years agoCheck built manpages for errors
Michael Hanselmann [Wed, 10 Feb 2010 10:35:19 +0000 (11:35 +0100)]
Check built manpages for errors

One fix is necessary in gnt-cluster.sgml. Also adding “DELETE_ON_ERROR”
target to remove output file if an error occurred while building it (in
this case the manpage).

This was reported by Iustin Pop in issue 87 and proposed check method
taken from Lintian.
http://code.google.com/p/ganeti/issues/detail?id=87

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

14 years agoFix confd procotol design description
Guido Trotter [Wed, 10 Feb 2010 09:15:04 +0000 (11:15 +0200)]
Fix confd procotol design description

The protocol design for confd was missing a description of the fourcc
code which we use to distinguish between different message types, if we
want to completely change the protocol. Adding them so that someone
implementing it can find out.

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

14 years agoImplement instance rename QA tests
Iustin Pop [Tue, 9 Feb 2010 09:30:40 +0000 (10:30 +0100)]
Implement instance rename QA tests

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

14 years agoAdd an early release lock/storage for disk replace
Iustin Pop [Tue, 9 Feb 2010 08:57:50 +0000 (09:57 +0100)]
Add an early release lock/storage for disk replace

This patch adds an early_release parameter in the OpReplaceDisks and
OpEvacuateNode opcodes, allowing earlier release of storage and more
importantly of internal Ganeti locks.

The behaviour of the early release is that any locks and storage on all
secondary nodes are released early. This is valid for change secondary
(where we remove the storage on the old secondary, and release the locks
on the old and new secondary) and replace on secondary (where we remove
the old storage and release the lock on the secondary node.

Using this, on a three node setup:

- instance1 on nodes A:B
- instance2 on nodes C:B

It is possible to run in parallel a replace-disks -s (on secondary) for
instances 1 and 2.

Replace on primary will remove the storage, but not the locks, as we use
the primary node later in the LU to check consistency.

It is debatable whether to also remove the locks on the primary node,
and thus making replace-disks keep zero locks during the sync. While
this would allow greatly enhanced parallelism, let's first see how
removal of secondary locks works.

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

14 years agoFix "gnt-instance rename" functionality
Iustin Pop [Tue, 9 Feb 2010 09:15:51 +0000 (10:15 +0100)]
Fix "gnt-instance rename" functionality

Commit 91e0748c (Unify the “--no-ip-check” option) broke the options
variable name for ‘--no-ip-check’ but since we don't have a QA test for
instance rename (only burnin test), this was not caught until Issue 86
was opened.

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

14 years agoMerge branch 'stable-2.1' into devel-2.1
Iustin Pop [Mon, 8 Feb 2010 13:16:58 +0000 (14:16 +0100)]
Merge branch 'stable-2.1' into devel-2.1

* stable-2.1:
  TLReplaceDisks: Delay iallocator when evacuating node
  Implement debug level across OS-related RPC calls
  Second try to fix LUVerifyCluster
  LUVerifyCluster: Fix bug with offline nodes
  utils: Fix retry delay calculator
  Bump RPC protocol version to 30

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

14 years agoTLReplaceDisks: Delay iallocator when evacuating node
Michael Hanselmann [Thu, 4 Feb 2010 16:32:21 +0000 (17:32 +0100)]
TLReplaceDisks: Delay iallocator when evacuating node

When evacuating nodes, the iallocator was run for all
instances without taking planned changes into consideration.
This patch delays part of CheckPrereq and running the
iallocator for node evacuation.

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

14 years agoImplement debug level across OS-related RPC calls
Iustin Pop [Wed, 3 Feb 2010 13:24:42 +0000 (14:24 +0100)]
Implement debug level across OS-related RPC calls

This doesn't implement the full functionality, we need to add the debug
level to the opcodes too, but at least won't require changing the RPC
calls during the 2.1 series.

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

14 years agoSecond try to fix LUVerifyCluster
Michael Hanselmann [Wed, 3 Feb 2010 13:24:53 +0000 (14:24 +0100)]
Second try to fix LUVerifyCluster

My previous patch, commit 785d142, fixed the case where a node is marked
offline. With this patch it'll also handle other failures correctly.

 * Hooks Results
   - ERROR: node node2.example.com: Communication failure in hooks
   execution: Connection failed (111: Connection refused)

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

14 years agoLUVerifyCluster: Fix bug with offline nodes
Michael Hanselmann [Wed, 3 Feb 2010 12:50:49 +0000 (13:50 +0100)]
LUVerifyCluster: Fix bug with offline nodes

[…]
 * Other Notes
   - NOTICE: 1 offline node(s) found.
 * Hooks Results
Failure: command execution error:
iteration over non-sequence

Commit a0c9776a introduced an error simulation mode to LUVerifyCluster.
Due to a small mistake, offline nodes weren't skipped when checking the
results of verification hooks and iterating over None raises an
“iteration over non-sequence” error.

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

14 years agoutils: Fix retry delay calculator
Michael Hanselmann [Wed, 3 Feb 2010 12:18:01 +0000 (13:18 +0100)]
utils: Fix retry delay calculator

Before this patch, it would always sleep for at least
the time specified as the upper limit. Now it actually
limits the sleep time.

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

14 years agoBump RPC protocol version to 30
Michael Hanselmann [Mon, 1 Feb 2010 14:52:57 +0000 (15:52 +0100)]
Bump RPC protocol version to 30

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

14 years agoFind OpenSSL program at configure time
Michael Hanselmann [Thu, 28 Jan 2010 17:33:39 +0000 (18:33 +0100)]
Find OpenSSL program at configure time

Otherwise we depend on PATH at runtime.

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

14 years agoMove function generating SSL certs into utils
Michael Hanselmann [Thu, 28 Jan 2010 17:22:03 +0000 (18:22 +0100)]
Move function generating SSL certs into utils

Also add unittest.

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

14 years agoInitial design for inter-cluster instance moves
Michael Hanselmann [Tue, 26 Jan 2010 18:05:04 +0000 (19:05 +0100)]
Initial design for inter-cluster instance moves

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

14 years agoMerge branch 'devel-2.1'
Michael Hanselmann [Mon, 1 Feb 2010 13:01:20 +0000 (14:01 +0100)]
Merge branch 'devel-2.1'

* devel-2.1:
  Bump version to 2.1.0~rc5
  Makefile.am: Targets used directly should depend on BUILT_SOURCES
  Make the snapshot decision based on disk type
  Three small typos in man pages
  Fix missing bridge for xen instances
  Fix flipping MC flag bug
  ganeti-watcher: ensure confd is running as well
  Add capability to use syslog for logging
  node daemon: allow working with broken queue dir
  utils.FileLock: handle init errors properly
  daemon-utils: remove usage of here-docs
  Fix typo in ganeti-os-interface(7)
  locking: add/fix @type information
  Fix __slots__ definitions
  Fix the mocks.py for 2.0 unittests
  Add a crude disable for DRBD barriers
  LURemoveNode safety in face of wrong node list
  Fix an unsafe formatting bug
  Ensure all int/float conversions are handled right

Conflicts:
lib/daemon.py: Trivial

14 years agoMerge remote branch 'origin/stable-2.1' into devel-2.1
Michael Hanselmann [Mon, 1 Feb 2010 12:55:56 +0000 (13:55 +0100)]
Merge remote branch 'origin/stable-2.1' into devel-2.1

* origin/stable-2.1:
  Bump version to 2.1.0~rc5
  Fix missing bridge for xen instances
  Fix flipping MC flag bug
  ganeti-watcher: ensure confd is running as well

14 years agoBump version to 2.1.0~rc5 v2.1.0rc5
Michael Hanselmann [Mon, 1 Feb 2010 12:21:10 +0000 (13:21 +0100)]
Bump version to 2.1.0~rc5

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

14 years agoMakefile.am: Targets used directly should depend on BUILT_SOURCES
Michael Hanselmann [Wed, 27 Jan 2010 17:02:58 +0000 (18:02 +0100)]
Makefile.am: Targets used directly should depend on BUILT_SOURCES

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

14 years agoMerge branch 'devel-2.0' into devel-2.1
Iustin Pop [Mon, 1 Feb 2010 10:40:01 +0000 (11:40 +0100)]
Merge branch 'devel-2.0' into devel-2.1

* devel-2.0:
  Three small typos in man pages

Conflicts:
man/gnt-cluster.sgml (trivial)

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

14 years agoMake the snapshot decision based on disk type
Iustin Pop [Fri, 29 Jan 2010 11:37:35 +0000 (12:37 +0100)]
Make the snapshot decision based on disk type

… instead of disk size, which is not as reliable. This actually
simplifies the code; but it still leaves the possibility of stack
overflows if the disk data structure is corrupted.

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

14 years agoThree small typos in man pages
Iustin Pop [Mon, 1 Feb 2010 09:23:31 +0000 (10:23 +0100)]
Three small typos in man pages

The credit goes again to Lintian.

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

14 years agoFix missing bridge for xen instances
Alessandro Cincaglini [Fri, 29 Jan 2010 11:47:45 +0000 (11:47 +0000)]
Fix missing bridge for xen instances

Xen instances nic definitions miss the target bridge.

This bug was introduced in commit 503b97a9.

Signed-off-by: Alessandro Cincaglini <alessandro.ciancaglini@gmail.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>

14 years agoFix flipping MC flag bug
Guido Trotter [Thu, 28 Jan 2010 14:40:44 +0000 (14:40 +0000)]
Fix flipping MC flag bug

Currently unofflining or undraining an already functional master
candidate node, can cause it to demote itself. In order to avoid that we
only trigger the self-promotion check if the node is not currently a
candidate.

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

14 years agoganeti-watcher: ensure confd is running as well
Guido Trotter [Thu, 28 Jan 2010 11:34:50 +0000 (11:34 +0000)]
ganeti-watcher: ensure confd is running as well

Ganeti-confd should be running on all 2.1 nodes.

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

14 years agoAdd capability to use syslog for logging
Iustin Pop [Wed, 27 Jan 2010 16:47:59 +0000 (17:47 +0100)]
Add capability to use syslog for logging

This patch adds a configure-time parameter that will set the defaults
used by all programs, and command-line parameters in the daemons that
allow overriding it.

Syslog 'yes' enables syslog in addition to file-based logging, 'only'
enables syslog and disables file-based syslog.

The log entries will be of the form:
Jan 27 08:45:04 node2 ganeti-noded[14504]: INFO 172.24.227.5:50850 PUT
/jobqueue_update HTTP/1.0 200
Jan 27 08:45:05 node2 ganeti-noded[14505]: INFO 172.24.227.5:50853 PUT
/lv_list HTTP/1.0 200

and (for a multi-threaded program):
Jan 27 08:51:48 node1 ganeti-masterd[15491]: (MainThread) INFO
ganeti-masterd daemon startup
Jan 27 08:51:49 node1 ganeti-masterd[15491]: (MainThread) INFO
Inspecting job queue

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

14 years agoInitial KVM security improvement design for 2.2
Guido Trotter [Tue, 26 Jan 2010 18:34:04 +0000 (18:34 +0000)]
Initial KVM security improvement design for 2.2

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

14 years agonode daemon: allow working with broken queue dir
Iustin Pop [Wed, 27 Jan 2010 12:01:52 +0000 (13:01 +0100)]
node daemon: allow working with broken queue dir

In case the queue dir cannot be create/initialized, currently
ganeti-noded exits. This means that a read-only filesystem or a
permission error breaks all node daemon functionality, including
powercycle. This is not good for the usual failure case for nodes.

To workaround this, we don't require successful initialization at node
daemon startup; if we can't init the queue dir/lock, we retry at every
RPC call requiring a job queue lock, and if we still can't acquire the
lock, we raise an exception (which is catched in HandleRequest and
transformed into an RPC failure).

This allows the node daemon to start in face of queue issues, and the
master node to power-cycle it.

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

14 years agoutils.FileLock: handle init errors properly
Iustin Pop [Wed, 27 Jan 2010 10:32:28 +0000 (11:32 +0100)]
utils.FileLock: handle init errors properly

If the open of the lock file fails (due to whatever reason), 'self'
won't have the 'fd' attribute, and thus we fail in Close/__del__, which
will ruin proper error reporting:

IOError: [Errno 30] Read-only file system: '/var/lib/ganeti/queue/lock'
Exception exceptions.AttributeError: "'FileLock' object has no attribute
'fd'" in <bound method FileLock.__del__ of <ganeti.utils.FileLock object
at 0x2aaaad0bebd0>> ignored

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

14 years agodaemon-utils: remove usage of here-docs
Iustin Pop [Wed, 27 Jan 2010 10:26:54 +0000 (11:26 +0100)]
daemon-utils: remove usage of here-docs

In some versions of bash, here-docs and here-strings use temporary
files, which means daemon-util needs a writable temporary filesystem.
Since echo is a bash builtin anyway, it's simple to switch to it and
remove this dependency.

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

14 years agoFix typo in ganeti-os-interface(7)
Michael Hanselmann [Tue, 26 Jan 2010 18:06:45 +0000 (19:06 +0100)]
Fix typo in ganeti-os-interface(7)

The variable is called “IMPORT_INDEX”, not “IMPORT_IDX”.

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

14 years agolocking: add/fix @type information
Guido Trotter [Wed, 27 Jan 2010 10:09:12 +0000 (10:09 +0000)]
locking: add/fix @type information

This patch missing @type information for all public methods, modifies
one to conform to the rest, and removes some information from @param
when it's been expressed in @type.

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

14 years agoFix __slots__ definitions
Balazs Lecz [Tue, 26 Jan 2010 13:07:17 +0000 (13:07 +0000)]
Fix __slots__ definitions

According to http://docs.python.org/reference/datamodel.html#slots

* The action of a __slots__ declaration is limited to the class where it
  is defined. As a result, subclasses will have a __dict__ unless they
  also define __slots__ (which must only contain names of any
  /additional/ slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This renders
  the meaning of the program undefined. In the future, a check may be
  added to prevent this.

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

14 years agoMerge branch 'devel-2.0' into devel-2.1
Iustin Pop [Tue, 26 Jan 2010 12:22:30 +0000 (13:22 +0100)]
Merge branch 'devel-2.0' into devel-2.1

* devel-2.0:
  Fix the mocks.py for 2.0 unittests
  LURemoveNode safety in face of wrong node list
  Fix an unsafe formatting bug
  Ensure all int/float conversions are handled right

Conflicts:
lib/backend.py - trivial merge
lib/cmdlib.py  - merge, and took 2.0's version of LURemoveNode
                 BuildHooksEnv
lib/mcpu.py    - kept ours
lib/objects.py - trivial merge
lib/utils.py   - trivial merge
scripts/gnt-backup - kept ours
scripts/gnt-instance - trivial merge

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

14 years agoFix the mocks.py for 2.0 unittests
Iustin Pop [Mon, 25 Jan 2010 16:36:41 +0000 (17:36 +0100)]
Fix the mocks.py for 2.0 unittests

The recent change to use LogWarning with multiple arguments in
mpcu.py/HooksMaster broke the (simple) mock we have in the tests.

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

14 years agoAdd a crude disable for DRBD barriers
Iustin Pop [Mon, 25 Jan 2010 12:10:25 +0000 (13:10 +0100)]
Add a crude disable for DRBD barriers

Ideally we want to/will have per-device DRBD controls of disk/metadata
flushes. In the meantime, we want at least a disable of the barrier
functionality for cases where one has battery-backed caches.

Background: DRBD has four mechanism of handling ordered disk-writes.
From the drbdsetup man-page, these are: barrier, flush, drain and none.
DRBD prior to 8.2 only has drain and none. This patch makes all 8.x
versions of DRBD disable all methods, and revert to none, in case one
fully trusts batteries (either UPS for the whole system or battery for
NVRAM).

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

14 years agoLURemoveNode safety in face of wrong node list
Iustin Pop [Mon, 25 Jan 2010 13:49:04 +0000 (14:49 +0100)]
LURemoveNode safety in face of wrong node list

LURemoveNode runs under the BGL, which means we're guaranteed that the
list of nodes as retrieved in CheckPrereq is still valid in
BuildHooksEnv. However, we can make Ganeti handle failures in case the
locking is broken (or the node list has been modified otherwise) easily,
which is better than crashing hard in such a case.

This will also fix issue 79, even though that is due to an out-of-tree
patch.

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

14 years agoFix an unsafe formatting bug
Iustin Pop [Mon, 25 Jan 2010 13:37:33 +0000 (14:37 +0100)]
Fix an unsafe formatting bug

This might fix issue 84; in any case, the current situation is that we
have a potentially unsafe formatting, which should be fixed.

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

14 years agoEnsure all int/float conversions are handled right
Iustin Pop [Mon, 25 Jan 2010 13:29:28 +0000 (14:29 +0100)]
Ensure all int/float conversions are handled right

int()/float() can raise either ValueError (in case of int("a")), or
TypeError (in case of int(None)). We had many bugs over time due to
this, and a recent one was just diagnosed, so we go over the codebase
and replace all 'except ValueError' with 'except (TypeError,
ValueError)' that protect such conversions (there were no 'except
TypeError' cases that needed a ValueError added).

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

14 years agoMerge branch 'devel-2.1'
Michael Hanselmann [Fri, 22 Jan 2010 16:38:30 +0000 (17:38 +0100)]
Merge branch 'devel-2.1'

* devel-2.1: (38 commits)
  Bump version to 2.1.0~rc4
  Update man page of gnt-instance
  KVM: fix pylint warning
  KVM: be more resilient on broken migration answers
  Allow filtering for (node-)tags
  Add unittests for cli.GenerateTable
  cli: Fix bug when not using headers
  daemon-util: Fix quoting issue
  Bump version to 2.1.0~rc3
  Switch the SplitKeyVal function to accept escapes
  Fix long-standing race condition bug in locking unittest
  confd client: copy the peers in UpdatePeerList
  testutils: Print name of test program before running it
  Don't use hardcoded name for pylint
  Partially revert "Makefile.am: Run pylint on all Python code"
  build-bash-completion: Take care of pylint warnings
  Add an UnescapeAndSplit function
  Makefile.am: Run pylint on all Python code
  Small improvements for release script
  check-python-code: Use “set -e” to abort on errors
  ...

14 years agoMerge branch 'stable-2.1' into devel-2.1
Michael Hanselmann [Fri, 22 Jan 2010 16:38:14 +0000 (17:38 +0100)]
Merge branch 'stable-2.1' into devel-2.1

* stable-2.1:
  Bump version to 2.1.0~rc4
  KVM: fix pylint warning
  KVM: be more resilient on broken migration answers
  Add unittests for cli.GenerateTable
  cli: Fix bug when not using headers
  daemon-util: Fix quoting issue
  Bump version to 2.1.0~rc3

14 years agoBump version to 2.1.0~rc4 v2.1.0rc4
Michael Hanselmann [Fri, 22 Jan 2010 15:56:54 +0000 (16:56 +0100)]
Bump version to 2.1.0~rc4

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

14 years agoFix lint warnings after my last changes
Michael Hanselmann [Fri, 22 Jan 2010 15:51:43 +0000 (16:51 +0100)]
Fix lint warnings after my last changes

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

14 years agoRemove http.HttpJsonConverter
Michael Hanselmann [Wed, 2 Dec 2009 16:53:19 +0000 (17:53 +0100)]
Remove http.HttpJsonConverter

With the move of the content-type handling to the various users of the HTTP
layer, this class isn't really useful anymore.

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

14 years agorapi: Don't access request's private object directly
Michael Hanselmann [Wed, 20 Jan 2010 11:41:18 +0000 (12:41 +0100)]
rapi: Don't access request's private object directly

This way the request handlers don't need as much knowledge
about the inside of the request and context objects and it
makes the code a bit shorter.

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

14 years agohttp.server: No longer enfore JSON encoding for body
Michael Hanselmann [Wed, 2 Dec 2009 16:48:55 +0000 (17:48 +0100)]
http.server: No longer enfore JSON encoding for body

The HTTP layer shouldn't care about the contents of the request data or
responses. This requires further changes in the RAPI code to handle client
requests correctly.

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

14 years agohttp.server: Refuse HTTP/1.1 request without Host header
Michael Hanselmann [Thu, 3 Dec 2009 15:20:34 +0000 (16:20 +0100)]
http.server: Refuse HTTP/1.1 request without Host header

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

14 years agoganeti-rapi: Remove serial number/ETag code
Michael Hanselmann [Wed, 2 Dec 2009 16:53:05 +0000 (17:53 +0100)]
ganeti-rapi: Remove serial number/ETag code

It was never used as intended.

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

14 years agohttp: Add two new exceptions, one constant
Michael Hanselmann [Wed, 2 Dec 2009 16:36:44 +0000 (17:36 +0100)]
http: Add two new exceptions, one constant

These will be useful in the future in case we don't enfore JSON encoding
anymore in the http.server module. The HTTP 1.1 RFC recommends error 415
(Unsupported Media Type) to be returned in case the client requests an
unsupported content-type. If the client doesn't send a “Content-Type” in
the request, a content-type of “application/octet-stream” is implied.

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

14 years agoFactorize LUXI parsing and handling code
Michael Hanselmann [Mon, 18 Jan 2010 15:43:41 +0000 (16:43 +0100)]
Factorize LUXI parsing and handling code

Also fix a typo in http/__init__.py and add unittests
for the LUXI parsing and formatting functions.

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

14 years agoSimplify LUXI exceptions
Michael Hanselmann [Wed, 2 Dec 2009 10:59:36 +0000 (11:59 +0100)]
Simplify LUXI exceptions

Having only one exception hierarchy makes catching them simpler. Before
ProtocolError would derive directly from Exception, but with this patch
it'll also be in the hierarchy defined by the ganeti.errors module.
Separating encoding and decoding errors is not necessary at this point
as they're never handled separately, and merging them removes a few
lines from the code.

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

14 years agoUpdate man page of gnt-instance
René Nussbaumer [Fri, 22 Jan 2010 13:28:27 +0000 (14:28 +0100)]
Update man page of gnt-instance

This patch updates the man page of gnt-instance to include the newly
added tags filtering.

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

14 years agoKVM: fix pylint warning
Guido Trotter [Fri, 22 Jan 2010 13:45:58 +0000 (14:45 +0100)]
KVM: fix pylint warning

Specify string format arguments as logging function parameters

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

14 years agoKVM: be more resilient on broken migration answers
Guido Trotter [Fri, 22 Jan 2010 11:37:24 +0000 (12:37 +0100)]
KVM: be more resilient on broken migration answers

Before, when doing kvm live migrations we use to accept an "unknown
status" but to reject anything that didn't match our regexp. Since we've
seen "info migrate" return a completely empty answer, we'll be more
tolerant of completely unknown results (while still logging them) and at
the same time we'll limit the number of them which we're willing to
accept in a row.

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

14 years agoAllow filtering for (node-)tags
René Nussbaumer [Thu, 21 Jan 2010 15:16:32 +0000 (16:16 +0100)]
Allow filtering for (node-)tags

This change introduces startup, shutdown, reboot, reinstall by using
instance respectively node tags as a selection criteria.

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

14 years agoAdd unittests for cli.GenerateTable
Michael Hanselmann [Wed, 20 Jan 2010 12:42:41 +0000 (13:42 +0100)]
Add unittests for cli.GenerateTable

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

14 years agocli: Fix bug when not using headers
Michael Hanselmann [Wed, 20 Jan 2010 12:41:21 +0000 (13:41 +0100)]
cli: Fix bug when not using headers

Commit 9fe72672 added code to not write spaces at the end of each line.
Unfortunately it didn't work properly when not printing headers—there would
still be spaces.

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

14 years agodaemon-util: Fix quoting issue
Michael Hanselmann [Tue, 19 Jan 2010 16:02:32 +0000 (17:02 +0100)]
daemon-util: Fix quoting issue

This patch fixes a quoting issue in daemon-util:

$ EXTRA_MASTERD_ARGS=--no-voting /etc/init.d/ganeti restart
[…]
* ganeti-masterd...
/…/ganeti/daemon-util: line 65: local: `--no-voting': not a valid identifier

The reason was that the generated variables were not quoted properly and
the troublesome line expanded to
“local args=$MASTERD_ARGS $EXTRA_MASTERD_ARGS” instead of the correct
“local args="$MASTERD_ARGS $EXTRA_MASTERD_ARGS"”.

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

14 years agoBump version to 2.1.0~rc3 v2.1.0rc3
Michael Hanselmann [Wed, 13 Jan 2010 15:45:14 +0000 (16:45 +0100)]
Bump version to 2.1.0~rc3

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