ganeti-local
12 years agoMerge branch 'stable-2.6'
Michael Hanselmann [Fri, 15 Jun 2012 11:36:44 +0000 (13:36 +0200)]
Merge branch 'stable-2.6'

* stable-2.6:
  Fix cfgupgrade unittests
  Upgrade wrong iv_names at cfgupgrade time
  query2: Add <, >, <=, >= comparison operators
  Fix creation of plain instances with --no-wait-for-sync
  Fixed typos, formatting, etc and added a comment
  Fix daemon-util with non-root user models

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

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

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

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

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

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

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

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

12 years agoAdd query2 numeric comparison operators
Guido Trotter [Thu, 14 Jun 2012 15:19:51 +0000 (16:19 +0100)]
Add query2 numeric comparison operators

These were recently added to the python version.

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

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

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

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

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

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

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

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

12 years agoHaskell data types for query2
Guido Trotter [Wed, 23 May 2012 12:25:02 +0000 (14:25 +0200)]
Haskell data types for query2

This contains the types to express query2 queries, filters and results.

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

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

This patch only touches comments and man pages.

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

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

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

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

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

12 years agoMerge branch 'stable-2.6'
Iustin Pop [Tue, 12 Jun 2012 11:32:08 +0000 (13:32 +0200)]
Merge branch 'stable-2.6'

* stable-2.6: (26 commits)
  Bump version for beta 2 release
  Fix epydoc raises L{...} usage
  Fix race condition in test for *FileID functions
  Move KVM keymap from GenerateRuntime to ExecuteRuntime
  Add the keymap directory to the list of runtime KVM dirs
  Fix make -n use
  Enable hlint in lint and reorganise this target
  Improve error message for auto-promote/node modify
  Fix QA import of existing instances
  Remove one obsolete hlint override
  Fix prefix bug in Haskell ssconf implementation
  Move the ssconf file prefix constant to constants.py
  QA: Add configuration options for static MAC address
  QA: Ignore tags using regular expression
  Fix parallel build failures
  QA: Add default setting for tests
  QA: add toggle for fewer common instance tests
  QA: stop logging SSH arguments for each invocation
  Switch QA to tty-less mode
  Fix a type issue and bad logic in cluster verification
  ...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

This patch reorganises the lint target by:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

12 years agoMove the ssconf file prefix constant to constants.py
Iustin Pop [Fri, 8 Jun 2012 10:44:28 +0000 (12:44 +0200)]
Move the ssconf file prefix constant to constants.py

This way, it can be reused in the Haskell code too.

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

12 years agoQA: Add configuration options for static MAC address
Michael Hanselmann [Wed, 6 Jun 2012 17:15:05 +0000 (19:15 +0200)]
QA: Add configuration options for static MAC address

In some QA environments static MAC addresses must be used.

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

12 years agoQA: Ignore tags using regular expression
Michael Hanselmann [Wed, 6 Jun 2012 10:54:32 +0000 (12:54 +0200)]
QA: Ignore tags using regular expression

In some QA environments external scripts may add tags. With this patch a
regular expression can be used to ignore them during QA runs.

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

12 years agoMerge branch 'stable-2.5' into stable-2.6
Iustin Pop [Wed, 6 Jun 2012 10:54:56 +0000 (12:54 +0200)]
Merge branch 'stable-2.5' into stable-2.6

* stable-2.5:
  Fix parallel build failures
  QA: Add default setting for tests

Conflicts:
        Makefile.am (expected, from the parallel build fixes)
        qa/qa_config.py (due to cherry-pick, ignored, simply checkout out with --ours)

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

12 years agoFix parallel build failures
Iustin Pop [Wed, 6 Jun 2012 09:34:33 +0000 (11:34 +0200)]
Fix parallel build failures

This is the 2.5 version of the "fix build failures":

- man/%.gen could be left over even in case of failure, due to
  automake bug
- make man/%.gen runs RUN_IN_TEMPDIR, so let's depend on it, since
  that target has the proper dependencies (create needed dirs)
- man/%.gen depends on a number of built sources, but the dependency
  was not declared

Furthermore, wraps a long comment.

Tested with -j4/-j16, after `make maintainer-clean'.

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

12 years agoQA: Add default setting for tests
Michael Hanselmann [Fri, 20 Apr 2012 18:53:42 +0000 (20:53 +0200)]
QA: Add default setting for tests

Commit 1010ec70b1 enabled all tests by default. In some scenarios where
the configuration is static one may not want newly added tests to be
run.

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

12 years agoQA: add toggle for fewer common instance tests
Iustin Pop [Tue, 5 Jun 2012 09:54:10 +0000 (11:54 +0200)]
QA: add toggle for fewer common instance tests

Currently, the "common" instance tests (shutdown, rapi stopped
console, stopped modify, startup, rapi shutdown, rapi startup, list,
info, modify, rapi modify , console, rapi console, reinstall, rename,
rapi rename, rename and back, rapi rename and back, grow disk, reboot,
tags, cluster verify, rapi test instance, node list, job list) are run
4 times:

- one time for plain instance created via RAPI, using client
- one time for plain instance created via RAPI, without client
- one time for plain instance created via gnt-instance
- one time for DRBD instance created via gnt-instance

This makes the QA long, and is over-doing it (for non-full QAs): an
instance created via RAPI (either client) and via gnt-instance should
have the same parameters, but our duplicate tests do not ensure that,
just that instances behave OK.

This patch adds a toggle so that we can skip the common tests for
RAPI-created instances; the creation/deletion is still performed, but
all the other operations are not. This reduces the time of a "quick"
QA by ~20% (1h:15m → 1h).

The common tests will still be run (unconditionally) for
gnt-instance-created instances.

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

12 years agoQA: stop logging SSH arguments for each invocation
Iustin Pop [Tue, 5 Jun 2012 09:31:22 +0000 (11:31 +0200)]
QA: stop logging SSH arguments for each invocation

Currently, this is how the QA log looks like:

Command: ssh -oEscapeChar=none -oBatchMode=yes -l root -t -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes -oControlPath=/tmp/ganeti-qa-multiplexer.DMzkuH -oControlMaster=no node14 exit
Command: ssh -oEscapeChar=none -oBatchMode=yes -l root -t -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes node8 exit
Command: ssh -oEscapeChar=none -oBatchMode=yes -l root -t -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes node18 exit

And these arguments are repeated over and over. This patch proposes to
log once the arguments, at the beginning of the QA (so that the SSH
commands can be reproduced, if needed) and then drop them from the
log. The new output looks like:

SSH command for primary node: ssh -oEscapeChar=none -oBatchMode=yes -lroot -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes -oControlPath=/tmp/ganeti-qa-multiplexer.24lgrK -oControlMaster=no node14
SSH command for other nodes: ssh -oEscapeChar=none -oBatchMode=yes -lroot -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes NODE
(the above are the informational messages about parameters, then)
Command: ssh node14 exit
Command: ssh node8 exit
Command: ssh node18 exit

This makes the QA log much more readable, by dropping unneeded clutter
(look how long the original lines were), and hopefully also a bit
smaller (current QA log is > 100MB of text output).

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

12 years agoSwitch QA to tty-less mode
Iustin Pop [Fri, 1 Jun 2012 15:41:22 +0000 (17:41 +0200)]
Switch QA to tty-less mode

This makes ssh generate much less noise when QA is run itself without
a tty, as otherwise we get thousands of lines of:

  Pseudo-terminal will not be allocated because stdin is not a terminal.

in the QA logs (which are already big enough).

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

12 years agoFix a type issue and bad logic in cluster verification
Iustin Pop [Thu, 31 May 2012 15:00:37 +0000 (17:00 +0200)]
Fix a type issue and bad logic in cluster verification

Commit 2e04d454 introduced the new offline state for the instance
state, but being a big monolithic patch it sneaked in something that
doesn't make sense.

The checks for extra instances (either wrongly up or just unknown) are
done purely on a name-basis, not on objects, so the types there are
wrong. Furthermore, they have no relation to the admin state of the
instance, so we just drop the entire if block. We keep the increment
of the offline instance count, but move it to a different loop over
instances.

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

12 years agoMake the xen-cmd test more readable and portable
René Nussbaumer [Fri, 1 Jun 2012 09:44:49 +0000 (11:44 +0200)]
Make the xen-cmd test more readable and portable

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

12 years agodoc/hooks: Clarify hook directory structure
Michael Hanselmann [Thu, 31 May 2012 14:54:10 +0000 (16:54 +0200)]
doc/hooks: Clarify hook directory structure

I was not able to find where the “.d” suffix is documented, so this
clarification should make it more obvious.

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

12 years agoSupport xl as a xen interface command
René Nussbaumer [Thu, 31 May 2012 08:27:38 +0000 (10:27 +0200)]
Support xl as a xen interface command

xm and xl are mostly compatible, there is just a change in migrate,
which for now we simple bridge by comparing the command string.

Also XEN_CMD is now set during configure time. This will then be fixed
in Ganeti 2.7 when we make it an hvparams.

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

12 years agoAdd XEN_CMD to _autoconf.py
René Nussbaumer [Thu, 31 May 2012 08:54:13 +0000 (10:54 +0200)]
Add XEN_CMD to _autoconf.py

This is needed so we can specify the xen command upon configure time

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

12 years agoFix GenericCurlConfig when pycurl is linked against nss
René Nussbaumer [Wed, 30 May 2012 09:17:39 +0000 (11:17 +0200)]
Fix GenericCurlConfig when pycurl is linked against nss

Redhat links its pycurl against NSS/ so this check fails and therefore
makes ganeti-watcher unusable.

Even though this seems to fix the problem and works, further testing on
this might be needed.

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

12 years agoFix a tiny typo in a design doc
Iustin Pop [Wed, 30 May 2012 09:35:04 +0000 (11:35 +0200)]
Fix a tiny typo in a design doc

Reported by user ewoud, thanks!

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

12 years agoMerge branch 'stable-2.6'
Iustin Pop [Tue, 29 May 2012 15:12:03 +0000 (17:12 +0200)]
Merge branch 'stable-2.6'

* stable-2.6:
  Document that the disk/hypervisor state is not used
  Correct the watcher state files in the man page
  Re-wrap some lines in watcher code
  Add support for SIGHUP handling in Haskell daemons
  Rework logging setup for Haskell daemons
  Adapt example init.d script to work on Fedora
  Update the INSTALL doc for Fedora users
  kvm-ifup: Use /bin/bash

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

12 years agoDocument that the disk/hypervisor state is not used
Iustin Pop [Tue, 29 May 2012 12:08:14 +0000 (14:08 +0200)]
Document that the disk/hypervisor state is not used

This didn't get completed in time for 2.6, so we document that it's
not working as is. Well, it's not broken, just not used by anything.

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

12 years agoCorrect the watcher state files in the man page
Iustin Pop [Mon, 28 May 2012 14:05:32 +0000 (16:05 +0200)]
Correct the watcher state files in the man page

The move to per-group state files forgot to update the man page of
ganeti-watcher; let's fix this and add some more details on what
removal means and when it's needed.

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

12 years agoRe-wrap some lines in watcher code
Iustin Pop [Mon, 28 May 2012 14:05:31 +0000 (16:05 +0200)]
Re-wrap some lines in watcher code

These were using exactly 80 chars, and I like them smaller.

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

12 years agoAdd support for SIGHUP handling in Haskell daemons
Iustin Pop [Fri, 25 May 2012 16:00:56 +0000 (18:00 +0200)]
Add support for SIGHUP handling in Haskell daemons

This patch adds support for handling SIGHUP and reopening the
stdout/stderr logfile in daemon mode (but not in foreground mode).

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

12 years agoRework logging setup for Haskell daemons
Iustin Pop [Fri, 25 May 2012 15:40:53 +0000 (17:40 +0200)]
Rework logging setup for Haskell daemons

This fixes a missing functionality: closing of stdout/stderr when
forking daemons. Without this, starting the daemons from the command
line seems to work, but doing it from utils.RunCmd breaks, since
without closing the standard descriptors, RunCmd never finishes.

The code is not very nice; basically what we need is an actual type
for the LogMode desired (LogConsole, LogStderr, LogFile FilePath), but
the syslog (yes/no and *only*) complicates this even more. I'll think
more on this and probably fix it in master.

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

12 years agoAdapt example init.d script to work on Fedora
René Nussbaumer [Thu, 24 May 2012 13:36:47 +0000 (15:36 +0200)]
Adapt example init.d script to work on Fedora

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

12 years agoUpdate the INSTALL doc for Fedora users
René Nussbaumer [Thu, 24 May 2012 13:29:38 +0000 (15:29 +0200)]
Update the INSTALL doc for Fedora users

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

12 years agoMerge branch 'stable-2.5' into stable-2.6
Michael Hanselmann [Thu, 24 May 2012 14:01:48 +0000 (16:01 +0200)]
Merge branch 'stable-2.5' into stable-2.6

* stable-2.5:
  kvm-ifup: Use /bin/bash

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

12 years agokvm-ifup: Use /bin/bash
Michael Hanselmann [Thu, 24 May 2012 07:44:25 +0000 (09:44 +0200)]
kvm-ifup: Use /bin/bash

As reported by Ben Beuchler, kvm-ifup uses bash-specific constructs and
doesn't work with Ubuntu's default shell. We use bash all over the place
anyway, so changing the shebang line is the easiest solution.

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

12 years agoMerge branch 'stable-2.6'
Iustin Pop [Wed, 23 May 2012 12:05:05 +0000 (14:05 +0200)]
Merge branch 'stable-2.6'

* stable-2.6:
  Version bump for 2.6.0~beta1
  Adjust cfgupgrade for new minor version
  Add support to daemon-util for distributions without start-stop-daemon
  Improve the check-news script
  Fix NEWS file
  _MaybeParseUnit: The elements are dicts not arrays
  Make it possible to reset vcpu/spindle ratio to default
  Add man page documentation for cpu_mask hv parameter
  Add checks from wrong hard-coded paths in manpages
  Fix hardcoded paths in gnt-cluster.rst man page
  First round of NEWS file updates for 2.6
  gnt-group: Adding vcpu/spindle ratio to ipolicy flags
  gnt-cluster modify: Add ipolicy for spindle ratio opt
  cli: Add ipolicy_spindle_ratio to CreateIPolicyFromOpts
  gnt-instance info: Rework beparams listings
  Fix a tiny typo
  constants: Add FIXME regarding CPU pinning bitfield

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

12 years agoMerge branch 'devel-2.6' into stable-2.6
Iustin Pop [Wed, 23 May 2012 11:53:58 +0000 (13:53 +0200)]
Merge branch 'devel-2.6' into stable-2.6

It seems Michael submitted the daemon-util patch on devel-2.6, and I
didn't realise it. It's way too early in the release cycle of 2.6 to
have diverging branches, so I'm merging devel-2.6 into stable-2.6 and
then will ff the devel branch to the merge point.

* origin/devel-2.6:
  Add support to daemon-util for distributions without start-stop-daemon

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

12 years agoVersion bump for 2.6.0~beta1 v2.6.0beta1
Iustin Pop [Tue, 22 May 2012 15:46:22 +0000 (17:46 +0200)]
Version bump for 2.6.0~beta1

Finally!

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

12 years agoAdjust cfgupgrade for new minor version
Iustin Pop [Tue, 22 May 2012 15:59:44 +0000 (17:59 +0200)]
Adjust cfgupgrade for new minor version

Also does some abstracting of the versions.

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

12 years agoAdd support to daemon-util for distributions without start-stop-daemon
Jun Futagawa [Tue, 15 May 2012 07:38:07 +0000 (16:38 +0900)]
Add support to daemon-util for distributions without start-stop-daemon

This adds support to daemon-util for Red Hat based distributions that
do not have a start-stop-daemon. If /sbin/start-stop-daemon is not
available, daemon-util will source /etc/rc.d/init.d/functions.
check(), start(), and stop() are updated to use the relevant functions
from /etc/rc.d/init.d/functions.

Thanks to Stephen Fromm and Michael Hanselmann for improving the error
handling, style, and comments.

Signed-off-by: Jun Futagawa <jfut@integ.jp>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
(cherry picked from commit 4b42c3d665d4d92068e4319dfd35e83a54443f3b)

12 years agoImprove the check-news script
Iustin Pop [Tue, 22 May 2012 08:56:07 +0000 (10:56 +0200)]
Improve the check-news script

Allow all errors to be displayed, instead of aborting at the first
one, and don't show stacktraces anymore.

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

12 years agoFix NEWS file
Iustin Pop [Tue, 22 May 2012 08:52:29 +0000 (10:52 +0200)]
Fix NEWS file

Too many empty lines…

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

12 years ago_MaybeParseUnit: The elements are dicts not arrays
René Nussbaumer [Tue, 22 May 2012 08:56:35 +0000 (10:56 +0200)]
_MaybeParseUnit: The elements are dicts not arrays

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

12 years agoMake it possible to reset vcpu/spindle ratio to default
René Nussbaumer [Mon, 21 May 2012 14:31:42 +0000 (16:31 +0200)]
Make it possible to reset vcpu/spindle ratio to default

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

12 years agoAdd man page documentation for cpu_mask hv parameter
Iustin Pop [Fri, 18 May 2012 15:05:28 +0000 (17:05 +0200)]
Add man page documentation for cpu_mask hv parameter

This is adapted from the design doc.

Also fixes a typo in cmdlib.py.

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

12 years agoAdd checks from wrong hard-coded paths in manpages
Iustin Pop [Fri, 18 May 2012 10:23:26 +0000 (12:23 +0200)]
Add checks from wrong hard-coded paths in manpages

This is trivial, but should prevent such things in the future.

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

12 years agoFix hardcoded paths in gnt-cluster.rst man page
Iustin Pop [Fri, 18 May 2012 09:57:03 +0000 (11:57 +0200)]
Fix hardcoded paths in gnt-cluster.rst man page

Also reworks a bit the sentence and fixes a typo.

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

12 years agoFirst round of NEWS file updates for 2.6
Iustin Pop [Tue, 15 May 2012 17:13:06 +0000 (19:13 +0200)]
First round of NEWS file updates for 2.6

More will come, this is just what I took from the existing NEWS
entries.

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

12 years agognt-group: Adding vcpu/spindle ratio to ipolicy flags
René Nussbaumer [Mon, 21 May 2012 11:40:22 +0000 (13:40 +0200)]
gnt-group: Adding vcpu/spindle ratio to ipolicy flags

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

12 years agognt-cluster modify: Add ipolicy for spindle ratio opt
René Nussbaumer [Wed, 16 May 2012 14:53:47 +0000 (16:53 +0200)]
gnt-cluster modify: Add ipolicy for spindle ratio opt

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

12 years agocli: Add ipolicy_spindle_ratio to CreateIPolicyFromOpts
René Nussbaumer [Wed, 16 May 2012 14:49:57 +0000 (16:49 +0200)]
cli: Add ipolicy_spindle_ratio to CreateIPolicyFromOpts

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

12 years agoAdd support to daemon-util for distributions without start-stop-daemon
Jun Futagawa [Tue, 15 May 2012 07:38:07 +0000 (16:38 +0900)]
Add support to daemon-util for distributions without start-stop-daemon

This adds support to daemon-util for Red Hat based distributions that
do not have a start-stop-daemon. If /sbin/start-stop-daemon is not
available, daemon-util will source /etc/rc.d/init.d/functions.
check(), start(), and stop() are updated to use the relevant functions
from /etc/rc.d/init.d/functions.

Thanks to Stephen Fromm and Michael Hanselmann for improving the error
handling, style, and comments.

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

12 years agognt-instance info: Rework beparams listings
René Nussbaumer [Wed, 16 May 2012 12:14:10 +0000 (14:14 +0200)]
gnt-instance info: Rework beparams listings

This patch reworks the beparams listing to the new style. However, due
to this process the naming of the fields with mixed casing changed to
lowercase and is therefore not 100% compatible with the previous versions.

As "memory" is marked deprecated and sort of default we merge that just
into the actual dict, which leads to the following output:

  - maxmem: 128
  - memory: default (128)
  - minmem: 128

Instead of:

  - maxmem: 128
  - minmem: 128
  - memory: 128

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

12 years agoFix a tiny typo
Iustin Pop [Tue, 15 May 2012 17:08:47 +0000 (19:08 +0200)]
Fix a tiny typo

Was showing in the man page as --diskN, without a space.

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

12 years agoconstants: Add FIXME regarding CPU pinning bitfield
Michael Hanselmann [Tue, 15 May 2012 15:04:52 +0000 (17:04 +0200)]
constants: Add FIXME regarding CPU pinning bitfield

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

12 years agoAllow units in ipolicy disk/mem CLI changes
Iustin Pop [Mon, 14 May 2012 14:47:14 +0000 (16:47 +0200)]
Allow units in ipolicy disk/mem CLI changes

This makes "gnt-cluster modify --specs-mem-size max=16g" work. The
downside (due to how we iterate) is that error messages are not very
clear:

  $ gnt-cluster modify --specs-mem-size max=16a
  Failure: prerequisites not met for this operation:
  error type: wrong_input, error details:
  Invalid disk ({}) or memory ({'max': '16a'}) size in policy: Unknown unit: a

Also updates the help of these commands, which was very confusing
before (at least for me).

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

12 years agoMove some ipolicy functions from objects to cli
Iustin Pop [Mon, 14 May 2012 14:39:57 +0000 (16:39 +0200)]
Move some ipolicy functions from objects to cli

These are only used in CLI programs to parse command line options and
such they do not belong in object.py (I will change them more and I
don't want to add more code in objects.py).

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

12 years agoBeautify a couple of error messages
Iustin Pop [Mon, 14 May 2012 13:33:05 +0000 (15:33 +0200)]
Beautify a couple of error messages

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

12 years agoFix _ComputeNewInstanceViolations logic
Iustin Pop [Mon, 14 May 2012 13:31:37 +0000 (15:31 +0200)]
Fix _ComputeNewInstanceViolations logic

This function did the opposite: was computing which old instance
violated the specs but no longer do it now. new - old is the expected
behaviour.

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

12 years agoBeautify disk ipolicy violations in cluster-verify
Iustin Pop [Mon, 14 May 2012 13:21:27 +0000 (15:21 +0200)]
Beautify disk ipolicy violations in cluster-verify

Currently, we only get:

  instance3: ['disk-size value 512 is not in range [1024, 1048576]'

which doesn't explain which disk we are talking about. This patch
extends the verification functions to take an additional parameter
that qualifies the disk:

  instance3: ['disk-size/0 value 512 is not in range [1024, 1048576]'

Future patch will make the formatting of the list better.

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

12 years agoqa_utils: Factorize code for getting entity name
Michael Hanselmann [Tue, 15 May 2012 09:07:08 +0000 (11:07 +0200)]
qa_utils: Factorize code for getting entity name

This reduces code duplication and provides better error messages if
something is incorrect while getting a node or instance name.

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

12 years agoNEWS: Style fixes
Michael Hanselmann [Thu, 10 May 2012 10:59:06 +0000 (12:59 +0200)]
NEWS: Style fixes

- Quote where appropriate
- Small wording changes

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

12 years agoqa_utils: Accept string as instance for check
Michael Hanselmann [Mon, 14 May 2012 13:50:35 +0000 (15:50 +0200)]
qa_utils: Accept string as instance for check

Some tests don't have access to an instance dictionary.

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

12 years agoQA: Cleanup after commit 5fa0375e4a
Michael Hanselmann [Mon, 14 May 2012 13:51:51 +0000 (15:51 +0200)]
QA: Cleanup after commit 5fa0375e4a

Some tests had wrong assumptions on the instance status and some
needed explicit start or stop commands.

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

12 years agoLUInstanceCreate: Run rename script on instance import
Michael Hanselmann [Mon, 14 May 2012 13:46:22 +0000 (15:46 +0200)]
LUInstanceCreate: Run rename script on instance import

If an instance is imported with a different name, network settings may have to
be changed. Since import scripts may not already to the right thing, we decided
to run the rename script. The same technique is already used for inter-cluster
instance moves.

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

12 years agoganeti.query_unittest: Adding testcase for diskparams
René Nussbaumer [Mon, 14 May 2012 13:33:36 +0000 (15:33 +0200)]
ganeti.query_unittest: Adding testcase for diskparams

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

12 years agognt-group add: Fix diskparam fill
René Nussbaumer [Mon, 14 May 2012 08:32:09 +0000 (10:32 +0200)]
gnt-group add: Fix diskparam fill

This was a pretty non-obvious bug. A cluster looks sane after
gnt-cluster init, however on a daemon restart the diskparameters had the
default filled in. The same applies to gnt-group add. This is due to the
nature that UpgradeConfig() from NodeGroups did just populate them with
defaults if something was set on it.

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

12 years agognt-group modify: Fix an update issue with diskparams
René Nussbaumer [Fri, 11 May 2012 14:56:49 +0000 (16:56 +0200)]
gnt-group modify: Fix an update issue with diskparams

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

12 years agoMake x509 unittest testClockSkew a bit less flaky
Iustin Pop [Mon, 14 May 2012 09:33:04 +0000 (11:33 +0200)]
Make x509 unittest testClockSkew a bit less flaky

Since the tested function actually uses time.time(), it cannot be make
fully stable, but 1 second is very dangerous; let's just test SKEW * 2
and higher since that should be good (if the delta between _GenCert
and VerifyX509Certificate is 5 minutes, then…).

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

12 years agognt-group: Add info command
René Nussbaumer [Fri, 11 May 2012 13:27:58 +0000 (15:27 +0200)]
gnt-group: Add info command

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

12 years agocli: Make FormatParameterDict recursive
René Nussbaumer [Fri, 11 May 2012 13:15:35 +0000 (15:15 +0200)]
cli: Make FormatParameterDict recursive

This is useful if you have nested parameter dicts like in diskparams.

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

12 years agoquery: Expose diskparamters through query
René Nussbaumer [Fri, 11 May 2012 11:55:46 +0000 (13:55 +0200)]
query: Expose diskparamters through query

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

12 years agognt-cluster info: Print and format disk parameters
René Nussbaumer [Fri, 11 May 2012 09:47:35 +0000 (11:47 +0200)]
gnt-cluster info: Print and format disk parameters

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

12 years agoMerge branch 'devel-2.5'
Iustin Pop [Fri, 11 May 2012 13:48:32 +0000 (15:48 +0200)]
Merge branch 'devel-2.5'

* devel-2.5:
  Update NEWS and bump version for 2.5.1 release
  Fix gnt-group --help display
  Fix hardcoded Xen kernel path
  Fix grow-disk handling of invalid units
  Accept both PUT and POST in noded
  Preserve bridge MTU in KVM ifup script
  Update synopsis for “gnt-cluster repair-disk-sizes”
  Reconcile Makefile.am and test data files
  Workaround changed LVM behaviour
  Enable lvmstrap to run under Linux 3.x
  Add a default PATH variable to OS scripts env
  Move hooks PATH environment variable to constants
  Add note to the install doc about bridge MAC issues
  Fix exception re-raising in Python Luxi clients
  Fix LVM volume listing with newer LVM

Conflicts:
        NEWS (trivial)

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

12 years agoMerge commit 'v2.5.1' into devel-2.5
Iustin Pop [Fri, 11 May 2012 13:05:58 +0000 (15:05 +0200)]
Merge commit 'v2.5.1' into devel-2.5

* commit 'v2.5.1':
  Update NEWS and bump version for 2.5.1 release
  Fix gnt-group --help display
  Fix hardcoded Xen kernel path
  Fix grow-disk handling of invalid units
  Accept both PUT and POST in noded
  Preserve bridge MTU in KVM ifup script
  Update synopsis for “gnt-cluster repair-disk-sizes”
  Reconcile Makefile.am and test data files
  Workaround changed LVM behaviour
  Enable lvmstrap to run under Linux 3.x
  Add a default PATH variable to OS scripts env
  Move hooks PATH environment variable to constants
  Add note to the install doc about bridge MAC issues
  Fix exception re-raising in Python Luxi clients
  Fix LVM volume listing with newer LVM

Conflicts:
        lib/client/gnt_group.py (trivial, fixup conflicts from 6bc3ed14)

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

12 years agoRemove some duplicate code in the Xen config writing
Iustin Pop [Thu, 10 May 2012 18:26:39 +0000 (20:26 +0200)]
Remove some duplicate code in the Xen config writing

Should be straightforward; the only difference from before is that we
will remove the 'auto' file even during migration finalise.

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

12 years agoUpdate NEWS and bump version for 2.5.1 release v2.5.1
Iustin Pop [Fri, 11 May 2012 09:32:27 +0000 (11:32 +0200)]
Update NEWS and bump version for 2.5.1 release

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

12 years agoFix gnt-group --help display
Iustin Pop [Fri, 16 Mar 2012 10:59:01 +0000 (11:59 +0100)]
Fix gnt-group --help display

Copy-paste mismatch :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
(cherry picked from commit 36c70d4ddc508dd1ffdcc806d617d5100f4cb265)

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

12 years agoFix hardcoded Xen kernel path
Iustin Pop [Fri, 23 Mar 2012 09:08:41 +0000 (09:08 +0000)]
Fix hardcoded Xen kernel path

We already have a ./configure-time variable for this, but it seems to
be actually unused.

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

Signed-off-by: Iustin Pop <iustin@google.com>
(trivial patch, let's cherry-pick it)
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix grow-disk handling of invalid units
Iustin Pop [Fri, 27 Apr 2012 10:04:59 +0000 (12:04 +0200)]
Fix grow-disk handling of invalid units

The reason why grow-disk was doing:

$ gnt-instance grow-disk instance3 0 -64
Unhandled Ganeti error: Invalid format

Is because it does it's own ParseUnit call, and doesn't transform that
into a nicer message.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
(cherry picked from commit c8bde61ea8360da67fc09339f1fe29ddd0acc374)

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

12 years agoAccept both PUT and POST in noded
Iustin Pop [Fri, 21 Oct 2011 21:51:39 +0000 (23:51 +0200)]
Accept both PUT and POST in noded

This is a partial cherry-pick from
7530364ddbe949bc34fc26f25ba3f5d921beb021 on master:

Currently, noded requires PUT, even though the semantics of the RPC
calls do not match a PUT. We change the code accept both PUT and POST,
with the intention to remove the PUT support in a later version.

Additionally, we add a message to the HttpBadRequest exception to make
clear the failure mode (not seeing any error message was what made me
send this patch…). This was the only description-less use of this
exception, by the way.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
(cherry picked from commit 7530364ddbe949bc34fc26f25ba3f5d921beb021)

What was not cherry-picked is the rpc change (to switch to PUT). The
reason I want to backport this to devel-2.5 is that when upgrading to
2.6, having noded accept both makes for an easier upgrade path.

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

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

Yet another cherry-pick (must go deeper!); since we might not make a
new release from the devel-2.5 branch, let's add this to stable-2.5.

Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoPreserve bridge MTU in KVM ifup script
Andrea Spadaccini [Tue, 11 Oct 2011 13:39:05 +0000 (14:39 +0100)]
Preserve bridge MTU in KVM ifup script

Closes: #201 - KVM_IFUP does not set bridge-MTU on tap devices
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
(cherry picked from commit a1ec8695a6b453acdc2fa746a27be73c614b2e87)

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

12 years agoUpdate synopsis for “gnt-cluster repair-disk-sizes”
Michael Hanselmann [Thu, 3 Nov 2011 15:40:44 +0000 (16:40 +0100)]
Update synopsis for “gnt-cluster repair-disk-sizes”

Mention that instances can be passed on the CLI when “--help” is used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
(cherry picked from commit eb5ac108d146644200df98b9f90dae003dcea426)

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

12 years agoReconcile Makefile.am and test data files
Iustin Pop [Wed, 15 Feb 2012 16:02:33 +0000 (17:02 +0100)]
Reconcile Makefile.am and test data files

Sorry, forgot this in previous commit.

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

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

12 years agoWorkaround changed LVM behaviour
Iustin Pop [Wed, 15 Feb 2012 12:14:04 +0000 (13:14 +0100)]
Workaround changed LVM behaviour

The vgreduce command has changed behaviour from when we initially
wrote the code (2.02.02 versus 2.02.66, 4 years delta):

- if there are LVs which will be impacted, it requires --force
- otherwise refuses to proceed, but it still returns exit code 0

We handle this by looking to see if it returns "Wrote out consistent
volume group" (behaviour unchanged), or if it complains about
"--force"; in the case it didn't complete, we retry the operation.

We improve a bit the checking of "vgs", as it uses to fail silently
and we didn't detect it.

New tests for this function should test, I believe, all the expected
variations; at the least we now have data files with the expected
output.

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

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

12 years agoEnable lvmstrap to run under Linux 3.x
Alexander Schreiber [Tue, 13 Mar 2012 16:34:52 +0000 (17:34 +0100)]
Enable lvmstrap to run under Linux 3.x

Extend the kernel version check to also accept Linux 3.x as valid.

Signed-off-by: Alexander Schreiber <als@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit 1bf72492d381aacb5c488f1a87ac7665b9ddc6c7)

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

12 years agoapidoc: Fix some typos and errors introduced by my previous patches
René Nussbaumer [Thu, 10 May 2012 11:53:56 +0000 (13:53 +0200)]
apidoc: Fix some typos and errors introduced by my previous patches

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