ganeti-github.git
7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 years agoBump up version for 2.7.0~beta3 devel-2.7 github/devel-2.7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 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>

7 years agoVerify individual disks in Instance
Klaus Aehlig [Tue, 9 Apr 2013 12:29:59 +0000 (14:29 +0200)]
Verify individual disks in Instance

Instance policy on disks is specified on a per-disk basis. So extend
the instance description by the sizes of the individual disks and modify
the instance policy verification to correctly check individual disks.

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

7 years agoCompatibility fix for GHC 7
Michele Tartara [Thu, 11 Apr 2013 11:33:52 +0000 (13:33 +0200)]
Compatibility fix for GHC 7

Importing an instance, like JSON, automatically allows the names of all
its functions to be used.

If one of this functions (namely showJSON) is imported separately, GHC 6
is fine with that, but GHC 7 emits a warning (therefore, the compilation of
Ganeti fails because it requires no warnings).

This patch fixes the build for GHC 7 and has no impact on GHC 6.

Note that the same does not apply to the import of readJSON, because that
function is actually used in the same file, so it must be imported separately.

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

7 years agoProperly update iv_name of disks while changing templates
Michele Tartara [Wed, 10 Apr 2013 14:36:44 +0000 (14:36 +0000)]
Properly update iv_name of disks while changing templates

Trasforming the disk of an instance from DRBD to plain did not properly
update the iv_name of disks, leaving it to None.

This commit modifies _ConvertDrbdToPlain to properly set the iv_name
variables.

An analogous fix is not required in the opposite function,
_ConvertPlainToDrbd, because it uses _GenerateDiskTemplate, that already
takes care of doing that.

Fixes Issue 403.

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

7 years agoLimit the size of networks to /16
Helga Velroyen [Wed, 10 Apr 2013 12:06:19 +0000 (14:06 +0200)]
Limit the size of networks to /16

This patch introduces an upper limit to the size of the networks that can
be created.

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

7 years agoCheck minimum size of networks on creation
Helga Velroyen [Mon, 21 Jan 2013 15:20:34 +0000 (16:20 +0100)]
Check minimum size of networks on creation

When creating a network, so far no size constraints were checked.
We now limit the size of a network to a /30 or bigger, although
tecnically, the ipaddr library supports even /32 networks.

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

7 years agoFix job queue directory permission problems
Michele Tartara [Mon, 8 Apr 2013 12:33:37 +0000 (12:33 +0000)]
Fix job queue directory permission problems

If split users are used, the queue directory could only be accessed
by masterd, but also confd needs to be able to read it, e.g. when it
is queried as part of "gnt-job list"

This commit fixes the permissions in such a way to allow proper access rights.

Fixes Issue 406.

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

7 years agoThe disk size of a diskless instance is 0, not None
Klaus Aehlig [Mon, 8 Apr 2013 14:35:09 +0000 (16:35 +0200)]
The disk size of a diskless instance is 0, not None

For diskless instances it is still reasonable to sum up the disk usage
of all the (zero) disks, resulting in the empty sum. This uniformity
also has the advantage that iallocators (like hail) do not have to do
any special considerations for diskless instances.

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

7 years agoPostpone non-urgent TODO from 2.7 to 2.9
Michele Tartara [Tue, 9 Apr 2013 13:56:13 +0000 (15:56 +0200)]
Postpone non-urgent TODO from 2.7 to 2.9

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

7 years agoAdd tool for creating users and groups
Michele Tartara [Tue, 9 Apr 2013 13:12:02 +0000 (13:12 +0000)]
Add tool for creating users and groups

When executed in split user mode, Ganeti requires a specific set of users
and groups to be created in the appropriate way.

This commit introduces a tool that takes care of that automatically.

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

7 years agoBackwards compatibility fix for Lucid
Michele Tartara [Mon, 8 Apr 2013 09:15:30 +0000 (09:15 +0000)]
Backwards compatibility fix for Lucid

The code introduced by the previous commit triggered a possible library
conflict in Ubuntu Lucid.

This patch introduces an equivalent but more widely acceptable version of
the same code.

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

7 years agoProperly export errors while reading job list
Michele Tartara [Thu, 4 Apr 2013 16:49:49 +0000 (18:49 +0200)]
Properly export errors while reading job list

In case of problems while reading the job list from disk (such as permission
errors) confd would silently fail, writing a warning on the log file but
sending an empty list and no error message to the client.

Also, tests have been updated in accordance to the new interface of the modified
functions.

This commit fixes this problem [Issue 405].

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

7 years agoFix typo and improve comment
Michele Tartara [Thu, 4 Apr 2013 09:13:21 +0000 (11:13 +0200)]
Fix typo and improve comment

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

7 years agoFix a bug in the Runtime tests
Michele Tartara [Fri, 5 Apr 2013 13:42:31 +0000 (13:42 +0000)]
Fix a bug in the Runtime tests

A group name was erroneusly inserted in the list of user names.

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

7 years agoRestrict instance move to templates based on local files
Klaus Aehlig [Wed, 3 Apr 2013 15:16:09 +0000 (17:16 +0200)]
Restrict instance move to templates based on local files

Moving an instance is done by copying over the disks. Restrict
this to disk templates that are copyable. This avoids accidental
use on, e.g., the sharedfile template.

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

7 years agoIntroduce a constant for the copyable disk templates
Klaus Aehlig [Wed, 3 Apr 2013 15:16:00 +0000 (17:16 +0200)]
Introduce a constant for the copyable disk templates

This list contains the disk templates suitable for moving
an instance by copying the files. A requirement is that
they're not accessed externally or shared between nodes;
in particular, sharedfile is not suitable.

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

7 years agoDo not _RemoveDisks after failed _CreateDisks
Klaus Aehlig [Wed, 3 Apr 2013 09:21:27 +0000 (11:21 +0200)]
Do not _RemoveDisks after failed _CreateDisks

Now that _CreateDisks cleans up after itself in case of failure,
do not clean up at call sites, as there we have to overapproximate
thus potentially causing data loss.

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

7 years agoMake _CreateDisk clean up partially created disks on failure
Klaus Aehlig [Wed, 3 Apr 2013 09:21:20 +0000 (11:21 +0200)]
Make _CreateDisk clean up partially created disks on failure

_CreateDisk used to just throw an exception if _CreateBlockDev failed
leaving the caller in the state that some disks were created, without
precise knowledge which. Usually, the clean up then overapproximated
by removing all disks of the instance. This can cause data loss in case
the disk creation failed because of a file being already in the place
where the disk is to be created.

With this patch, upon failure, _CreateDisk removes the disks that were
successfully created, leaving a well-defined state.

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

7 years agoFix typo in an error message
Michele Tartara [Wed, 3 Apr 2013 09:07:59 +0000 (11:07 +0200)]
Fix typo in an error message

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

7 years agoBump up version for 2.7.0~beta2 v2.7.0beta2
Guido Trotter [Tue, 2 Apr 2013 12:18:50 +0000 (14:18 +0200)]
Bump up version for 2.7.0~beta2

Also update the release date for beta2

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

7 years agocheck-news: fix behavior on invalid date line
Guido Trotter [Tue, 2 Apr 2013 12:38:18 +0000 (14:38 +0200)]
check-news: fix behavior on invalid date line

Before:
$ ./autotools/check-news < ./NEWS
Traceback (most recent call last):
  File "./autotools/check-news", line 150, in <module>
    main()
  File "./autotools/check-news", line 120, in main
    parsed_ts = time.mktime(time.strptime(m.group("date"), "%d %b %Y"))
AttributeError: 'NoneType' object has no attribute 'group'

After:
$ ./autotools/check-news < ./NEWS
Line 8: Invalid release line

This happened because the error function just updates an error log,
rather than bailing out immediately.

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

7 years agoNews updates for 2.7.0 beta2
Guido Trotter [Tue, 12 Mar 2013 17:06:37 +0000 (18:06 +0100)]
News updates for 2.7.0 beta2

Mention most relevant updates and user visible changes and fixes.

These entries will only be maintained during the beta/rc series, but
will then be replaced with a single "2.7.0" entry when we will release
2.7.

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

7 years agocfgupgrade: Fix error messages
Bernardo Dal Seno [Wed, 20 Mar 2013 13:24:49 +0000 (14:24 +0100)]
cfgupgrade: Fix error messages

Messages were inconsistent. You could get both an error and a message
saying that everything was fine.

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

7 years agoUpdate "FIXME" string in RAPI
Michele Tartara [Wed, 20 Mar 2013 11:16:47 +0000 (12:16 +0100)]
Update "FIXME" string in RAPI

We are not ready for this change yet. Let's push it to 2.8.

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

7 years agorapi client: add target_node to migrate instance
Daniel Krambrock [Tue, 12 Mar 2013 17:17:24 +0000 (18:17 +0100)]
rapi client: add target_node to migrate instance

This allows migrating to any node, as it is already possible for
failover, when instances are externally mirrored.

Signed-off-by: Daniel Krambrock <danielk_lists@z9d.de>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

7 years agoMake diskless instances externally mirrored
Guido Trotter [Tue, 12 Mar 2013 15:07:04 +0000 (16:07 +0100)]
Make diskless instances externally mirrored

This addresses Issue 237.

Mirroring no disk is a no-op. As such we can treat them like mirrored
instances, since the data they need (none) will be present on all nodes.

This is definitely enough to failover or migrate instances with a manual
target node. Further work might be needed for support in hail.

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

7 years agoFix migrate/failover -n for ext mirror storage
Guido Trotter [Tue, 12 Mar 2013 15:24:44 +0000 (16:24 +0100)]
Fix migrate/failover -n for ext mirror storage

This fixes issue 396.

- Fix a wrong comment that mentions drbd8 when actually the code acts
  only on externally mirrored instances.
- Fix a wrong assert that requires failover/migrate to acquire the NAL
  on externally mirrored instances: this is the case only when a
  iallocator is used, not if a node is manually specified.

Extra qa should be added, but this can only be done if an externally
mirrored instance or a diskless instance is tested. It is easier to add
it on the master branch, where we have diskless instances support.

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

7 years agoAdd QA for instance creation with policy violation
Bernardo Dal Seno [Wed, 27 Feb 2013 10:47:02 +0000 (11:47 +0100)]
Add QA for instance creation with policy violation

When instance policy is violated, creation fails.

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

7 years agoAdd QA for policy-instance interactions
Bernardo Dal Seno [Fri, 22 Feb 2013 18:07:33 +0000 (19:07 +0100)]
Add QA for policy-instance interactions

Violations on policy changes are checked.

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

7 years agoAdd QA for cluster policies
Bernardo Dal Seno [Thu, 21 Feb 2013 17:58:20 +0000 (18:58 +0100)]
Add QA for cluster policies

qa_cluster.TestClusterSetISpecs() is exported as it will be used in future
tests.

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

7 years agoUnit tests for objects.InstancePolicy + a fix
Bernardo Dal Seno [Tue, 19 Feb 2013 21:13:27 +0000 (22:13 +0100)]
Unit tests for objects.InstancePolicy + a fix

Tests for:
  objects.InstancePolicy.CheckParameterSyntax()
  objects.InstancePolicy.CheckDiskTemplates()
  objects.InstancePolicy.CheckISpecSyntax()

Instance policies with an empty disk-template list now are reported.

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

7 years agoUnit tests for objects.FillIPolicy() + small fix
Bernardo Dal Seno [Tue, 19 Feb 2013 13:56:05 +0000 (14:56 +0100)]
Unit tests for objects.FillIPolicy() + small fix

IPOLICY_DEFAULTS is now a legal policy (the disk-templates entry was a set
instead of a list, before).

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

7 years agoFix upgrade of policy in objects.Cluster
Bernardo Dal Seno [Wed, 27 Feb 2013 17:50:17 +0000 (18:50 +0100)]
Fix upgrade of policy in objects.Cluster

Unknown elements were silently removed on startup. This means that a
software upgrade could result in lost configuration information if
cfgupgrade wasn't run promptly.

Added unit test for Cluster.UpgradeConfig() to cover this case.

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

7 years agoFix instance policy checks for default back-end parameters
Bernardo Dal Seno [Thu, 7 Mar 2013 02:14:56 +0000 (03:14 +0100)]
Fix instance policy checks for default back-end parameters

Policy violations of back-end parameters that used the cluster default
value were not reported in cluster-verify.

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

7 years agoFix restoring default instance specs in group policies
Bernardo Dal Seno [Mon, 25 Feb 2013 13:16:40 +0000 (14:16 +0100)]
Fix restoring default instance specs in group policies

"default" was not accepted as a valid input value for instance specs in
group policies, due to a bug introduced in 2cc673a3e (and released with
2.6.0). Added QA for this and another similar case.

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

7 years agoUnit tests for cmdlib._GetUpdatedIPolicy()
Bernardo Dal Seno [Mon, 18 Feb 2013 17:02:06 +0000 (18:02 +0100)]
Unit tests for cmdlib._GetUpdatedIPolicy()

Not 100% coverage, though.

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

7 years agoFix policy check for disk templates
Bernardo Dal Seno [Thu, 7 Mar 2013 00:46:14 +0000 (01:46 +0100)]
Fix policy check for disk templates

Instance disk template is checked against the policy, and diskless
instances aren't checked for the number of disks.

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