ganeti-github.git
5 years agoAdd a unit test for the Gluster storage type
Dimitris Bliablias [Mon, 18 May 2015 13:01:52 +0000 (15:01 +0200)]
Add a unit test for the Gluster storage type

This patch, extends the 'ganeti.utils.storage_unittest.py' unit test
with a new test for the Gluster storage type. Also, the current unit
tests are updated accordingly to correspond to the latest changes.

Signed-off-by: Dimitris Bliablias <bl.dimitris@gmail.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked from 42fdf9d0d79fb84796ad40ff6eb8c95e3206263e

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoAdd missing Gluster storage verification checks
Dimitris Bliablias [Mon, 18 May 2015 13:01:47 +0000 (15:01 +0200)]
Add missing Gluster storage verification checks

This patch, extends the file-based storage type verification checks to
include the new Gluster storage type. Those modifications include a
missing check for the gluster storage directory at cluster
initialization time, and extends the 'gnt-cluster verify' command to
also verify the gluster file-storage path.

Signed-off-by: Dimitris Bliablias <bl.dimitris@gmail.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked from 604c8be2596195d94efcd96f286542f74912b2e5

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoAdd Gluster type to the node storage reporting set
Dimitris Bliablias [Mon, 18 May 2015 13:01:43 +0000 (15:01 +0200)]
Add Gluster type to the node storage reporting set

This patch, adds the 'gluster' storage type to the set of storage types
for which full node storage reporting is available. This set is used by
the 'LUNodeQueryStorage' logical unit for getting information on storage
units on node(s).

Signed-off-by: Dimitris Bliablias <bl.dimitris@gmail.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked from 7ec471851400cd878322712309ef996582df02f1

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoIntroduce the Gluster storage type
Dimitris Bliablias [Mon, 18 May 2015 13:01:36 +0000 (15:01 +0200)]
Introduce the Gluster storage type

Currently, the 'gluster' and 'sharedfile' disk templates are both mapped
to the Shared File storage type. This compromise causes the Gluster block
devices to be interpreted in the config as 'sharedfile' devices, instead
of 'gluster', and subsequently to be wrongly handled as Shared File
disks. This behavior, currently makes the 'gluster' disk template not
functional.

This patch, fixes this issue by introducing the Gluster storage type,
which will be exclusively used by the 'gluster' disk template.

Signed-off-by: Dimitris Bliablias <bl.dimitris@gmail.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked from ba550291df12b129f843581c098b3896023e7d33

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Mon, 18 May 2015 12:12:55 +0000 (14:12 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Check for gnt-cluster before running gnt-cluster upgrade

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Mon, 18 May 2015 08:09:13 +0000 (10:09 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stbale-2.10
  Check for gnt-cluster before running gnt-cluster upgrade

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMake xend-config.sxp optional
Hrvoje Ribicic [Wed, 13 May 2015 12:24:42 +0000 (12:24 +0000)]
Make xend-config.sxp optional

With Ganeti imposing no requirement on Xen versions, the configuration
file that should be present varies greatly on the choice of toolstack
and Xen version. xend-config.sxp was considered obligatory, but in
higher versions and with xl, it is superseded by xl.conf and considered
deprecated. This patch makes it have the same status as xl.conf - Ganeti
will distribute it but not require its presence.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoCheck for gnt-cluster before running gnt-cluster upgrade
Christos Trochalakis [Tue, 12 May 2015 19:24:10 +0000 (22:24 +0300)]
Check for gnt-cluster before running gnt-cluster upgrade

When ganeti is removed (not purged) `/etc/cron.d/ganeti` is not deleted,
thus after a reboot cron tries to execute gnt-cluster upgrade and fails.

The same pattern is used on all other cron entries.

Signed-off-by: Christos Trochalakis <christos@skroutz.gr>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoRevision bump to 2.12.4 v2.12.4
Petr Pudlak [Tue, 12 May 2015 11:19:18 +0000 (13:19 +0200)]
Revision bump to 2.12.4

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoUpdate NEWS for 2.12.4
Petr Pudlak [Tue, 12 May 2015 11:18:17 +0000 (13:18 +0200)]
Update NEWS for 2.12.4

..  with the latest bugfixes and known issues

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoIgnore *.dyn* files generated by GHC 7.8
Petr Pudlak [Tue, 12 May 2015 08:50:29 +0000 (10:50 +0200)]
Ignore *.dyn* files generated by GHC 7.8

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoReplace HFLAGS_NOPROF with HFLAGS_DYNAMIC in the Makefile
Petr Pudlak [Tue, 12 May 2015 08:48:52 +0000 (10:48 +0200)]
Replace HFLAGS_NOPROF with HFLAGS_DYNAMIC in the Makefile

After cherry-picking the changes needed for GHC7.8, the former isn't
used any more.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoExpand orphan volume test
Hrvoje Ribicic [Thu, 7 May 2015 15:35:38 +0000 (15:35 +0000)]
Expand orphan volume test

to ensure we are not reporting stray volumes on other VGs as orphans.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoRestrict Ganeti's orphan volume checks to the single VG
Hrvoje Ribicic [Wed, 6 May 2015 17:17:53 +0000 (17:17 +0000)]
Restrict Ganeti's orphan volume checks to the single VG

Prior to patch eeda588292, Ganeti checked all the LVs on nodes under
its control, and dutifuly declared any stray volumes as orphans in
warnings emitted during cluster-verify. After the patch, the nodes
returned information related only to the LV set as *the* Ganeti VG,
bypassing this problem.

Unfortunately, this led Ganeti to report the disks of instances created
on a different VG as non-existent. This patch fixes things by reverting
patch eeda588292 and making Ganeti warn about orphan volumes only if
they belong to the Ganeti-administered VG.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoModify UDS server startup to set permissions for sockets
Hrvoje Ribicic [Wed, 6 May 2015 15:55:02 +0000 (15:55 +0000)]
Modify UDS server startup to set permissions for sockets

When opening domain sockets for communication, the Haskell daemons did
not set any permissions for the sockets, defaulting to 0700. This was
fine when all of them ran as root, but was bound to cause trouble in a
split-user setup. The first issue is RAPI access after master-failover,
where RAPI could not send make any inquiries until the watcher restored
the desired permissions of the socket.

This patch modifies Luxid to use a g+rw socket, and leaves other servers
to their default of 0600.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoAdd wheezy chroot files to gitignore file
Lisa Velden [Thu, 7 May 2015 12:05:43 +0000 (14:05 +0200)]
Add wheezy chroot files to gitignore file

Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoMakefile.am: Don't use -dynamic-too for .hpc_o files
Niklas Hambuechen [Mon, 3 Nov 2014 18:35:39 +0000 (19:35 +0100)]
Makefile.am: Don't use -dynamic-too for .hpc_o files

It turns out that GHC 7.8's -dynamic-too is forbidden not only for
profiling builds object files, but also for those using HPC coverage.

This commit accordingly renames HFLAGS_NOPROF to HFLAGS_DYNAMIC
(since it now is not conditional on profiling any more),
and makes sure that it is not used for profiling or HPC.

This way we achieve that, for profiling+coverage builds
  - .dyn_o files are available for use in TH in the following 3 cases
  - .o files are for the normal binaries
  - .hpc_o files are for coverage-enabled test binaries
  - .prof_o files are for profiling binaries

We make .hpc_o files depend on the .o files because the creation of
the .o files will also create the .so files needed for TH.
This was already in place for .prof_o files.

This requires that HFLAGS now also contains `-itest/hs` since
the rule for .o files is now also responsible for building .o/.so files
in test/hs.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

Cherry-picked-from: 1ad14f3
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMakefile.am: Don't use dots in -osuf
Niklas Hambuechen [Mon, 3 Nov 2014 15:18:42 +0000 (16:18 +0100)]
Makefile.am: Don't use dots in -osuf

This fixes
  ./configure --enable-haskell-tests && make hs-tests
builds on GHC 7.8.

It changes `-osuf .ext` to `-osuf ext`; the old form was allowed in
GHC <= 7.6, but GHC 7.8 seems to have problems with it:
  https://ghc.haskell.org/trac/ghc/ticket/9760

The form without dot works in all GHC versions, and we don't have
dots in other -osuf arguments in the same file either, so this
was probably an accident.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

Cherry-picked-from: 9664aff
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoFix compiler invocation for GHC >= 7.8
Niklas Hambuechen [Mon, 3 Nov 2014 11:14:09 +0000 (12:14 +0100)]
Fix compiler invocation for GHC >= 7.8

GHC 7.8 switched to dynamic linking being used for ghci, which requires
that .so file are being built for modules that are loaded for TH.

For this reason, GHC >= 7.8 has a -dynamic-too flag, which we now use.

However, -dynamic-too must not be enabled for profiling builds,
which is why this commit introduces a HFLAGS_NOPROF variable
(currently only containing -dynamic-too) that must be passed to
all GHC invocations that are not creating profiling output.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

Cherry-picked-from: 083776b
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMakefile.am: Fix wrong -dep-suffix for GHC 7.8
Niklas Hambuechen [Fri, 31 Oct 2014 15:40:27 +0000 (16:40 +0100)]
Makefile.am: Fix wrong -dep-suffix for GHC 7.8

This works around https://ghc.haskell.org/trac/ghc/ticket/9749:

GHC 7.8 (undocumentedly) changed the way in which ghc -M generated
object file dependencies, lacking the underscore that older versions
added automatically to the file names.
It also requires a -dep-suffix for the plain object file (.o).

This commit detects GHC 7.6 and older (7.7 is development only, has no
release and is treated equal to 7.8), and adjusts the -M invocation
appropriately for newer GHC versions.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

Cherry-picked-from: b78a2c3
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoOnly upgrade configs not upgraded
Klaus Aehlig [Wed, 6 May 2015 10:16:53 +0000 (12:16 +0200)]
Only upgrade configs not upgraded

Whenever we set a configuration, we also upgrade it.
In particular, there is no need for an unconditional upgrade;
so avoid upgrading the configuration over and over again
if it did not change.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoOnly unlock config if we did lock it
Klaus Aehlig [Mon, 3 Nov 2014 19:27:45 +0000 (20:27 +0100)]
Only unlock config if we did lock it

We only acquired a config lock if it was not shared in order
to have lock-free reads. Hence, only release the config lock
if we actually acquired it.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>

Cherry-picked-from: 35056743
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoMention preferred DRBD module settings when using Xen
Hrvoje Ribicic [Tue, 5 May 2015 09:18:29 +0000 (09:18 +0000)]
Mention preferred DRBD module settings when using Xen

Add a mention into the install file, and provide a link to the official
DRBD documentation.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoAvoid assertIn
Klaus Aehlig [Tue, 5 May 2015 07:23:23 +0000 (09:23 +0200)]
Avoid assertIn

...as we still support python versions older than the introduction
of assertIn.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoTest presence of public and private parameters
Lisa Velden [Mon, 4 May 2015 15:32:27 +0000 (17:32 +0200)]
Test presence of public and private parameters

Make sure that there is an environment variable for each parameter
with the correct value.

Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoPut private parameters into the environment
Lisa Velden [Thu, 23 Apr 2015 14:49:22 +0000 (16:49 +0200)]
Put private parameters into the environment

and unobscure them

Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoAlways close pipe on job forking
Klaus Aehlig [Mon, 4 May 2015 12:54:29 +0000 (14:54 +0200)]
Always close pipe on job forking

...even if the initial hand shake succeeded.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoClean up pipes early on failed forks
Klaus Aehlig [Mon, 4 May 2015 12:43:52 +0000 (14:43 +0200)]
Clean up pipes early on failed forks

...so that we do not accumulate open file descriptors.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoRevision bump to 2.12.3 v2.12.3
Petr Pudlak [Tue, 28 Apr 2015 15:11:56 +0000 (17:11 +0200)]
Revision bump to 2.12.3

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

5 years agoUpdate NEWS for 2.12.3
Petr Pudlak [Tue, 28 Apr 2015 15:09:15 +0000 (17:09 +0200)]
Update NEWS for 2.12.3

.. with the latest bugfixes and known issues.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

5 years agoWhen assigning UUIDs to disks, do so recursively
Klaus Aehlig [Thu, 23 Apr 2015 11:31:27 +0000 (13:31 +0200)]
When assigning UUIDs to disks, do so recursively

Old versions of Ganeti (in particular, 2.5 and earlier) did not
have UUIDs assigned to objects. If we happen to find such an old
configuration, we assign UUIDs now, during the upgrade. However,
we must do this recursively, as disks might have children. Note
that before Ganeti 2.12 this didn't matter, as the UUIDs of the
children where never used or enforced. With the strict type checking
introduced by the switch to haskell, we have to care about those
little details.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoFix sample 2.11 configuration
Klaus Aehlig [Thu, 23 Apr 2015 12:21:47 +0000 (14:21 +0200)]
Fix sample 2.11 configuration

In 2.11, children disks have UUIDs, too.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoInclude hypervisor parameters in SSConf
Petr Pudlak [Wed, 22 Apr 2015 17:09:47 +0000 (19:09 +0200)]
Include hypervisor parameters in SSConf

This was omitted after the refactoring of SSConf to Haskell, now being
added. Fixes #1073.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoAdd SSConf keys for hypervisor parameters
Petr Pudlak [Wed, 22 Apr 2015 15:48:27 +0000 (17:48 +0200)]
Add SSConf keys for hypervisor parameters

.. and a function for converting hypervisor types to the keys.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoUse Hypervisor as the key in ClusterHvParams
Petr Pudlak [Wed, 22 Apr 2015 11:10:29 +0000 (13:10 +0200)]
Use Hypervisor as the key in ClusterHvParams

.. instead of String. This imposes a type-level restriction that the
keys of the map are just hypervisor names.

Note about 'Arbitrary GroupDiskParams': Since GroupDiskParams and
ClusterHvParams were both synonyms for 'Container (Container JSValue)',
the Arbitrary instance worked for both. After fixing the type of
ClousterHvParams, its instance become different from GroupDiskParams,
hence the latter needs the addition.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoRe-remove final config update in renew-crypto
Klaus Aehlig [Mon, 20 Apr 2015 14:43:38 +0000 (16:43 +0200)]
Re-remove final config update in renew-crypto

...as it was accidentally readded in the merge.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Mon, 20 Apr 2015 13:10:48 +0000 (15:10 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Update configure file to version 2.11.7
  Update NEWS file for 2.11.7 release
  Add logging to RenewCrypto
  Fix format string for gnt-network info
  Replace textwrapper.wrap by a custom version for networks
  Add SSL improvements to NEWS file

* stable-2.10
  Update tag limitations
  Fix typos in doc/design-storagetypes.rst
  Make getFQDN prefer cluster protocol family
  Add version of getFQDN accepting preferences
  Make getFQDN honor vcluster

Conflicts:
NEWS: take all release entries
configure.ac: ignore revision bump
lib/cmdlib/cluster.py: manually apply 2.11 changes to 2.12
src/Ganeti/Daemon.hs: trivial

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Mon, 20 Apr 2015 11:17:24 +0000 (13:17 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Update tag limitations
  Fix typos in doc/design-storagetypes.rst

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoFix string formatting in private object representation
Lisa Velden [Mon, 20 Apr 2015 09:42:47 +0000 (11:42 +0200)]
Fix string formatting in private object representation

and use one-element tuplesfor string formatting

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoFix the computation of the list of reserved IP addresses
Petr Pudlak [Fri, 17 Apr 2015 17:06:19 +0000 (19:06 +0200)]
Fix the computation of the list of reserved IP addresses

After refactoring the code for network addresses to Haskell, a
regression appeared that added 30 to all IP addresses in the generated
list. Since the code for generating the list used just 'show' and look
for 0s and 1s in the string (and treating anything else as 0), it turned
out that after adding a separate type for address pools, the strings
become

    "AddressPool {apReservations = ...}"

and the initial part of the string was exactly the mysterious 30
characters.

This fix replaces this by switching to correct types and iterating over
the bits in BitArray.

Fixes #1068.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoUpdate tag limitations
Klaus Aehlig [Fri, 17 Apr 2015 16:54:22 +0000 (18:54 +0200)]
Update tag limitations

We always supported underscores in tags since \w in pythons
interpretation of regular expressions does include the underscore.
While this might have happened by accident, there is no reason to
change the implementation. The motivation for the restriction
was to avoid accidents with wrong (manual) shell escaping; the
underscore, however, has no special meaning to the shell. So
just make the documentation say what we implemented.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoUpdate configure file to version 2.11.7 v2.11.7
Helga Velroyen [Wed, 15 Apr 2015 08:40:04 +0000 (10:40 +0200)]
Update configure file to version 2.11.7

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

5 years agoUpdate NEWS file for 2.11.7 release
Helga Velroyen [Wed, 15 Apr 2015 08:39:39 +0000 (10:39 +0200)]
Update NEWS file for 2.11.7 release

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

5 years agoAdd logging to RenewCrypto
Helga Velroyen [Mon, 13 Apr 2015 09:07:45 +0000 (11:07 +0200)]
Add logging to RenewCrypto

As the LURenewCrypto is a pain to debug, this patch
adds a lot more logging of events to the method.
Note:
- As renew-crypto is a relatively rarely used operation
  in a normal production cluster, this won't clutter up
  real user's log files.
- Most of the messages are in debug mode, so they would
  anyway just show up in log files of clusters run in
  debug mode (as for example our QA clusters.
- A few log messages are in error mode, which is
  intentional as they log more details about the errors
  than is given in the feedback functions.

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

5 years agoFix typos in doc/design-storagetypes.rst
Gangbiao Liu [Wed, 8 Apr 2015 12:12:21 +0000 (20:12 +0800)]
Fix typos in doc/design-storagetypes.rst

Signed-off-by: Gangbiao Liu <lgb.nwpu@gmail.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Fri, 10 Apr 2015 13:33:04 +0000 (15:33 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Make getFQDN prefer cluster protocol family
  Add version of getFQDN accepting preferences
  Make getFQDN honor vcluster

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

5 years agoMake getFQDN prefer cluster protocol family
Klaus Aehlig [Fri, 10 Apr 2015 10:15:24 +0000 (12:15 +0200)]
Make getFQDN prefer cluster protocol family

In getFQDN, if the primary IP family of the cluster is known,
provide it as a hint.

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

5 years agoAdd version of getFQDN accepting preferences
Klaus Aehlig [Fri, 10 Apr 2015 10:05:50 +0000 (12:05 +0200)]
Add version of getFQDN accepting preferences

Still the best way to get the "canonical name" of a host
is to look up its host name and reverse look up the IP
address obtained. Obviously, that the result depends
on the protocol family used. So accept hints on which
family to prefer.

Note that getFQDN is exported on higher branches, so we
keep its type stable to avoid semantic merge conflicts.

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

5 years agoMake getFQDN honor vcluster
Klaus Aehlig [Mon, 2 Jun 2014 15:31:10 +0000 (17:31 +0200)]
Make getFQDN honor vcluster

Make the official (exported) getFQDN function honor the vcluster
setup. In this way, also Haskell daemons can obtain their name
correctly in a vcluster. In particular, voting will work.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

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

5 years agoIncrease number of retries for daemon RPCs
Klaus Aehlig [Thu, 9 Apr 2015 15:41:45 +0000 (17:41 +0200)]
Increase number of retries for daemon RPCs

As the Ganeti 2.12 design allows for daemons to be
restarted with jobs running, jobs accept them not
to be present and wait for them to come back, retrying.
However, the total time jobs waited, in some conditions,
turned out to be shorter than the actual restart. So
increase the number of retries and also linearly back
off after failures.

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

5 years agoFix format string for gnt-network info
Klaus Aehlig [Thu, 9 Apr 2015 08:42:51 +0000 (10:42 +0200)]
Fix format string for gnt-network info

As soon as we have networks bigger than a /22, the lower
index of a line in the usage map can have 4 digits. So
prepare the formating for this.

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

5 years agoReplace textwrapper.wrap by a custom version for networks
Klaus Aehlig [Thu, 9 Apr 2015 08:20:37 +0000 (10:20 +0200)]
Replace textwrapper.wrap by a custom version for networks

"gnt-network info" also provides information about the mapping of used
IPs in that network. This mapping is obtained from the query as a long
string without any spaces. It seems that textwrap.wrap does not perform
well on those strings. Therefore, manually wrap that string, thus bringing
down the time "gnt-network info" takes for a /16 from 1.5 minutes to half
a second. Fixes issue 1016.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Wed, 8 Apr 2015 11:18:34 +0000 (13:18 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  fix typos in design-file-based-storage.rst doc
  Switch to our osminor
  Provide an alternative for os.minor working around its bug
  Fix typo
  CanTieredAlloc test: make instances big enough
  After master-failover verify reachability of master IP
  Report failure to deactivate old master IP in exit code
  Expose warnings during master-failover
  Fix manpage for gnt-cluster copyfile

Conflicts:
lib/bootstrap.py: adapt function to new IO specification
lib/utils/storage.py: trivial

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoAdd SSL improvements to NEWS file
Helga Velroyen [Wed, 8 Apr 2015 09:48:40 +0000 (11:48 +0200)]
Add SSL improvements to NEWS file

This adds a comment about the recent improvements of
'gnt-cluster renew-crypto --new-node-certificates'

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Wed, 8 Apr 2015 09:21:05 +0000 (11:21 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  fix typos in design-file-based-storage.rst doc
  Switch to our osminor
  Provide an alternative for os.minor working around its bug
  Fix typo
  CanTieredAlloc test: make instances big enough
  After master-failover verify reachability of master IP
  Report failure to deactivate old master IP in exit code
  Expose warnings during master-failover
  Fix manpage for gnt-cluster copyfile

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

5 years agoFix typos
Lisa Velden [Wed, 8 Apr 2015 07:26:36 +0000 (09:26 +0200)]
Fix typos

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agofix typos in design-file-based-storage.rst doc
Gangbiao Liu [Wed, 8 Apr 2015 01:48:47 +0000 (09:48 +0800)]
fix typos in design-file-based-storage.rst doc

Fix typos in doc/design-file-based-storage.rst.

Signed-off-by: Gangbiao Liu <lgb.nwpu@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoSwitch to our osminor
Klaus Aehlig [Tue, 7 Apr 2015 16:06:13 +0000 (18:06 +0200)]
Switch to our osminor

...and thus work around the bug in os.minor

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoProvide an alternative for os.minor working around its bug
Klaus Aehlig [Tue, 7 Apr 2015 16:04:28 +0000 (18:04 +0200)]
Provide an alternative for os.minor working around its bug

Python's os.minor still contains an old definition, whereas the
current one has changed. So we add our own definition working around
this bug.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoFix typo
Lisa Velden [Tue, 7 Apr 2015 12:37:37 +0000 (14:37 +0200)]
Fix typo

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoCanTieredAlloc test: make instances big enough
Klaus Aehlig [Thu, 2 Apr 2015 16:03:12 +0000 (18:03 +0200)]
CanTieredAlloc test: make instances big enough

Fix a subtle bug in the CanTieredAlloc test. The property we were
testing for was actually not valid with the addition of an ipolicy.
The lower policy bound for disk was 4 times the unit for disks (256M).
So, a valid node have free disk only slightly larger than the ipolicy
lower bound. When shrinking disks, however, we go in steps of full
units---and thus might miss the window of opportunity if that is smaller
that a full unit. So, only use nodes that have at least 5 units worth
of resources for every resource.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoAfter master-failover verify reachability of master IP
Klaus Aehlig [Thu, 2 Apr 2015 13:26:45 +0000 (15:26 +0200)]
After master-failover verify reachability of master IP

...and warn if it is not. Note that the master activates
the master IP in an asynchronous task and will continue
even if that fails.

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

5 years agoReport failure to deactivate old master IP in exit code
Klaus Aehlig [Thu, 2 Apr 2015 09:46:03 +0000 (11:46 +0200)]
Report failure to deactivate old master IP in exit code

If we failed to disable the old master IP, the master failover
did not fully succeed, hence that should be reported in the
exit code. Nevertheless, the best is to proceed, as it is
better to have working cluster, albeit only reachable via
the primary IP of the new master node (and not the cluster
master IP), than not have a cluster. Also note, that for
this reason master will start up even if it cannot set
the cluster master IP. So, while there, fix the warning
message as well.

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

5 years agoExpose warnings during master-failover
Klaus Aehlig [Wed, 1 Apr 2015 16:04:59 +0000 (18:04 +0200)]
Expose warnings during master-failover

During master failover, there are some situations where problems
occur but the best thing to do is to carry on. These problems
are logged using the usual mechanism. However, a user usually
does not look into the log file unless the command executed
returns some hints that something might have gone wrong.
So also return the warnings as an additional return value,
allowing the CLI to report properly.

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

5 years agoFix manpage for gnt-cluster copyfile
Lisa Velden [Wed, 1 Apr 2015 16:07:30 +0000 (18:07 +0200)]
Fix manpage for gnt-cluster copyfile

Change "copyfile" position in example

Signed-off-by: Lisa Velden <velden@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Tue, 31 Mar 2015 13:10:44 +0000 (15:10 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Fixed typos
  Pass correct params in move-instance
  In CanTieredAlloc test set IPolicy
  Make genInstanceMaybeBiggerThanNode honor policy lower bound
  Also export a null ISpec
  Support instance generation within ranges
  Add a function to leave the list monad

Conflicts:
tools/move-instance
Resolution:
manually apply 6f918cb2c97 to version on 2.12

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Tue, 31 Mar 2015 08:27:54 +0000 (10:27 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Fixed typos
  Pass correct params in move-instance
  In CanTieredAlloc test set IPolicy
  Make genInstanceMaybeBiggerThanNode honor policy lower bound
  Also export a null ISpec
  Support instance generation within ranges
  Add a function to leave the list monad

Conflicts:
src/Ganeti/BasicTypes.hs (take all the imports)

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

5 years agoAdd default values for hv_state_static and disk_state_static
Klaus Aehlig [Mon, 30 Mar 2015 14:42:35 +0000 (16:42 +0200)]
Add default values for hv_state_static and disk_state_static

When parsing the cluster configuration, accept that "hv_state_static"
and "disk_state_static" can be missing; in this case, just use the
default value. This follows the implicit upgrade that was present
for these parameters in the python code all the time. In this way,
upgrading from very old versions of Ganeti runs more smoothly
(issue 1019).

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

5 years agoAdd a value for the empty Container
Klaus Aehlig [Mon, 27 Oct 2014 13:14:16 +0000 (14:14 +0100)]
Add a value for the empty Container

...so that we can use it as a default for Container
parameters.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked-from: 388a5a44
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

5 years agoVerify if we're master before demoting
Klaus Aehlig [Mon, 30 Mar 2015 12:36:23 +0000 (14:36 +0200)]
Verify if we're master before demoting

...as the master node should never lose it's master capability.
Fixes issue 1023.

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

5 years agoFixed typos
Lisa Velden [Fri, 27 Mar 2015 13:19:06 +0000 (14:19 +0100)]
Fixed typos

Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoAlso consider connection time out a network error
Klaus Aehlig [Thu, 26 Mar 2015 10:56:09 +0000 (11:56 +0100)]
Also consider connection time out a network error

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

5 years agoPass correct params in move-instance
Hrvoje Ribicic [Thu, 26 Mar 2015 14:35:42 +0000 (14:35 +0000)]
Pass correct params in move-instance

move-instance incorrectly passes backend params as the OS params when
moving an instance. This patch fixes this.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

5 years agoIn CanTieredAlloc test set IPolicy
Klaus Aehlig [Wed, 25 Mar 2015 16:49:17 +0000 (17:49 +0100)]
In CanTieredAlloc test set IPolicy

Changing the test to allocate on nodes with a non-trivial
instance policy has two advantages.

- We test in a more realistic (and also more challenging)
  environment.

- Once the lower limit of the ipolicy is reached no more
  allocations are possible, thus having fewer shrinking
  rounds---and hence speeding up the test by a factor of 4.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoMake genInstanceMaybeBiggerThanNode honor policy lower bound
Klaus Aehlig [Wed, 25 Mar 2015 15:56:09 +0000 (16:56 +0100)]
Make genInstanceMaybeBiggerThanNode honor policy lower bound

Note that in all current calls to this function, the node has the
nullIPolicy, to the semantics does not change here.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoAlso export a null ISpec
Klaus Aehlig [Wed, 25 Mar 2015 16:01:18 +0000 (17:01 +0100)]
Also export a null ISpec

This is an ISpec for an instance with 0 resources. It can serve as a trivial
lower bound where we have to provide one but do not actually care.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoSupport instance generation within ranges
Klaus Aehlig [Wed, 25 Mar 2015 15:37:22 +0000 (16:37 +0100)]
Support instance generation within ranges

This will be used to generate instances big enough to fall within
a given instance policy.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoAdd a function to leave the list monad
Klaus Aehlig [Fri, 14 Feb 2014 23:12:23 +0000 (00:12 +0100)]
Add a function to leave the list monad

The list monad provides convenient syntax for non-deterministic
algorithms. Add a function leaving that monad with this intuition
in mind.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked-from: a1da8a503ba
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoRevision bump to 2.12.2 v2.12.2
Petr Pudlak [Wed, 25 Mar 2015 12:17:37 +0000 (13:17 +0100)]
Revision bump to 2.12.2

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoUpdate NEWS for 2.12.2
Petr Pudlak [Wed, 25 Mar 2015 12:16:28 +0000 (13:16 +0100)]
Update NEWS for 2.12.2

.. with the latest bugfixes and known issues.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoUpgrade codebase to support monad-control >=0.3.1.3 && <1.1
Aditya Bhimanavajjula [Mon, 16 Feb 2015 14:23:59 +0000 (15:23 +0100)]
Upgrade codebase to support monad-control >=0.3.1.3 && <1.1

The interfaces for MonadTransControl, and MonadBaseControl has changed
since 1.0.0.0 in monad-control.
The associated types StT and StM are defined now using type instead of
newtype which simplifies definitions and method signatures.
With this patch monad-control 0.3.1.3 and later up til 1.1 are
supported.

Signed-off-by: BSRK Aditya <bsrk@google.com>
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Conflicts:
cabal/ganeti.template.cabal
src/Ganeti/BasicTypes.hs
src/Ganeti/Logging/WriterLog.hs
src/Ganeti/THH/HsRPC.hs
src/Ganeti/WConfd/Monad.hs

Resolution:
 - Remove the cabal template (present only in 2.14)
 - Remove Haskell language extensions needed only in later versions

Cherry-picked-from: 890b08b7fadce821e89c4c2c7aabe3c1ff47046e
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoAdd macros for the version of monad-control
Petr Pudlak [Tue, 24 Mar 2015 13:00:15 +0000 (14:00 +0100)]
Add macros for the version of monad-control

.. to the Makefile as well as to the Haskell modules where it will be
needed.

While at it, fix spacing so that command lines start with tabs, as they
should.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoRename hs-lens-versions Makefile target to hs-pkg-versions
Petr Pudlak [Tue, 24 Mar 2015 12:55:32 +0000 (13:55 +0100)]
Rename hs-lens-versions Makefile target to hs-pkg-versions

.. as we'll be adding the version information of another package later.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoVerify master status before retrying a socket
Klaus Aehlig [Tue, 24 Mar 2015 12:52:47 +0000 (13:52 +0100)]
Verify master status before retrying a socket

If we cannot connect to a socket, first verify that we are
actually running on master before retrying. In this way, we
can report to the user quickly without adding additional
overhead to the intended use case.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Tue, 24 Mar 2015 13:37:53 +0000 (14:37 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Improve error handling when looking up instances
  Capture last exception

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

5 years agoImprove error handling when looking up instances
Helga Velroyen [Mon, 23 Mar 2015 17:16:51 +0000 (18:16 +0100)]
Improve error handling when looking up instances

When looking up configuration data of instances which don't
exist, the code so far fails with a cryptic error messages
about NoneType not having an attribute. Although actually
this situation should not happen, let's at least throw an
exception with a proper description.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMake LUClusterDestroy tell WConfD
Klaus Aehlig [Fri, 20 Mar 2015 14:01:06 +0000 (15:01 +0100)]
Make LUClusterDestroy tell WConfD

...to prepare cluster destruction.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoAdd an RPC to prepare cluster destruction
Klaus Aehlig [Thu, 19 Mar 2015 17:19:01 +0000 (18:19 +0100)]
Add an RPC to prepare cluster destruction

To avoid subtle races when destroying a cluster, we need to make
sure that the cluster destroy LU is the last LU ever executed.
That LU gets the BGL exclusively; however, it needs the daemons
for it to proceed, so the daemons will still be running at its
finish, thus causing the race. (Also note, that the watcher might
restart stopped daemons at any time.) Therefore, the last thing
that LU will do is to transfer the BGL to WConfD itself; WConfD
will also modify the configuration to a no-master state, thus
making sure it will refuse to restart.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoSupport no-master state in ssconf
Klaus Aehlig [Fri, 20 Mar 2015 13:50:05 +0000 (14:50 +0100)]
Support no-master state in ssconf

When destroying a cluster, it needs to go to no-master state
first, to ensure daemons will refuse to restart. So, even if
there is no master, we need to provide a value the master entry
in ssconf. The value chosen contains a space character and therefore
cannot be a valid domain name.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoWConfD: do not clean up own livelock
Klaus Aehlig [Thu, 19 Mar 2015 16:21:16 +0000 (17:21 +0100)]
WConfD: do not clean up own livelock

Now that WConfD has a livelock file of its own,
it needs to ignore it in clean up operations.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMake WConfD have a livelock file as well
Klaus Aehlig [Thu, 19 Mar 2015 15:22:51 +0000 (16:22 +0100)]
Make WConfD have a livelock file as well

During cluster destruction, WConfD will need to take the
BGL. Therefore, it has to have a livelock file as well.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoAdd a prefix for a WConfD livelock
Klaus Aehlig [Thu, 19 Mar 2015 15:35:28 +0000 (16:35 +0100)]
Add a prefix for a WConfD livelock

...so that WConfD will be able to own locks for itself.
This will be necessary on cluster destruction, where it
takes over the BGL.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoDetect if the own job file disappears
Klaus Aehlig [Wed, 18 Mar 2015 17:32:07 +0000 (18:32 +0100)]
Detect if the own job file disappears

...and take appropriate actions in this case.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoKeep track of the number LUs executing
Klaus Aehlig [Thu, 19 Mar 2015 13:53:06 +0000 (14:53 +0100)]
Keep track of the number LUs executing

This number will always be only 0 or 1, but keep the implementation
generic. We need to know whether the job is currently in the execution
phase to decide if we can clean up ourselves on disappearance or our
job file.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMake job processes keep track of their job id
Klaus Aehlig [Thu, 19 Mar 2015 12:38:44 +0000 (13:38 +0100)]
Make job processes keep track of their job id

With 2.12 jobs run as separate processes. Therefore,
each process should only be in charge of a single
job. Keep track of its job id and warn if this property
is violated.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoMake LuxiD clean up its lock file
Klaus Aehlig [Mon, 23 Mar 2015 09:39:13 +0000 (10:39 +0100)]
Make LuxiD clean up its lock file

LuxiD locks the job queue during its life time to avoid
two instances running in parallel. When the process dies
(for whatever reason) the advisory lock on the file is gone
so a new daemon can restart. However, the file itself is
not gone, so after cluster destruction a gnt-cluster init
will refuse to create a new cluster. So, after finishing,
remove the file as well.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoCapture last exception
Helga Velroyen [Thu, 19 Mar 2015 16:13:16 +0000 (17:13 +0100)]
Capture last exception

This fixes a minor problem in LURenewCrypto, where we
use the exception variable after the try/except block.
By assigning it to a previously initialized one, we make
sure that we can access this information.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

5 years agoQA: Fix CheckFileUnmodified to work with vcluster
Petr Pudlak [Thu, 19 Mar 2015 17:05:02 +0000 (18:05 +0100)]
QA: Fix CheckFileUnmodified to work with vcluster

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoQA: Fix white-spaces in CheckFileUnmodified
Petr Pudlak [Thu, 19 Mar 2015 16:24:35 +0000 (17:24 +0100)]
QA: Fix white-spaces in CheckFileUnmodified

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agoQA: Check that the cluster verify doesn't change the config
Petr Pudlak [Thu, 19 Mar 2015 13:59:59 +0000 (14:59 +0100)]
QA: Check that the cluster verify doesn't change the config

Cluster verification must not do any changes to the configuration.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>