ganeti-local
10 years agoNEWS update and version bump for 2.8 rc2 v2.8.0rc2
Michele Tartara [Tue, 27 Aug 2013 07:59:14 +0000 (09:59 +0200)]
NEWS update and version bump for 2.8 rc2

Latest modifications and fixes added to the NEWS file.

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

10 years agoAdd unit test for GetLinuxNodeInfo
Michele Tartara [Thu, 22 Aug 2013 08:53:07 +0000 (08:53 +0000)]
Add unit test for GetLinuxNodeInfo

The function was not unit tested previously.

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

10 years agoPrepare GetLinuxNodeInfo for testing
Michele Tartara [Thu, 22 Aug 2013 08:31:45 +0000 (10:31 +0200)]
Prepare GetLinuxNodeInfo for testing

The names of the input files are not hardcoded anymore, but they are now default
parameters.

No changes for the callers, but it's now possible to test the function more
easily.

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

10 years agoMake the DRBD collector more failure-resilient
Michele Tartara [Wed, 21 Aug 2013 14:17:38 +0000 (14:17 +0000)]
Make the DRBD collector more failure-resilient

If information about instances is not available, just log the error and
continue without it.

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

10 years agoAdd function to unwrap Results logging failures
Michele Tartara [Wed, 21 Aug 2013 14:15:30 +0000 (14:15 +0000)]
Add function to unwrap Results logging failures

Add logWarningIfBad, a utility function similar to exitIfBad, that logs a
warning and returns a default value instead of just crashing the program if
the unpacked value is Bad.

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

10 years agoAllow instance mods if only osparams are given
Thomas Thrainer [Tue, 20 Aug 2013 10:37:08 +0000 (12:37 +0200)]
Allow instance mods if only osparams are given

osparams are now recognized as changes, so changing only those without
other changes works too now.

(cherry picked from commit 5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)

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

10 years agoFix harep manpage title
Apollon Oikonomopoulos [Fri, 16 Aug 2013 11:58:03 +0000 (14:58 +0300)]
Fix harep manpage title

The harep manpage title underline was one character short, leading in
pandoc producing an invalid manpage header.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoUse FQDN to check master node status
Thomas Thrainer [Tue, 13 Aug 2013 07:50:42 +0000 (09:50 +0200)]
Use FQDN to check master node status

The master node name in SS conf is stored as FQDN, so also use the FQDN
on each node to check if it is the master node.

This fixes issue 551.

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

10 years agoMerge branch 'stable-2.7' into stable-2.8
Thomas Thrainer [Wed, 7 Aug 2013 09:43:44 +0000 (11:43 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7
  Fix documentation of gnt-instance batch-create
  Support multi instance allocs without iallocator
  Document --no-conflicts-check for gnt-network
  Check disk template in right dict when copying
  ganeti.backend_unittest: chmod restricted cmd dir
  Fix formatting of tuple in error message
  Fix 'prcre' typo in INSTALL
  Format gnt-network info group output
  Add 2.7.2 NEWS entry

Conflicts:
INSTALL
      (trivial)
NEWS
      (added entry to unreleased 2.8 section with remark that it was
       merged from 2.7)
lib/cmdlib.py
      (followed cmdlib split)

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

10 years agoFix batch creation of instances
Thomas Thrainer [Mon, 5 Aug 2013 09:06:13 +0000 (11:06 +0200)]
Fix batch creation of instances

During batch creation of instances the 'reason' field in opcodes is set
to None (but the field is present). This caused problems when adding a
reasons to the reason trail.

Setting the default value for the 'reason' field to the empty list fixes
this issue.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@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 agoSupport DSA SSH keys in bootstrap
Thomas Thrainer [Tue, 6 Aug 2013 15:10:15 +0000 (17:10 +0200)]
Support DSA SSH keys in bootstrap

As outlined in issue 338, Ganeti failed to initialize a cluster if no
RSA SSH key is present on the master node. This patch extends Ganetis
support to DSA keys, so clusters with only DSA keys are possible now.

This fixes issue 338.

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

10 years agoInclude VCS version in `gnt-cluster version`
Thomas Thrainer [Tue, 6 Aug 2013 10:54:15 +0000 (12:54 +0200)]
Include VCS version in `gnt-cluster version`

Also print the VCS version in the output of `gnt-cluster version`. This
makes the VCS version also available over RAPI, etc.

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

10 years agoDocument 'viridian' hypervisor parameter
Thomas Thrainer [Tue, 6 Aug 2013 08:09:10 +0000 (10:09 +0200)]
Document 'viridian' hypervisor parameter

List the 'viridian' hypervisor parameter (valid for Xen HVM) in the
gnt-instance manpage.

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

10 years agoSupport 'viridian' parameter in Xen HVM
Thomas Thrainer [Tue, 6 Aug 2013 08:04:58 +0000 (10:04 +0200)]
Support 'viridian' parameter in Xen HVM

This parameter is required to prevent bluescreens in Windows instances.

This fixes issue 233.

Signed-off-by: Heiko Baumann <heibau@googlemail.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@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 agoVersion bump for 2.8.0 rc1 v2.8.0rc1
Michele Tartara [Wed, 31 Jul 2013 13:21:28 +0000 (13:21 +0000)]
Version bump for 2.8.0 rc1

Update NEWS file and version number.

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

10 years agoAdd Make to the list of dependencies
Michele Tartara [Fri, 2 Aug 2013 07:40:44 +0000 (07:40 +0000)]
Add Make to the list of dependencies

Make is a required dependency, but it was not specified in the install guide.
This commit adds it.

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

10 years agoCheck for luxid permission during verify config
Thomas Thrainer [Thu, 1 Aug 2013 14:43:40 +0000 (16:43 +0200)]
Check for luxid permission during verify config

confd no longer needs access to the noded certificate file, but luxid
does. Change the check to use the right user.

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

10 years agoAdd monitoring-query-format.rst to $(docinput)
Apollon Oikonomopoulos [Thu, 1 Aug 2013 09:45:20 +0000 (12:45 +0300)]
Add monitoring-query-format.rst to $(docinput)

Commit 431ff2c10 split the monitoring system documentation in two parts but did
not include the new monitoring-query-format.rst to $(docinput). As a result,
current tarballs of 2.8 do not ship doc/monitoring-query-format.rst.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix documentation building rules
Michele Tartara [Thu, 1 Aug 2013 08:41:04 +0000 (10:41 +0200)]
Fix documentation building rules

Implement the correct behavior to be kept when sphinx-build is not installed.
It was already correctly checked, but instead of just disabling the
documentation generation, an error message was printed, having "make" fail.

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

10 years agoCheck disk template in right dict when copying
Thomas Thrainer [Wed, 31 Jul 2013 13:41:43 +0000 (15:41 +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.

(The same patch is in stable-2.7 as 106441d already).

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@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 agoMark the UUID design doc as implemented
Michele Tartara [Wed, 31 Jul 2013 09:33:55 +0000 (09:33 +0000)]
Mark the UUID design doc as implemented

The code implementing the UUID design document is included in Ganeti 2.8.

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

10 years agoClarify that cmdlib/ must be removed downgrading
Michele Tartara [Wed, 31 Jul 2013 08:54:14 +0000 (08:54 +0000)]
Clarify that cmdlib/ must be removed downgrading

Downgrading from 2.8 to a previous version will fail if the new cmdlib/
directory is not removed.

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

10 years agoFix formatting error in the UPGRADE document
Michele Tartara [Wed, 31 Jul 2013 08:53:27 +0000 (08:53 +0000)]
Fix formatting error in the UPGRADE document

An item of the enumerated list was not rendered correctly.

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

10 years agoMake build_chroot compatible with Squeeze
Michele Tartara [Tue, 30 Jul 2013 15:17:11 +0000 (15:17 +0000)]
Make build_chroot compatible with Squeeze

Modify build_chroot to make it compatible with debian Squeeze. This
is done by using a function instead of a alias for the command that
was failing.

Fixes Issue 507.

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

10 years agoUpdate security doc and NEWS for luxid
Thomas Thrainer [Tue, 30 Jul 2013 07:18:14 +0000 (09:18 +0200)]
Update security doc and NEWS for luxid

Document the split of luxid from confd in security.rst and in the NEWS
file.

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

10 years agoAdd --cleanup to instance failover manpage
Michele Tartara [Tue, 30 Jul 2013 13:02:14 +0000 (13:02 +0000)]
Add --cleanup to instance failover manpage

Describe the new parameter in the manpage of gnt-instance.

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

10 years agoUpdate NEWS with failover cleanup
Michele Tartara [Tue, 30 Jul 2013 12:06:22 +0000 (12:06 +0000)]
Update NEWS with failover cleanup

Describe the new feature in the NEWS file.

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

10 years agoAdd cleanup parameter to instance failover
Michele Tartara [Tue, 30 Jul 2013 11:59:52 +0000 (11:59 +0000)]
Add cleanup parameter to instance failover

Most of the code is shared with instance migrate, so we actually only need
to add the parameter and pass its value along the the common code.

Also, tests and harep are updated to support the right set of options to
the "failover" opcode.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@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 agoUpdate NEWS file for 2.8 wrt vnet_hdr KVM hvparam
Stratos Psomadakis [Mon, 29 Jul 2013 14:14:49 +0000 (17:14 +0300)]
Update NEWS file for 2.8 wrt vnet_hdr KVM hvparam

Document the addition of the vnet_hdr HV parameter for KVM in the NEWS
file for 2.8.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoDocument the vnet_hdr HV parameter for KVM
Stratos Psomadakis [Mon, 29 Jul 2013 14:14:48 +0000 (17:14 +0300)]
Document the vnet_hdr HV parameter for KVM

Document the vnet_hdr HV parameter for KVM in the gnt-instance man page.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@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 agoPrepare NEWS for 2.8.0 beta2
Guido Trotter [Mon, 29 Jul 2013 11:52:56 +0000 (13:52 +0200)]
Prepare NEWS for 2.8.0 beta2

- Create stub "initial release" entry for beta1.
- Keep main 2.8 release information at top
- Add initial "since beta1" section

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

10 years agoFix the downgrade function of cfgupgrade
Michele Tartara [Thu, 25 Jul 2013 17:17:18 +0000 (19:17 +0200)]
Fix the downgrade function of cfgupgrade

The downgrade was not correctly removing some of the UUIDs (namely, those
of disks and NICs).

Fixes Issue 510.

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

10 years agoIncrease maximum HTTP message size
Michele Tartara [Fri, 26 Jul 2013 10:12:35 +0000 (12:12 +0200)]
Increase maximum HTTP message size

After adding a new KVM parameter, RAPI queries related to KVM have become
too big, so we need to increase this.

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

10 years agoClarify hbal man page
Klaus Aehlig [Thu, 25 Jul 2013 17:05:45 +0000 (19:05 +0200)]
Clarify hbal man page

In the sense of hbal, and, in fact, all htools, drained nodes
are considered as offline. Also, the cluster score is not just
the sum of its component, but, e.g., the count of instances on
offline nodes is weighted stronger.

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

10 years agoProperly add the UUID to all the disks
Michele Tartara [Thu, 25 Jul 2013 14:00:17 +0000 (14:00 +0000)]
Properly add the UUID to all the disks

Starting from Ganeti 2.8 all the disks need to have a UUID.
A function for adding a UUID automatically to disks was present, but it didn't
consider disks with children (like DRBD).

The function is modified to work recursively.

Partially fixes Issue 510.

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

10 years agoMerge branch 'stable-2.7' into stable-2.8
Guido Trotter [Thu, 25 Jul 2013 12:38:24 +0000 (14:38 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Update NEWS and version for Ganeti 2.7.1
  daemon-util: pass --oknodo at rotate_logs
  Add logrotate example
  daemon-util: provide rotate_logs and rotate_all_logs actions

Conflicts:
NEWS: trivial
configure.ac: trivial (keep 2.8 version)

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@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 agoAdd hvparam to disable VNET_HDR on tap devices
Stratos Psomdakis [Wed, 24 Jul 2013 11:52:55 +0000 (14:52 +0300)]
Add hvparam to disable VNET_HDR on tap devices

IFF_VNET_HDR allows tap devices to extract a VIRTIO_NET_HDR from pkts
going through the tap iface, enabling segmentation offload for the
virtio nics.

Current (Debian) kernels (3.2 for Debian Squeeze backrports / Wheezy)
don't seem able to handle well VMs with 'broken' virtio ifaces (e.g.
FreeBSD virtio-net driver), using GSO. Broken or malicious virtio-net
drivers can cause the host kernel to flood the logs with WARNs(),
effectively live-locking the system and affecting its overall stabitlity
(eg DRBD disconnects).

The WARN() flooding has been fixed / ratelimited in Linus' tree, but it
hasn't been backported to -stable.

This patch adds the vnet_hdr hvparam for KVM, to select whether the tap
devices used for KVM virtio ifaces will get created with VNET_HDR
support (IFF_VNET_HDR), even when the underlying kernel supports it, in
order to avoid this issue.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@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 permission errors for split users
Thomas Thrainer [Mon, 22 Jul 2013 10:20:25 +0000 (12:20 +0200)]
Fix permission errors for split users

Correctly set ownership and permissions for daemon log files, correct
the name of the luxid logfile and set the ownership of the query socket
correctly.

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

10 years agoMake RAPI export device names and UUIDs
Christos Stavrakakis [Fri, 19 Jul 2013 08:19:25 +0000 (11:19 +0300)]
Make RAPI export device names and UUIDs

Add UUIDs and names of instance's disks and NICs to the list of instance
fields that are returned from RAPI.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix permission problem related to Issue 477
Michele Tartara [Fri, 12 Jul 2013 16:12:24 +0000 (16:12 +0000)]
Fix permission problem related to Issue 477

Commit 91525dee856951ace940c78b6254a1c7344b4803 fixed Issue 477 but broke
"gnt-cluster info".

This commit offers a solution to both problems, by changing the permission
of the socket instead of changing the permission the confd process is run
with.

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

10 years agoAdd hs function to easily change file ownership
Michele Tartara [Fri, 12 Jul 2013 16:10:47 +0000 (16:10 +0000)]
Add hs function to easily change file ownership

The Haskell library functions only allow to change file ownership using
uid/gid. A function for doing that with explicit names is added by this
commit.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

10 years agoRename queryd to luxid
Thomas Thrainer [Wed, 17 Jul 2013 14:02:46 +0000 (16:02 +0200)]
Rename queryd to luxid

As queryd will, in the future, handle all LUXI request, queue jobs and
most likely perform various other tasks, it is renamed to luxid already.
This will safe some headache when upgrading Ganeti installations, as we
don't have to deal with a daemon rename.

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

10 years agoDocument the rapi client not to have a QueryNetworks method
Klaus Aehlig [Wed, 17 Jul 2013 13:44:29 +0000 (15:44 +0200)]
Document the rapi client not to have a QueryNetworks method

While there is a luxi query QueryNetworks, the rapi client does not
provide such a method. Document this by declaring it in the
KNOWN_UNUSED_LUXI calls.

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

10 years agoEnable unit tests again
Helga Velroyen [Wed, 17 Jul 2013 11:54:42 +0000 (13:54 +0200)]
Enable unit tests again

A while ago, the execution of python unit tests was
accidentally disabled for distcheck. This patch
enables them again. This will lead to a couple of
tests failing, but we decided to submit this first
and then fix the broken tests in separate patches.

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

10 years agoDocument ganeti-queryd
Thomas Thrainer [Tue, 16 Jul 2013 07:34:57 +0000 (09:34 +0200)]
Document ganeti-queryd

Add a man page for ganeti-queryd and update the documentation for
ganeti-confd in various places.

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

10 years agoAdd ganeti-queryd to QA env test
Thomas Thrainer [Tue, 16 Jul 2013 07:17:07 +0000 (09:17 +0200)]
Add ganeti-queryd to QA env test

Test for the newly introduces ganeti-queryd in the environment test of
QA.

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

10 years agoAdd queryd daemon (split from confd)
Thomas Thrainer [Thu, 4 Jul 2013 15:10:35 +0000 (17:10 +0200)]
Add queryd daemon (split from confd)

queryd is added as a new daemon which handles configuration queries over
LUXI. This functionality was removed from confd, which now only queries
over the network.

The queryd user is added to the master group such that it can access
server.pem. The confd user no longer needs to be in the master group.
This fixes issue 292.

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

10 years agoExtract ConfigReader from Confd/Server.hs
Thomas Thrainer [Wed, 3 Jul 2013 14:22:58 +0000 (16:22 +0200)]
Extract ConfigReader from Confd/Server.hs

Confd's functionality to watch the Ganeti configuration file is
extracted to the ConfigReader module. No functional changes are
introduced.

This extraction makes will enable us to split queryd from confd, as
queryd will have to use the same functionality.

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

10 years agoAdd timestamps to haskell network query fields
Christos Stavrakakis [Tue, 16 Jul 2013 08:07:03 +0000 (11:07 +0300)]
Add timestamps to haskell network query fields

Add timestamp fields to the list of available network query fields in
the Haskell code.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoMerge branch 'stable-2.7' into stable-2.8
Klaus Aehlig [Mon, 15 Jul 2013 14:10:58 +0000 (16:10 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7
  Fix RAPI to include missing network fields
  Add support for querying network timestamps
  In the crontab example, look for the correct binary
  Fix wrong numbering in UPGRADE documentation

Conflicts:
src/Ganeti/Objects.hs
test/hs/Test/Ganeti/Objects.hs
Resolved by taking both additions.

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

10 years agoChange method dispatch in ClientOps to enforce luxi.REQ_ALL
Klaus Aehlig [Mon, 15 Jul 2013 09:24:28 +0000 (11:24 +0200)]
Change method dispatch in ClientOps to enforce luxi.REQ_ALL

ClientOps' handle_request dispatches on the luxi request received. Change
this to first verify if the request is luxi.REQ_ALL. In this way, we catch
programming errors introducing "secret" luxi requests earlier. This is relevant,
as our other checks for internal consistency compare against luxi.REQ_ALL.

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

10 years agoAllow modify_etc_hosts to be changed
Michele Tartara [Fri, 12 Jul 2013 12:15:34 +0000 (12:15 +0000)]
Allow modify_etc_hosts to be changed

The modify_etc_hosts options, enabling the cluster to modify the /etc/hosts
files of nodes, and to keep them in sync, could only be set at cluster init
time.

With this commit it can now be changed through modify_etc_hosts as well.

Fixes Issue 206.

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

10 years agoAdd --modify-etc-hosts option for CLI tools
Michele Tartara [Fri, 12 Jul 2013 09:13:48 +0000 (09:13 +0000)]
Add --modify-etc-hosts option for CLI tools

The option will be used by gnt-cluster modify in the following commit.

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

10 years agoAdd luxiReqQueryNetworks to LuxiOp
Klaus Aehlig [Thu, 11 Jul 2013 08:33:50 +0000 (10:33 +0200)]
Add luxiReqQueryNetworks to LuxiOp

When the QueryNetwork was introduced as a method, apparently
it was forgotten in the Haskell world. Add it here as well.

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

10 years agoLog received message at debug level
Klaus Aehlig [Wed, 10 Jul 2013 14:58:10 +0000 (16:58 +0200)]
Log received message at debug level

At debug level, we can well afford to have a detailed entry
for each message received by a server.

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

10 years agoSet the correct group for confd
Michele Tartara [Thu, 11 Jul 2013 12:59:50 +0000 (12:59 +0000)]
Set the correct group for confd

Starting confd as a member of the daemons group allows the RAPI daemon to access
the LUXI socket.

Fixes Issue 477.

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

10 years agoLog RPC errors from inside executeRpcCall
Michele Tartara [Wed, 10 Jul 2013 14:48:05 +0000 (14:48 +0000)]
Log RPC errors from inside executeRpcCall

executeRpcCall is the function to be used for executing RPCs, so it makes sense
to use it as the single point for logging all thte RPC call errors.

Fixes Issue 293.

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

10 years agoFactor out the logRpcErrors function
Michele Tartara [Wed, 10 Jul 2013 14:39:33 +0000 (14:39 +0000)]
Factor out the logRpcErrors function

This function can be useful to multiple RPC calls, therefore it is moved
to the file containing the common RPC functions.

Also, it is made more generic by changing its signature.

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

10 years agoExpose bulk parameter for GetJobs in RAPI client
Leon Handreke [Wed, 10 Jul 2013 13:46:04 +0000 (14:46 +0100)]
Expose bulk parameter for GetJobs in RAPI client

This patch exposes the bulk argument of the jobs resource on
the RAPI python wrapper, making it possible to retrieve status
information about all jobs with a single call.

Signed-off-by: Leon Handreke <lhandreke@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd git send-email to the chroot
Michele Tartara [Wed, 10 Jul 2013 14:07:41 +0000 (16:07 +0200)]
Add git send-email to the chroot

"git send-email" is used as part of the official workflow but it was not
installed in the chroot.

This patch adds it.

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

10 years agoAdd tests for CanRead
Michele Tartara [Wed, 10 Jul 2013 11:32:46 +0000 (11:32 +0000)]
Add tests for CanRead

Verify that the CanRead function is actually able to check whether a file has
the proper permissions.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@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 agoOnly generate node lists with nodes having different names
Klaus Aehlig [Tue, 9 Jul 2013 15:05:48 +0000 (17:05 +0200)]
Only generate node lists with nodes having different names

genNodeList is used in testing to generate list of nodes
that could come up in cluster configurations. Since names
are used to assign indices to nodes, they have to be unique;
this is also the case in all real clusters.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Iustin Pop <iusty@k1024.org>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoCluster verify checks server.pem permissions
Michele Tartara [Tue, 9 Jul 2013 16:05:00 +0000 (18:05 +0200)]
Cluster verify checks server.pem permissions

Currently, ConfD must be able to access server.pem (though this is likely to
change in the future). If this is not true, all sorts of weird things happen,
such as "gnt-node list" printing lots of question marks instead of actual
data, with no meaningful error.

This patch adds a check for the proper access permission to
"gnt-cluster verify".

Fixes Issue 518.

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

10 years agoAdd function for checking file access permissions
Michele Tartara [Tue, 9 Jul 2013 16:02:07 +0000 (18:02 +0200)]
Add function for checking file access permissions

The CanRead function checks whether a user of the local machine (specified
by name) can access a given file.

IsUserInGroup is a helper function for CanRead, but might also be used
independently, so its name does not begin with an underscore.

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

10 years agoPrevent silent failure in case of connection problems
Michele Tartara [Tue, 9 Jul 2013 13:06:36 +0000 (15:06 +0200)]
Prevent silent failure in case of connection problems

While running "gnt-node list", if a query to ConfD fails (especially
because of permission problems) it used to just fail silently, with gnt-node
showing question marks instead of data.

With this patch, ConfD records the error in its log file, together with a
message giving an indication of the reason.

Fixes Issue 517.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@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 apt-get invocation in chroot_builder
Michele Tartara [Mon, 8 Jul 2013 06:57:13 +0000 (06:57 +0000)]
Fix apt-get invocation in chroot_builder

Use the macro containing all the required parameters, instead of just using
"apt-get install".

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@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 agoMerge branch 'stable-2.7' into stable-2.8
Klaus Aehlig [Fri, 5 Jul 2013 08:44:06 +0000 (10:44 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Release version 2.7.0
  Fix "instance replace" typo in admin.rst
  Fix typo in the install guide
  Disable pylint E1101 on hypothetical import

Conflicts:
NEWS: trivial
configure.ac: trivial

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

10 years agoAlso remove prop_IterateAlloc_sane from test list
Klaus Aehlig [Thu, 4 Jul 2013 16:43:49 +0000 (18:43 +0200)]
Also remove prop_IterateAlloc_sane from test list

In f4d1bb7 that test was removed, but forgotten to remove it
from the list of tests to be executed. Fix that.

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

10 years agoFix documentation for prop_Alloc_sane
Klaus Aehlig [Thu, 4 Jul 2013 13:02:21 +0000 (15:02 +0200)]
Fix documentation for prop_Alloc_sane

As discussed in the last commit, placing a new instance on the cluster
can lead to a cluster that can be improved by moving previously added
instances. For an empty cluster, however, there are no previous
instances. So add this to the test description to make obvious why
this test tests for a valid property.

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

10 years agoRemove IterateAllocSane test
Klaus Aehlig [Thu, 4 Jul 2013 12:54:18 +0000 (14:54 +0200)]
Remove IterateAllocSane test

The test is testing for a property that just isn't true. Iterated
allocation greedily place one instance at a time taking the locally
most balanced solution. Then it is tested whether the resulting global
allocation can be improved.

To see that this assumption does not hold, consider placing 3
identical instances on 3 nodes. The most balanced allocation of all 3
instances would be that each node is primary and secondary for one
instance. Now let's see what iterative allocation does.

Up to symmetry, the placing of the first instance is unique. Any
placement of the second instance that keeps the way to the global
optimum open would be one node being primary and secondary for one
instance each, one node being only secondary for instance, and one
node being only primary for one instance. An alternative allocation
would be to place the instances on two different nodes as primaries
and using the third node as shared secondary.

For cpu (2 nodes with 1 cpu, 1 with none), free memory (on two nodes
all minus 1 unit, on one node all), and disk (2 nodes with 1 disk, 1
with 2) there is no difference between these allocations. For reserved
memory, there's a difference in the values. In the first case, on two nodes,
there's one unit reserved and nothing on the third. In the second
case, on two nodes, there is nothing reserved, while on the third
node, there still is only one unit reserved, as the two instances have
different primaries. Nevertheless, the standard deviations of
0,0,1 and 1,1,0 are both sqrt(5/9); so, in everything that contributes
to the balancedness metric these allocations are equal. Therefore, it is
locally correct to chose the wrong allocation.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@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 agoClean up work around for host name filtering
Klaus Aehlig [Mon, 1 Jul 2013 15:03:46 +0000 (17:03 +0200)]
Clean up work around for host name filtering

These functions simply served as a work around to express
host name matching by regular expressions, instead of using
correct equality filter on host names that provides
the correct matching already.

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

10 years agoDo not handle host queries special
Klaus Aehlig [Mon, 1 Jul 2013 14:49:07 +0000 (16:49 +0200)]
Do not handle host queries special

As, since 91c1a265, the equality used for host names already
is based on matching, there is no need to use a special function
for this any more.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@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 agoFix error in installation instructions
Michele Tartara [Mon, 1 Jul 2013 16:25:54 +0000 (16:25 +0000)]
Fix error in installation instructions

Remove erroneous trailing "\"

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

10 years agoAdd documentation for harep
Michele Tartara [Thu, 27 Jun 2013 15:08:56 +0000 (15:08 +0000)]
Add documentation for harep

Include a section in the Administrator's guide describing how to use the
autorepair tool.

Fixes Issue 446

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

10 years agoFix typo in ganeti-2.8 design doc
Michele Tartara [Wed, 26 Jun 2013 16:54:51 +0000 (18:54 +0200)]
Fix typo in ganeti-2.8 design doc

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

10 years agoSupport big-step shrinking in tiered allocation
Klaus Aehlig [Mon, 24 Jun 2013 14:54:28 +0000 (16:54 +0200)]
Support big-step shrinking in tiered allocation

In tiered allocation, if by shrinking only a single resource a valid
allocation can be found, shrinking is bound to shrink on this resource.
Of course, after shrinking that resource a little bit without finding
an allocation, this property is still valid. So we can as well shrink
on that resource as far as needed to get a valid allocation.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@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 agoMerge branch 'stable-2.7' into stable-2.8
Guido Trotter [Tue, 25 Jun 2013 07:53:07 +0000 (09:53 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Provide the right fix for the kvm_extra parameter
  NEWS and version updates for 2.7.0~rc3
  kvm: don't pass whole extra as a single argument
  For node queries allow short forms of host names
  Provide a special filter for host names

Conflicts:
NEWS: trivial
configure.ac: trivial

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@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>