ganeti-local
10 years agoVersion bump for 2.7.2 v2.7.2
Michele Tartara [Thu, 26 Sep 2013 07:53:10 +0000 (09:53 +0200)]
Version bump for 2.7.2

Change the version number and the NEWS file for the 2.7.2 bugfix release.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoFix incorrect manpage reference to htools
Martin Zobel-Helas [Mon, 16 Sep 2013 11:42:46 +0000 (13:42 +0200)]
Fix incorrect manpage reference to htools

the manpages for hcheck, hinfo and hroller have an incorrect reference
to htools(7) which does not exist. This patch links them to htools(1).

This bug also fixes Debian BTS#721824 (http://bugs.debian.org/721824)

Signed-off-by: Martin Zobel-Helas <zobel@debian.org>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix documentation of gnt-instance batch-create
Thomas Thrainer [Mon, 5 Aug 2013 10:50:37 +0000 (12:50 +0200)]
Fix documentation of gnt-instance batch-create

The documentation of gnt-instance batch-create was outdated and
contained invalid examples. This patch corrects the man page and
includes working example inputs.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoSupport multi instance allocs without iallocator
Thomas Thrainer [Mon, 5 Aug 2013 10:11:21 +0000 (12:11 +0200)]
Support multi instance allocs without iallocator

If all instances in the multi allocation request have already their
primary and secondary node set, there is no need for an iallocator. Thus
don't require it in this case and omit the call to it all together.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDocument --no-conflicts-check for gnt-network
Thomas Thrainer [Mon, 5 Aug 2013 07:46:30 +0000 (09:46 +0200)]
Document --no-conflicts-check for gnt-network

gnt-network add and connect do support the --no-conflicts-check option.
This is now also documented in the man pages.

This fixes issue 526.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoCheck disk template in right dict when copying
Thomas Thrainer [Wed, 31 Jul 2013 14:16:39 +0000 (16:16 +0200)]
Check disk template in right dict when copying

Due to the structure of the code this condition can't possibly be true.
We have to look in the new_diskparams dict instead, otherwise it'd be
possible to try to update a non-existing entry.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoganeti.backend_unittest: chmod restricted cmd dir
Apollon Oikonomopoulos [Wed, 31 Jul 2013 14:30:29 +0000 (17:30 +0300)]
ganeti.backend_unittest: chmod restricted cmd dir

TestVerifyRestrictedCmdDirectory.testNormal implicitly relies on the current
umask to check the behaviour of backend._VerifyRestrictedCmdDirectory. However,
when run under a more relaxed umask (as in the case of the Debian buildd's
using sbuild and - apparently - umask 0002), it fails.

Since this kind of failure is already tested for previously and since we should
check that a "known-normal" directory passes the test, we explicitly chmod()
the temporary directory to 0755.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoFix formatting of tuple in error message
Thomas Thrainer [Wed, 31 Jul 2013 12:58:29 +0000 (14:58 +0200)]
Fix formatting of tuple in error message

The missing str() call caused to raise another exception than the wanted
one. Transforming the tuple to string fixes this problem.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix 'prcre' typo in INSTALL
Guido Trotter [Tue, 30 Jul 2013 09:48:35 +0000 (11:48 +0200)]
Fix 'prcre' typo in INSTALL

Thanks to "Izhar ul Hassan" for reporting the issue.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFormat gnt-network info group output
Apollon Oikonomopoulos [Mon, 29 Jul 2013 12:50:00 +0000 (15:50 +0300)]
Format gnt-network info group output

gnt-network info currently displays the connected group output unformatted:

 # gnt-network info
 ...
   connected to node groups:
    ['med', 'bridged', 'staging']

This patch adds formatting to the node group output.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd 2.7.2 NEWS entry
Apollon Oikonomopoulos [Mon, 29 Jul 2013 12:49:41 +0000 (15:49 +0300)]
Add 2.7.2 NEWS entry

Prepare to list changes for 2.7.2.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoUpdate NEWS and version for Ganeti 2.7.1 v2.7.1
Guido Trotter [Thu, 25 Jul 2013 10:36:54 +0000 (12:36 +0200)]
Update NEWS and version for Ganeti 2.7.1

Release 2.7.1 with a handful of minor fixes.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agodaemon-util: pass --oknodo at rotate_logs
Apollon Oikonomopoulos [Wed, 24 Jul 2013 06:22:00 +0000 (09:22 +0300)]
daemon-util: pass --oknodo at rotate_logs

daemon-util's rotate_logs() did not pass --oknodo to start-stop-daemon while
HUPing the daemon processes. As a result, rotate_logs would fail for a
non-running daemon causing rotate_all_logs to exit prematurely.

We can fix this by either passing --oknodo to start-stop-daemon, or have
rotate_all_logs ignore any errors. The former is probably a safer approach - as
it doesn't mask any potential coding errors in rotate_logs - and is also
semantically correct (we only care about log rotation if a daemon is actually
running).

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd logrotate example
Apollon Oikonomopoulos [Tue, 23 Jul 2013 14:22:24 +0000 (17:22 +0300)]
Add logrotate example

Add an example logrotate snippet, along with the relevant documentation.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agodaemon-util: provide rotate_logs and rotate_all_logs actions
Apollon Oikonomopoulos [Tue, 23 Jul 2013 14:21:31 +0000 (17:21 +0300)]
daemon-util: provide rotate_logs and rotate_all_logs actions

Modify daemon-util to allow sending SIGHUP to one or all daemons. This is meant
as a utility function to be used in logrotate definitions.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoFix RAPI to include missing network fields
Christos Stavrakakis [Wed, 10 Jul 2013 10:48:21 +0000 (13:48 +0300)]
Fix RAPI to include missing network fields

Fix RAPI interface to include missing network fields. Specifically, fix
instance queries to include the network name for instance NICs. Also fix
network queries to include missing common fields, like uuid and serial.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd support for querying network timestamps
Christos Stavrakakis [Wed, 10 Jul 2013 10:48:20 +0000 (13:48 +0300)]
Add support for querying network timestamps

Add creation and modified timestamps when creating a new network, and
extend the available query fields for networks with these fields,
namely 'ctime' and 'mtime'.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoIn the crontab example, look for the correct binary
Klaus Aehlig [Tue, 9 Jul 2013 08:40:52 +0000 (10:40 +0200)]
In the crontab example, look for the correct binary

When ganeti-master-cleaner was merged back into ganeti-cleaner in 46118ed2,
the binary to test for should have also been updated. Do this now.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix wrong numbering in UPGRADE documentation
Michele Tartara [Mon, 8 Jul 2013 08:15:26 +0000 (08:15 +0000)]
Fix wrong numbering in UPGRADE documentation

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRelease version 2.7.0 v2.7.0
Guido Trotter [Thu, 4 Jul 2013 11:35:02 +0000 (13:35 +0200)]
Release version 2.7.0

We don't have notice of anything blocking for 2.7, and it's been in
release candidate state long enough. Any future problems can be
addressed as bugfixes.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix "instance replace" typo in admin.rst
Guido Trotter [Tue, 2 Jul 2013 15:10:08 +0000 (17:10 +0200)]
Fix "instance replace" typo in admin.rst

gnt-instance `replace` should read `replace-disks`

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix typo in the install guide
Michele Tartara [Tue, 2 Jul 2013 11:18:51 +0000 (11:18 +0000)]
Fix typo in the install guide

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoDisable pylint E1101 on hypothetical import
Klaus Aehlig [Wed, 26 Jun 2013 10:49:10 +0000 (12:49 +0200)]
Disable pylint E1101 on hypothetical import

In some versions of python the module IN does not provide
the constant SO_PEERCRED (issue 191). So in commit 069a4b
a work around was added. However, this work around still
leaves lint warnings when working with those versions of
python. So disable this warning during the work around,
so that users of these python versions can still develop
and contribute to ganeti.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoProvide the right fix for the kvm_extra parameter v2.7.0rc3
Guido Trotter [Tue, 25 Jun 2013 06:43:57 +0000 (08:43 +0200)]
Provide the right fix for the kvm_extra parameter

With the previous adjustment the arguments were boxed into one extra
array. This actually makes the parameter work (with the same caveats).

The manpage is also updated with the limitations.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoNEWS and version updates for 2.7.0~rc3
Guido Trotter [Mon, 24 Jun 2013 14:17:47 +0000 (16:17 +0200)]
NEWS and version updates for 2.7.0~rc3

Time for a new release.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agokvm: don't pass whole extra as a single argument
Guido Trotter [Mon, 24 Jun 2013 14:45:00 +0000 (16:45 +0200)]
kvm: don't pass whole extra as a single argument

If extra is longer than a single word passing it the way it was passed
won't work. Of course this solution is also only partial, as won't take
into account any form of quoting. :/

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFor node queries allow short forms of host names
Klaus Aehlig [Fri, 21 Jun 2013 13:53:15 +0000 (15:53 +0200)]
For node queries allow short forms of host names

For node queries use the host-name filter instead of the simple
equality-based one.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoProvide a special filter for host names
Klaus Aehlig [Fri, 21 Jun 2013 13:51:00 +0000 (15:51 +0200)]
Provide a special filter for host names

For host names, usually short forms are used, e.g., node1 or node1.sub
instead of the full qualified node1.sub.example.com. Therefore comparing
node names only by equality is too restrictive. This patch provides an
alternative makeHostnameFilter to makeSimpleFilter suitable for comparing
host names.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoCatch DeviceCreationError unhandled exceptions
Guido Trotter [Fri, 21 Jun 2013 13:23:28 +0000 (15:23 +0200)]
Catch DeviceCreationError unhandled exceptions

_CreateBlockDevInner is called twice in TLReplaceDisks. While this
should be fixed, right now this leaves the DeviceCreationError exception
unhandled, which causes a problem due to the fact that this exception
was never supposed to be sent over the wire. For 2.7 we just catch the
exception and convert it to an OpExecError, but we should later do a
more proper cleanup.

This addresses Issue 472.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agogrow disk: call SetDiskID before blockdev_getsize
Guido Trotter [Fri, 21 Jun 2013 09:19:44 +0000 (11:19 +0200)]
grow disk: call SetDiskID before blockdev_getsize

Missing this call caused blockdev_getsize to be called on the wrong
physical device, and fail.

This fixes Issue 497.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix daemon QA tests
Thomas Thrainer [Fri, 21 Jun 2013 09:12:17 +0000 (11:12 +0200)]
Fix daemon QA tests

TestInstanceConsecutiveFailures now leaves the test instance in the same
state it got it.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix permissions of the queue archive dir
Guido Trotter [Thu, 20 Jun 2013 16:35:40 +0000 (18:35 +0200)]
Fix permissions of the queue archive dir

The permissions were set to 0740, but of course being a directory the
correct permissions are 0750.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd a warning about the restriction of gnt-node evacuate
Klaus Aehlig [Thu, 20 Jun 2013 14:53:31 +0000 (16:53 +0200)]
Add a warning about the restriction of gnt-node evacuate

Even though gnt-node evacuate should be able to evacuate all instances
at once, this currently is not the case. Add a warning about this deficit
for the time being.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMore agressively line break man pages
Klaus Aehlig [Tue, 18 Jun 2013 12:11:15 +0000 (15:11 +0300)]
More agressively line break man pages

Newer versions of pandoc (as, e.g., shipped with Ubuntu 13.04)
more agressively quote, in particular minus signs. That sometimes
leads to unintended line breaks, which are a problem, if the new
line starts with a dot.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd a test for hspace to respect instance policy
Klaus Aehlig [Thu, 13 Jun 2013 14:05:46 +0000 (16:05 +0200)]
Add a test for hspace to respect instance policy

In this example, the instance policy for disks prevents allocation
of more than one instance per node. The test verifies that tiered
allocation still respects this and doesn't attempt to place policy
violating instances on the cluster.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMake shrinkByType aware of individual disks
Klaus Aehlig [Thu, 13 Jun 2013 14:05:45 +0000 (16:05 +0200)]
Make shrinkByType aware of individual disks

When shrinking an instances, you can't just get smaller disk footprint
while leaving the individual disks as they are. Make the shrink
heuristic aware of that fact, and decrease all individual disks as
well. Fixes issue 484.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoDocument users-setup tool
Michele Tartara [Thu, 30 May 2013 20:42:25 +0000 (16:42 -0400)]
Document users-setup tool

The users-setup tool was added but had no documentation up to now. This commit
fixes this issue.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

10 years agoAdjusting permissions after confd start
Helga Velroyen [Wed, 29 May 2013 09:40:35 +0000 (11:40 +0200)]
Adjusting permissions after confd start

This is a workaround for issue 477. Confd resets the
permissions of the query socket in a wrong way. This
patch fixes them after the start of confd.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoEnsure the queue socket has the right permissions
Guido Trotter [Wed, 29 May 2013 05:07:30 +0000 (14:07 +0900)]
Ensure the queue socket has the right permissions

RAPI needs to be able to perform queries as well.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoUpdate IAllocator interface documentation
Thomas Thrainer [Thu, 23 May 2013 15:43:41 +0000 (17:43 +0200)]
Update IAllocator interface documentation

Update the missing documentation for the tags fields of node groups.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(partially cherry picked from commit 2daca99b5be21ea4667637721ee2c65a14444520)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoBump up version for 2.7.0~rc2 release v2.7.0rc2
Guido Trotter [Fri, 24 May 2013 09:21:26 +0000 (11:21 +0200)]
Bump up version for 2.7.0~rc2 release

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd NEWS entry for SO_PEERCRED fix
Guido Trotter [Wed, 22 May 2013 14:55:37 +0000 (16:55 +0200)]
Add NEWS entry for SO_PEERCRED fix

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoWorkaround missing SO_PEERCRED
Guido Trotter [Wed, 22 May 2013 12:57:51 +0000 (14:57 +0200)]
Workaround missing SO_PEERCRED

This bug happens in a few new distributions, so we workaround it by
defining the constant ourselves, if it's missing.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd debugging clause to _ExpandCheckDisks error
Guido Trotter [Wed, 22 May 2013 12:52:32 +0000 (14:52 +0200)]
Add debugging clause to _ExpandCheckDisks error

This has been reported by users, so we should have the extra debugging
available.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMention hail network incompatibility in manpages
Guido Trotter [Wed, 22 May 2013 10:54:49 +0000 (12:54 +0200)]
Mention hail network incompatibility in manpages

We can't fix this in the 2.7 version, so it should be documented.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoRemove obsolete Debian-related documentation
Thomas Thrainer [Wed, 22 May 2013 09:23:59 +0000 (11:23 +0200)]
Remove obsolete Debian-related documentation

This part of the documentation refers to Grub instead of Grub2, but
Grub2 has been the standard boot loader since Squeeze. As this part only
(wrongly) repeats the preceeding documentation, it's removed completely.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoUpdate NEWS for 2.7.0 rc2
Guido Trotter [Tue, 21 May 2013 08:00:43 +0000 (10:00 +0200)]
Update NEWS for 2.7.0 rc2

Move "local" entries at the bottom, and leave global 2.7 entries at the
top, as for the other releases.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoImprove installation documentation
Thomas Thrainer [Tue, 21 May 2013 09:53:06 +0000 (11:53 +0200)]
Improve installation documentation

Based on user feedback the installation documentation is clarified and
extended.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
(cherry picked from commit 3913eaa72b8a48706ca4caa59dd022fa1a05805a)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoFix owner of the OS log dir
Balazs Lecz [Fri, 17 May 2013 10:23:24 +0000 (11:23 +0100)]
Fix owner of the OS log dir

The OS log dir is used by noded, not masterd.

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

10 years agoUpdate NEWS with disk creation fixes
Bernardo Dal Seno [Fri, 17 May 2013 00:40:21 +0000 (02:40 +0200)]
Update NEWS with disk creation fixes

Also document a couple more fixes.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoDon't fail to deactivate master IP if already down
Thomas Thrainer [Tue, 14 May 2013 14:21:25 +0000 (16:21 +0200)]
Don't fail to deactivate master IP if already down

The master IP setup script now checks if the master IP is actually
configured on the machine before trying to remove the IP.

This fixes issue 460.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd QA for recreating single instance disks
Bernardo Dal Seno [Fri, 10 May 2013 23:37:45 +0000 (01:37 +0200)]
Add QA for recreating single instance disks

So far QA only recreated the whole set of disks at once.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoAdd QA for gnt-instance modify --disk
Bernardo Dal Seno [Fri, 10 May 2013 23:23:08 +0000 (01:23 +0200)]
Add QA for gnt-instance modify --disk

Just a very basic test that adds and then removes a disk.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoClean up when "gnt-instance modify" fails to create a disk
Bernardo Dal Seno [Fri, 10 May 2013 14:27:20 +0000 (16:27 +0200)]
Clean up when "gnt-instance modify" fails to create a disk

cmdlib.LUInstanceSetParams now uses helper functions to create and wipe
disks, so that when the creation of a disk fails, any leftover device is
cleaned up. As a bonus, exceptions raised by _CreateBlockDev() are caught
correctly.

Now cmdlib._CreateDisks() is used every time there are disks to create.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agorecreate-disks honors the prealloc_wipe_disks flag
Bernardo Dal Seno [Fri, 10 May 2013 13:05:56 +0000 (15:05 +0200)]
recreate-disks honors the prealloc_wipe_disks flag

Now even recreate-disks wipes the newly-created disks, if the flag is set.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoIntroduce wrapper for cmdlib._WipeDisks()
Bernardo Dal Seno [Fri, 10 May 2013 13:44:01 +0000 (15:44 +0200)]
Introduce wrapper for cmdlib._WipeDisks()

The wrapper handles errors by logging them and cleaning up freshly-created
disks.

Also, the correct disk is used in the error message when an error happens
in cmdlib._CreateDisks() and the resulting disk clean-up fails.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoDon't catch an exception that cannot be raised
Bernardo Dal Seno [Thu, 9 May 2013 17:07:34 +0000 (19:07 +0200)]
Don't catch an exception that cannot be raised

Since 9b221ea4, _CreateBlockDev() doesn't raise OpExecError any more. Yet
some code was left in place to catch it. By removing that code we have two
advantages:
1. Dead code is removed.
2. If for whatever reason _CreateBlockDev() raises OpExecError, the
   exception is not silently dropped and we notice (so we can fix it).

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoWipe disks added through "gnt-instance modify"
Michael Hanselmann [Mon, 25 Feb 2013 15:27:27 +0000 (16:27 +0100)]
Wipe disks added through "gnt-instance modify"

In issue 353 Sascha Lucas reported that disks are not wiped when added
through “gnt-instance modify”. This patch adds this functionality and
updates the docstring for “_WipeDisks”.

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

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoSupport /var/run being a symlink in upload
Thomas Thrainer [Mon, 6 May 2013 13:10:00 +0000 (15:10 +0200)]
Support /var/run being a symlink in upload

Starting from Debian Wheezy, /var/run is a symlink to /run. If rsync
does not treat receiving symlinks to directories as directories, it
would remove the original symlink and create a new, empty directory
where only the files to sync are put in. In the case of /var/run, this
behavior severly impacts the running system (as, for example, several
PID can't be found anymore).

This is a cherry-pick of commit 412e738.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFinal NEWS and configure.ac update for 2.7.0~rc1 v2.7.0rc1
Guido Trotter [Fri, 3 May 2013 09:09:34 +0000 (11:09 +0200)]
Final NEWS and configure.ac update for 2.7.0~rc1

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agognt-job list: deal with non-ascii encoding in jobs
Helga Velroyen [Fri, 3 May 2013 08:28:35 +0000 (10:28 +0200)]
gnt-job list: deal with non-ascii encoding in jobs

This fixes issue 432. If a job summary contained a non-ascii character,
gnt-job list crashed badly so far. This patch fixes the crash and makes
gnt-job list display unicode characters properly.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agognt-cluster modify: check vg name only on vm-capable nodes
Helga Velroyen [Thu, 2 May 2013 13:21:27 +0000 (15:21 +0200)]
gnt-cluster modify: check vg name only on vm-capable nodes

This fixes issue 432: when setting the volume group name, the presence
of the volume group was checked on all nodes. This patch now restricts
the check only to the vm-capable ones.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoDisable inter-cluster instance move for file instances
Helga Velroyen [Thu, 2 May 2013 12:35:39 +0000 (14:35 +0200)]
Disable inter-cluster instance move for file instances

Inter-cluster instance moves depends on exporting an instance. For file-based
instance, exporting is not supported. Therefore, this patch disables
inter-cluster instance moves for file-based instances and informs the user
with an expressive error message.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoImprove error message for file instance creation
Helga Velroyen [Thu, 2 May 2013 09:04:50 +0000 (11:04 +0200)]
Improve error message for file instance creation

Currently, when creating an instance with file storage fails,
the error message is rather general. This patch adds a hint
on what to do as a possible fix.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoUpdate NEWS for 2.7.0 rc1
Guido Trotter [Thu, 2 May 2013 10:20:09 +0000 (12:20 +0200)]
Update NEWS for 2.7.0 rc1

Move the "main" 2.7 section up to rc1, and just leave the delta in
beta3. Then add a new beta3 to rc1 delta.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoadmin guide updates for 2.7
Guido Trotter [Thu, 2 May 2013 09:10:32 +0000 (11:10 +0200)]
admin guide updates for 2.7

- Mention the file-storage-paths config file
- Add information about sharedfile and ext storage types
- Change one manpage reference to a proper link

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMention file-storage-paths in UPGRADE
Guido Trotter [Thu, 2 May 2013 09:01:52 +0000 (11:01 +0200)]
Mention file-storage-paths in UPGRADE

It was in NEWS, but not mentioned at all in the upgrade notes.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agokvm: use -machine type,accel= for newer qemu
Guido Trotter [Wed, 1 May 2013 10:03:54 +0000 (12:03 +0200)]
kvm: use -machine type,accel= for newer qemu

-enable-kvm and -disable-kvm are deprecated in favor of accel=kvm passed
as a machine specification. This fixes compatibility with newer qemu
versions.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agokvm: Move parameter validation before use
Guido Trotter [Wed, 1 May 2013 09:56:12 +0000 (11:56 +0200)]
kvm: Move parameter validation before use

We had parameter validation when the runtime is generated, but in the
middle of the function. Move up, before any parameter is accessed.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agokvm: Use -display none rather than -nographic
Guido Trotter [Wed, 1 May 2013 09:37:54 +0000 (11:37 +0200)]
kvm: Use -display none rather than -nographic

Newer versions of kvm (from 1.4) don't support -nographic with
-daemonize. When -display exists, use -display none instead.

This fixes Issue 389.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoINSTALL updates for wheezy, and fixes
Guido Trotter [Tue, 30 Apr 2013 13:53:11 +0000 (15:53 +0200)]
INSTALL updates for wheezy, and fixes

- Remove mention of python 2.4 specific modules, as that version
  is not supported anymore
- Add bitarray and ipaddr
- Remove a double space
- Add mandatory C library packages too
- Mention the option of using drbd modules directly from your kernel

This also fixes Issue 372.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoDisable compiling mon-collector if monitoring is disabled
Michele Tartara [Tue, 30 Apr 2013 14:15:44 +0000 (14:15 +0000)]
Disable compiling mon-collector if monitoring is disabled

Mon-collector kept being compiled even if monitoring was disabled during
configure.

Fixes Issue 441.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd confd as a dependency of monitoring
Michele Tartara [Tue, 30 Apr 2013 14:01:42 +0000 (14:01 +0000)]
Add confd as a dependency of monitoring

Some data collectors require confd data information. Therefore, monitoring is
dependent on confd, but this was not checked.

This commit introduces such a check and partially fixes Issue 441.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix bug in group queries related to node/instance fields
Iustin Pop [Mon, 25 Feb 2013 16:18:36 +0000 (17:18 +0100)]
Fix bug in group queries related to node/instance fields

Since we use the primitive string type for group UUIDs, the group
fields have a bug where we pass the group name as filter for node
tests, whereas the nodes themselves use the group UUID. This results
in zero node count, empty node list, and no instances being reported
as assigned to groups.

The patch fixes this and adds a test for the node count. It does some
test generation improvement, and also cleans up whitespace issues in
Test/G/Q/Query.hs (the functions case_queryNode_allfields,
prop_queryGroup_noUnknown and case_queryGroup_allfields are unchanged
but simply have indentation fixed).

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

Cherry-pick of e7124835, fixes issue 436
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

Conflicts:
test/hs/Test/Ganeti/Objects.hs
test/hs/Test/Ganeti/Query/Query.hs

10 years agoman gnt-instance: new hypervisor parameter 'vif_type'
Helga Velroyen [Mon, 29 Apr 2013 16:43:39 +0000 (18:43 +0200)]
man gnt-instance: new hypervisor parameter 'vif_type'

This patch extends the man page of the 'gnt-instance' command
by describing the newly implemented hypervisor parameter
'vif_type'.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agognt-instance: new hypervisor parameter 'vif_type'
Helga Velroyen [Mon, 29 Apr 2013 15:04:29 +0000 (17:04 +0200)]
gnt-instance: new hypervisor parameter 'vif_type'

This patch fixes issue 247. It empowers the user to specify
explicitly the vif type of a nic configuration of a Xen HVM
instance. This includes the option of setting it to '' on the
commandline, causing Ganeti to leave out the 'type' parameter
in the vif configuration completely.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoLog at info level the success of a luxi query
Klaus Aehlig [Mon, 29 Apr 2013 12:08:17 +0000 (14:08 +0200)]
Log at info level the success of a luxi query

So far, any successful query was only logged at debug level, thus leaving
no traces in the logs, unless debugging was enabled. Therefore, we add
a notes about successful completion at info level. Also, repeat a failed
request at WARN level, so that, even if debugging disabled, the request
is available together with the error message in the logs.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix typo in documentation string
Klaus Aehlig [Mon, 29 Apr 2013 12:17:07 +0000 (14:17 +0200)]
Fix typo in documentation string

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoImprove gnt-instance documentation
Thomas Thrainer [Mon, 29 Apr 2013 07:03:08 +0000 (09:03 +0200)]
Improve gnt-instance documentation

Explain the relationship of the ip and network parameter in
`gnt-instance add --net` better.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoFix unclear error when replacing a nic's ip
Guido Trotter [Fri, 26 Apr 2013 12:37:19 +0000 (14:37 +0200)]
Fix unclear error when replacing a nic's ip

The current error message ends up saying something like
'192.168.5.5' != 'network1', which is sort of non-intuitive (yes, of
course they are different). Fix this by explaining better what the
erroneous condition actually is.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoIn plain to drbd conversion, rename LVs back on failure
Klaus Aehlig [Tue, 23 Apr 2013 09:35:18 +0000 (11:35 +0200)]
In plain to drbd conversion, rename LVs back on failure

Currently, if converting an instance from plain to drbd fails after
renaming the original LVs, the instance is left in an inconsistent
state. This commit tries to undo the renaming if a failure occurs
on assembling a DRBD device, e.g., when device minor numbers are
exhausted. (Issue 229)

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoImprove check for "unreleased" versions in NEWS
Guido Trotter [Thu, 25 Apr 2013 08:37:29 +0000 (10:37 +0200)]
Improve check for  "unreleased" versions in NEWS

Currently this is checked only when distcheck-release is called.
Check it in check-news instead, for all versions before the "current"
one (as defined by configure.ac)

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd missing fields in htools text-backend documentation
Bernardo Dal Seno [Wed, 24 Apr 2013 12:40:35 +0000 (14:40 +0200)]
Add missing fields in htools text-backend documentation

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoFix a few unclear sentences in gnt-cluster(8)
Guido Trotter [Tue, 23 Apr 2013 12:05:28 +0000 (14:05 +0200)]
Fix a few unclear sentences in gnt-cluster(8)

The renew-crypto entry had a few obscure sentences. Improve it by
rephrasing it.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoBump up version for 2.7.0~beta3 v2.7.0beta3
Guido Trotter [Mon, 22 Apr 2013 09:05:07 +0000 (11:05 +0200)]
Bump up version for 2.7.0~beta3

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoUpdate NEWS for 2.7.0~beta3
Guido Trotter [Thu, 18 Apr 2013 13:53:11 +0000 (15:53 +0200)]
Update NEWS for 2.7.0~beta3

- Most entries for beta1 are moved to the top level
- The beta1 to beta2 delta is left

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAllow proper cleanup of partially created disks
Michele Tartara [Tue, 16 Apr 2013 12:56:39 +0000 (12:56 +0000)]
Allow proper cleanup of partially created disks

During the creation of an instance, if the creation of disks fails, some
partially created disks might remain lying around. There is an already
implemented cleanup procedure, but it requires the disks to be listed in the
disks_created variable, which is updated after the creation of the disk itself
to prevent it from removing disks already existing previously.

This patch introduces a better tracking of partially created disks, so that
they can be removed without risking removing already existing ones.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoBetter wording of a documentation sentence
Michele Tartara [Thu, 18 Apr 2013 08:26:34 +0000 (10:26 +0200)]
Better wording of a documentation sentence

Specify that the need to manually modify the metavg only applies to
clusters with DRBD enabled, and is not always required.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoSpecify behaviour of vg-name change in gnt-cluster manual
Michele Tartara [Thu, 18 Apr 2013 08:01:17 +0000 (10:01 +0200)]
Specify behaviour of vg-name change in gnt-cluster manual

The current behaviour of a volume group name change after the cluster
has been initialized can be somewhat unclear. This patch specifies it
more esplicitly in the man page.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoSet the default metavg to be equal to the cluster name
Michele Tartara [Wed, 17 Apr 2013 15:32:00 +0000 (17:32 +0200)]
Set the default metavg to be equal to the cluster name

The default metavg was always set to be the constant value "xenvg".
This is OK for most cases, but if the cluster is initialized with
a default name through the --vg-name option, the metavg should change
as well.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agousers setup: add masterd to confd group
Guido Trotter [Tue, 16 Apr 2013 15:06:29 +0000 (08:06 -0700)]
users setup: add masterd to confd group

Without this masterd fails saving the config, because it can't change
the group on the file.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoMove HooksMaster out of the mcpu module
Guido Trotter [Sun, 14 Apr 2013 15:51:08 +0000 (08:51 -0700)]
Move HooksMaster out of the mcpu module

We need to do this, so that backend.py doesn't need to import mcpu, and
thus indirectly cmdlib. This reduces the size of the node daemon by
about half, which is very important as it is pinned in memory.

This solves Issue 419.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoUse KB as the unit for LVM PE size
Aaron Knister [Mon, 15 Apr 2013 16:26:36 +0000 (12:26 -0400)]
Use KB as the unit for LVM PE size

LogicalVolume.Attach in bdev.py is calling "lvs" and specifying a unit of
Megabytes that is then converted to an integer resulting in the value 0 for
small sizes.

This patch makes Ganeti use KB for the unit instead of MB.

Fixes Issue 347.

Signed-off-by: Aaron Knister <aaron.knister@gmail.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoImprove RAPI documentation for command line usage
Michele Tartara [Fri, 12 Apr 2013 08:47:06 +0000 (08:47 +0000)]
Improve RAPI documentation for command line usage

Provide some more insights about how to use the RAPI from the command line
through the "curl" command.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMore info on using the RAPI
Michele Tartara [Tue, 26 Mar 2013 16:21:43 +0000 (16:21 +0000)]
More info on using the RAPI

Add some additional information about how to use/test the RAPI,
including how to specify authentication credentials.

Cherry picked from 681f4f7bb95a2b467f917c84a68ccf9aa7665763 on master.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix burnin install path
Guido Trotter [Thu, 11 Apr 2013 20:23:36 +0000 (16:23 -0400)]
Fix burnin install path

Due to a bug in 8e55e20f burnin's installation path got changed.
Moving tools/burnin to the right makefile target reverts this (while
preserving the value of the original commit).

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoFix format of the NEWS file
Klaus Aehlig [Thu, 11 Apr 2013 16:29:55 +0000 (18:29 +0200)]
Fix format of the NEWS file

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoNEWS: Add news entry for the hail disk policy fix
Klaus Aehlig [Thu, 11 Apr 2013 11:37:48 +0000 (13:37 +0200)]
NEWS: Add news entry for the hail disk policy fix

hail now correctly applies the instance disk policies, which
leads to differnt allocations.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd shelltests verifying hail applies disk ipolicy per disk
Klaus Aehlig [Tue, 9 Apr 2013 09:24:09 +0000 (11:24 +0200)]
Add shelltests verifying hail applies disk ipolicy per disk

We test on two minimal examples, a positive and a negative one, where
the possibility to allocate a node depends on whether the disk policy
is checked on a per-disk level or on the total amount of disk space
requested.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMake the disks parameter available to the constructor
Klaus Aehlig [Tue, 9 Apr 2013 13:52:09 +0000 (15:52 +0200)]
Make the disks parameter available to the constructor

In that way, tools building on Instance will benefit from the corrected
verification semantics of the instance policy on disk space.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>