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

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 agognt-cluster info (py): add enabled disk templates
Helga Velroyen [Thu, 20 Jun 2013 09:44:16 +0000 (11:44 +0200)]
gnt-cluster info (py): add enabled disk templates

This fixes issue 485. In the python implementation of
the cluster config info, the enabled_disk_templates
were missing.

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

10 years agoVersion bump to 2.8.0~beta1 v2.8.0beta1
Michele Tartara [Mon, 24 Jun 2013 09:38:26 +0000 (09:38 +0000)]
Version bump to 2.8.0~beta1

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

10 years agoChange version numbers in documentation
Michele Tartara [Fri, 3 May 2013 09:11:33 +0000 (11:11 +0200)]
Change version numbers in documentation

Some of the documents have the version number of Ganeti. This commit updates
it in preparation for the 2.8 version bump.

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

10 years agoFix issue with python coverage tests
Michele Tartara [Fri, 21 Jun 2013 16:15:35 +0000 (16:15 +0000)]
Fix issue with python coverage tests

The recently introduced check for python libraries required only for testing
(commit 27df5b736ef72b3b12c07f32d64dbac95fe7a5ba) was not correct. This
patch fixes the issue.

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

10 years agoMerge branch 'stable-2.7' into stable-2.8
Thomas Thrainer [Fri, 21 Jun 2013 14:49:51 +0000 (16:49 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Add a warning about the restriction of gnt-node evacuate
  Fix permissions of the queue archive dir
  Fix daemon QA tests
  grow disk: call SetDiskID before blockdev_getsize
  Catch DeviceCreationError unhandled exceptions

Conflicts:
lib/cmdlib.py (due to the cmdlib split)
qa/qa_daemon.py (trivial)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@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 agoDisable python test if required libraries are missing
Michele Tartara [Fri, 21 Jun 2013 10:51:58 +0000 (12:51 +0200)]
Disable python test if required libraries are missing

Some python libraries are only needed for the tests, but not for running
Ganeti. If those libraries are missing, just disable the Python tests.

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

10 years agoBetter specify what packages to install
Michele Tartara [Fri, 21 Jun 2013 08:49:48 +0000 (08:49 +0000)]
Better specify what packages to install

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

10 years agoImprove install guide
Michele Tartara [Fri, 21 Jun 2013 08:28:14 +0000 (10:28 +0200)]
Improve install guide

Add command for updating the list of cabal packages, before starting
installing them.

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

10 years agoFix typo in the documentation index
Michele Tartara [Fri, 21 Jun 2013 07:51:39 +0000 (09:51 +0200)]
Fix typo in the documentation index

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

10 years agoFix typos in the documentation index
Weiwei Jia [Fri, 21 Jun 2013 08:56:32 +0000 (16:56 +0800)]
Fix typos in the documentation index

This patch fixes some typos in the documentation index.

Signed-off-by: Weiwei Jia <harryxiyou@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoUpdate security document wrt confd access to SSL cert
Michele Tartara [Thu, 20 Jun 2013 13:11:57 +0000 (13:11 +0000)]
Update security document wrt confd access to SSL cert

The fact that confd has been given access to the server.pem certificate
needs to be described in the security document.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@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 agoAdd tools for building deb packages to build_chroot
Michele Tartara [Thu, 20 Jun 2013 12:55:54 +0000 (14:55 +0200)]
Add tools for building deb packages to build_chroot

The chroot only had tools for building and testing Ganeti, but not for
building its Debian packages. They are added by this commit.

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

10 years agoImprove the final message of build_chroot
Michele Tartara [Thu, 20 Jun 2013 09:29:25 +0000 (09:29 +0000)]
Improve the final message of build_chroot

Give more precise instructions on the next steps to actually run the
chroot.

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

10 years agoMake build_chroot self-contained
Michele Tartara [Thu, 20 Jun 2013 08:57:24 +0000 (08:57 +0000)]
Make build_chroot self-contained

The configuration file are included in build_chroot, and are
automatically created by the script if it is not able to find them
already in the directory pointed by $DATA_DIR.

Note that the configuration file directory is cleaned if it's temporary,
but it is left untouched if it was esplicitly specified by the user.

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

10 years agoAdd confd user to masterd group
Michele Tartara [Wed, 19 Jun 2013 14:51:57 +0000 (14:51 +0000)]
Add confd user to masterd group

The server.pem file is 0440 (materd_uid, masterd_gid) and cannot be
accessed by confd.

This patch contains a workaround for 2.8.0~beta1 (adding conf to the
masterd group in the user setup tool, and remembering the users to
actually execute that tool while upgrading).

This partially fixes Issue 292.

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

10 years agoIn tiered allocation, cut non-promising shrinking tries
Klaus Aehlig [Wed, 19 Jun 2013 16:43:21 +0000 (18:43 +0200)]
In tiered allocation, cut non-promising shrinking tries

The heuristics for tiered allocation has been improved in that it
chooses to shrink such a resource next where by shrinking only this
resource a valid allocation can be made, if such a resource exists.
In order to decide whether such a resource exists, all potential
sizes of this resource are verified. We can improve performance by
cutting, as soon a potential allocation of an instance is no longer
blocked on this resource.

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

10 years agoMerge branch 'stable-2.7' into stable-2.8
Klaus Aehlig [Wed, 19 Jun 2013 09:02:53 +0000 (11:02 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7
  More agressively line break man pages

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@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 agoVersion bump to 2.8.0~alpha1
Michele Tartara [Fri, 14 Jun 2013 12:57:49 +0000 (14:57 +0200)]
Version bump to 2.8.0~alpha1

Now that alpha versions are supported, we can bump the version number
for branch stable-2.8 to 2.8.

This also requires updating the cfgupgrade tool.

Thanks to the previous patches, all the other documents can be upgraded
during the alpha lifetime, before switching to beta (that will enable
the version number checks).

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

10 years agoMake cfgupgrade idempotent
Michele Tartara [Tue, 18 Jun 2013 07:33:48 +0000 (07:33 +0000)]
Make cfgupgrade idempotent

One of the unit tests checks whether cfgupgrade's downgrade option is
idempotent. It is, but a version number check made it impossible to
actually downgrade multiple times.

With this change, both the current-version version number and the
target-version version number are accepted by the downgrade tool.

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

10 years agoUpdate config version number when downgrading
Michele Tartara [Tue, 18 Jun 2013 07:32:31 +0000 (07:32 +0000)]
Update config version number when downgrading

The downgrade option of the cfgupgrade tool was not changing the version
number in the configuration file of the cluster while performing the
downgrade.

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

10 years agoAdd test for shrink heuristics over different resources
Klaus Aehlig [Fri, 14 Jun 2013 12:19:01 +0000 (14:19 +0200)]
Add test for shrink heuristics over different resources

In this example, memory prevents adding more than one instance on
the first node. Yet, on the other nodes, 2 instances can be placed
each, if disks are shrunk appropriately. This, however, requires
to courageous decision to shrink disks next, even though more nodes
fail to allocate more due to memory than to disk.

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

10 years agoImprove hspace shrinking strategy
Klaus Aehlig [Fri, 14 Jun 2013 13:48:47 +0000 (15:48 +0200)]
Improve hspace shrinking strategy

In tired allocation, hspace shrinks that resource of the instance
next, that causes failure on most nodes. While, this is not a bad
strategy in general, it can lead hspace into a dead end if for a large
number of nodes a particular resource blocks any further allocation of
policy compliant instances. So we improve the heuristics in that it
chooses to shrink such a resource next where by shrinking only this
resource a valid allocation can be made, if such a resource
exists. This improves the results in some cases, while still keeping
the computational complexity of the algorithm low.

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

10 years agoConvenience function for iterating while the result is Ok
Klaus Aehlig [Fri, 14 Jun 2013 15:42:15 +0000 (17:42 +0200)]
Convenience function for iterating while the result is Ok

For a function f :: a -> GenericResult a, iterate it (in the sense of the
monad), until the result is Bad; return the list of values occurred.

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

10 years agoProvide witness for the sum-type structure of GenericResult
Klaus Aehlig [Fri, 14 Jun 2013 13:47:55 +0000 (15:47 +0200)]
Provide witness for the sum-type structure of GenericResult

GenericResult, while rightfully a type of its own, is isomorphic
to Either. So, also provide the case analysis function (i.e., the
universal arrow out of the sum).

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

10 years agoDisable more version checks for alpha versions
Michele Tartara [Thu, 13 Jun 2013 14:56:30 +0000 (14:56 +0000)]
Disable more version checks for alpha versions

Alpha versions should not check for version numbers in READMEs
and documentation.

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

10 years agoAllow alpha versions not to have an entry in the NEWS file
Michele Tartara [Thu, 13 Jun 2013 14:15:15 +0000 (14:15 +0000)]
Allow alpha versions not to have an entry in the NEWS file

Alpha versions are still under heavy development, and can therefore not have an
entry in the NEWS file yet. The entry will have to be added before switching to
the first beta version.

Partially fixes Issue 448

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

10 years agoAdd tests for check-news
Michele Tartara [Thu, 13 Jun 2013 12:09:40 +0000 (14:09 +0200)]
Add tests for check-news

Unit tests verifying the behaviour of the check-news script are added.

This required adding a new make target, "autotools-check" directly called from
"commit-check", because the usual tests are executed in the build directory,
whereas these, being relative to the autotools, cannot be executed there because
the files of the autotools/ directory are not copied do not belong in the build
directory.

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

10 years agoIntroduce support for alpha versions
Michele Tartara [Thu, 13 Jun 2013 11:00:12 +0000 (11:00 +0000)]
Introduce support for alpha versions

An alpha version can be used to name a release while a previous one is still
being developed.

E.g. 2.9.0~alpha1 can be out while 2.8.0~rc1 is being worked on.

When a version is marked as alpha, it is allowed to have unreleased versions
before it in the NEWS file, in order to simplify merges of the NEWS file itself
between the two development branches.

Partially fixes Issue 448.

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

10 years agoImprove docstring
Michele Tartara [Thu, 13 Jun 2013 10:59:47 +0000 (10:59 +0000)]
Improve docstring

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

10 years agoFix bug in Makefile.am
Michele Tartara [Thu, 13 Jun 2013 15:32:53 +0000 (17:32 +0200)]
Fix bug in Makefile.am

There was a typo in the name of the script for launching offline tests.

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, 14 Jun 2013 08:29:40 +0000 (10:29 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7
  Make shrinkByType aware of individual disks
  Add a test for hspace to respect instance policy

Conflicts: (trival, take union of added files/tests)
Makefile.am
test/hs/shelltests/htools-hspace.test

Semantic conflicts:
test/data/htools/hspace-tiered-ipolicy.data
(adapt to changed text format)

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@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 agoRestructure documentation index page
Michele Tartara [Wed, 12 Jun 2013 14:48:30 +0000 (14:48 +0000)]
Restructure documentation index page

The index page of the documentation used to be just a list of links.
Now it is a proper introduction to all the other pages.

Fixes Issue 424.

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

10 years agoAdd missing parenthesis to description of --machine-readable
Klaus Aehlig [Wed, 12 Jun 2013 11:45:10 +0000 (13:45 +0200)]
Add missing parenthesis to description of --machine-readable

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

10 years agoUpdate NEWS file for 2.8
Michele Tartara [Tue, 14 May 2013 12:42:15 +0000 (13:42 +0100)]
Update NEWS file for 2.8

Add to the NEWS file the list of modifications performed during the 2.8
development cycle.

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

10 years agoAdd --force option to gnt-cluster modify
Klaus Aehlig [Tue, 4 Jun 2013 12:54:41 +0000 (14:54 +0200)]
Add --force option to gnt-cluster modify

Make the force option of the ClusterSetParams Opcode available
on the command line.

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

10 years agoAdd a force option to the ClusterSetParams Opcode
Klaus Aehlig [Tue, 4 Jun 2013 12:23:13 +0000 (14:23 +0200)]
Add a force option to the ClusterSetParams Opcode

If set, the op code will, in particular, try to set the master IP
on the new netdev, even if shutting down the master IP on the old
netdev failed.

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

10 years agoDocument the monitoring daemon in the admin guide
Michele Tartara [Mon, 3 Jun 2013 21:58:02 +0000 (21:58 +0000)]
Document the monitoring daemon in the admin guide

The administrator's guide must include a section describing the monitoring
daemon and its API, in order for the users to be able to use it.

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

10 years agoFactor out the API of the monitoring daemon
Michele Tartara [Mon, 3 Jun 2013 21:53:12 +0000 (21:53 +0000)]
Factor out the API of the monitoring daemon

It will be included by both the design document and the user documentation.

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

10 years agoAdd monitoring agent info to the security document
Michele Tartara [Mon, 3 Jun 2013 21:11:59 +0000 (17:11 -0400)]
Add monitoring agent info to the security document

Add information regarding the monitoring agent and its security to
the security document.

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

10 years agoExport device UUIDs to hooks and OS scripts
Christos Stavrakakis [Mon, 3 Jun 2013 16:31:26 +0000 (19:31 +0300)]
Export device UUIDs to hooks and OS scripts

Export UUIDs and names of instance NICs and disks to the environment
of OS scripts and instance related hooks.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agognt-cluster info: only parameters for enabled hypervisors
Klaus Aehlig [Mon, 3 Jun 2013 14:48:17 +0000 (16:48 +0200)]
gnt-cluster info: only parameters for enabled hypervisors

In the output of gnt-cluster info, restrict the hypervisor parameters
to those hypervisors that are enabled. This fixes issue 443.

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

10 years agoSupport RAPI QA on an already existing cluster
Bernardo Dal Seno [Sat, 1 Jun 2013 23:03:15 +0000 (01:03 +0200)]
Support RAPI QA on an already existing cluster

We support running most of the QA tests on an existing cluster. One big
exception was RAPI, as the credentials for the QA RAPI user were created at
cluster setup. This patch allows to recover the password for the QA user
(if configured) from an existing cluster and hence run RAPI tests.

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

10 years agoMerge branch 'stable-2.7' into stable-2.8
Bernardo Dal Seno [Fri, 31 May 2013 10:10:00 +0000 (12:10 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Document users-setup tool
  Adjusting permissions after confd start
  Ensure the queue socket has the right permissions
  Update IAllocator interface documentation

Conflicts:
doc/iallocator.rst

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@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 agoAdd NEWS entry for hail honoring networks
Thomas Thrainer [Thu, 23 May 2013 07:46:42 +0000 (09:46 +0200)]
Add NEWS entry for hail honoring networks

The entry also mentions the required change in the IAllocator protocol.

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

10 years agoAdd tests for network-aware allocation
Thomas Thrainer [Thu, 16 May 2013 12:56:26 +0000 (14:56 +0200)]
Add tests for network-aware allocation

hail-alloc-invalid-network defines a cluster with two nodegroups and an
allocation request which does not fit on any of the groups. Group 1 has
invalid disk-templates while Group 2 is not connected to the right
networks.

hail-alloc-restricted-network defines a cluster wih two nodegroups.
Nodegroup Group 1 is only used as last_resort group, but is chosen by
hail as only this group is connected to the right networks.

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

10 years agoHonor network connections in hail
Thomas Thrainer [Thu, 16 May 2013 14:58:00 +0000 (16:58 +0200)]
Honor network connections in hail

Before trying to allocate nodes in node groups, node groups are now
filtered based on the networks they are connected to an the networks
which are required by the new instance.

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

10 years agoParse NIC data from allocation request in hail
Thomas Thrainer [Tue, 21 May 2013 06:08:04 +0000 (08:08 +0200)]
Parse NIC data from allocation request in hail

Add a NIC type and extend the Instance type by a list of NIC's. Parse
the NIC's in allocation requests and store them for now. Later patches
will make use of this field in order to ensure that the requested
instance is only placed in node groups wich are connected to those
networks.

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

10 years agoSupport group networks in Text backend
Thomas Thrainer [Fri, 24 May 2013 08:03:02 +0000 (10:03 +0200)]
Support group networks in Text backend

The Text backend now parses network UUID (comma separated) and
serializes them in the same form.
The test data is adapted to the new format.

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

10 years agoParse node group networks
Thomas Thrainer [Fri, 17 May 2013 11:39:07 +0000 (13:39 +0200)]
Parse node group networks

Extend the Group by the network ids it is connected to. Adapt
the IAlloc backend such that the networks are parsed correctly.
This also required the adaption of test data.

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

10 years agoUpdate IAllocator interface documentation
Thomas Thrainer [Thu, 23 May 2013 07:39:33 +0000 (09:39 +0200)]
Update IAllocator interface documentation

Document the newly added network field of node groups, and also update
the missing documentation for the other fields of node groups.

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

10 years agoExport connected networks to IAllocator
Thomas Thrainer [Thu, 16 May 2013 11:44:10 +0000 (13:44 +0200)]
Export connected networks to IAllocator

IAllocators should not put instances on nodes in nodegroups which are
not connected to the network the instance should be connected to.
Therefore, export the networks a node group is connected to to the
IAllocator, so it can account for this restriction.

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

10 years agoRe-activate previously active disks in watcher
Thomas Thrainer [Wed, 15 May 2013 11:58:06 +0000 (13:58 +0200)]
Re-activate previously active disks in watcher

The watcher process previously (incorrectly) examined the admin_state
field to figure out if the disks of an instance should be activated
after a node reboot. This is changed to use the disks_active field of
instances, which always holds the correct information (even if the
instance should not be started, but only its disks activated).

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

10 years agoMake the disks_active flag queryable
Thomas Thrainer [Wed, 15 May 2013 11:57:25 +0000 (13:57 +0200)]
Make the disks_active flag queryable

gnt-instance list now also supports the disks_active field.

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

10 years agoConsider disks_active in UpgradeConfig
Thomas Thrainer [Thu, 16 May 2013 09:13:24 +0000 (11:13 +0200)]
Consider disks_active in UpgradeConfig

The disks_active flag is updated when masterd reads the configuration.
Also, cfgupgrade now removes the disks_active flag during downgrades.

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

10 years agoAdd disks_active to configuration
Thomas Thrainer [Wed, 15 May 2013 11:55:30 +0000 (13:55 +0200)]
Add disks_active to configuration

This flag tracks if the disks of an instace are supposed to be active.
That's the case when an instance is running or when its disks got
activated explicitly (and in a couple of other cases).
It will be used by watcher to re-activate disks after a node reboot.

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

10 years agoFix release of instances in QA
Bernardo Dal Seno [Fri, 24 May 2013 23:19:07 +0000 (01:19 +0200)]
Fix release of instances in QA

Also, fix some uses of keyword arguments for arguments with a default
value, as required by the style guide, and a typo.

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

10 years agoMerge branch 'stable-2.7' into stable-2.8
Guido Trotter [Fri, 24 May 2013 11:19:28 +0000 (13:19 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Bump up version for 2.7.0~rc2 release
  Add NEWS entry for SO_PEERCRED fix
  Workaround missing SO_PEERCRED
  Add debugging clause to _ExpandCheckDisks error
  Mention hail network incompatibility in manpages
  Remove obsolete Debian-related documentation
  Update NEWS for 2.7.0 rc2
  Improve installation documentation
  Fix owner of the OS log dir

Conflicts:
lib/cmdlib.py: port to cmdlib/instance_storage.py
lib/tools/ensure_dirs.py: trivial

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@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>