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

5 years agoQA: Allow to check that an operation doesn't change a file
Petr Pudlak [Thu, 19 Mar 2015 13:57:54 +0000 (14:57 +0100)]
QA: Allow to check that an operation doesn't change a file

The function checks the SHA1 sum of a given file before and after a
block of code is executed, verifying that the content of the file
remains the same.

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

5 years agoUse only shared configuration lock for ComputeDRBDMap
Petr Pudlak [Thu, 19 Mar 2015 12:32:10 +0000 (13:32 +0100)]
Use only shared configuration lock for ComputeDRBDMap

This solves the following issue with failing cluster verify operations.
As this function declared to modify the configuration by taking an
exclusive lock, the configuration serial number changed during verify
operations, which in turn caused to fail other concurrently running
checks.

The mistake has been present in previous versions as well, but only
causes problems in 2.12 where each configuration write is explicitly
tracked.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Hrvoje Ribicic [Thu, 19 Mar 2015 15:08:41 +0000 (15:08 +0000)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Improve speed of Xen hypervisor unit tests
  Improve Xen instance state handling

* stable-2.10
  Make QA fail if KVM hotplugging fails
  Always preserve QA command output
  Don't lose stdout/stderr in AssertCommand
  qa_utils: Allow passing fail=None to AssertCommand
  qa_utils: Make AssertCommand return stdout/stderr as well
  Allow plain/DRBD conversions regardless of lack of disks
  Add support for ipolicy modifications to mock config

Conflicts:
lib/cmdlib/instance.py
qa/qa_instance.py
test/py/cmdlib/testsupport/config_mock.py
Resolution:
instance.py: Keep new testing logic, modify snode fetch.
qa_instance.py: Reenable hotplug tests.
        config_mock.py: Combine all changes.

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Hrvoje Ribicic [Thu, 19 Mar 2015 12:53:40 +0000 (13:53 +0100)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Make QA fail if KVM hotplugging fails
  Always preserve QA command output
  Don't lose stdout/stderr in AssertCommand
  qa_utils: Allow passing fail=None to AssertCommand
  qa_utils: Make AssertCommand return stdout/stderr as well
  Allow plain/DRBD conversions regardless of lack of disks
  Add support for ipolicy modifications to mock config

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

5 years agoOnly assert properties of non-None objects
Klaus Aehlig [Wed, 18 Mar 2015 17:28:50 +0000 (18:28 +0100)]
Only assert properties of non-None objects

The function _GetJobStatusForDependencies expects SafeLoadJobFromDisk
to return None and plans to raise a well-defined exception in that case.
However, if SafeLoadJobFromDisk actually does return None, the unguarded
assertion on job.writable causes an AttributeError first. So guard
this assertion.

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

5 years agoImprove speed of Xen hypervisor unit tests
Hrvoje Ribicic [Tue, 17 Mar 2015 22:07:46 +0000 (22:07 +0000)]
Improve speed of Xen hypervisor unit tests

Due to hard-coded timeouts used when listing instances, the Xen
unit tests took around 60s to execute. The key offender was a timeout
of five seconds used for an unsuccessful listing of instances. This
patch refactors the code slightly to define the timeout and delays used
in one place, allowing these to be changed during testing to a more
acceptable value. As a result, these tests take around 5s to execute.

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

5 years agoImprove Xen instance state handling
Hrvoje Ribicic [Tue, 17 Mar 2015 21:51:46 +0000 (21:51 +0000)]
Improve Xen instance state handling

Xen's utilities used by Ganeti to report instance state can have
interesting quirks, such as reporting that an instance resides in
different and somewhat contradictory states.

This patch improves the situation by ignoring the paused state, and
encoding some of the more exotic combinations that may appear.

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

5 years agoMake QA fail if KVM hotplugging fails
Hrvoje Ribicic [Wed, 18 Mar 2015 13:58:08 +0000 (14:58 +0100)]
Make QA fail if KVM hotplugging fails

Unlike almost all other modification commands, hotplugging a device and
failing does not result in an error code showing that the operation was
unsuccessful. Because of this, the QA ignored hotplugging failures. To
fix this, this patch makes the QA examine the output of the command for
signs of failure.

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

5 years agoAlways preserve QA command output
Hrvoje Ribicic [Tue, 17 Mar 2015 20:13:20 +0000 (20:13 +0000)]
Always preserve QA command output

A previous patch suppressed command output if the command succeded,
which reduces the amount of information we have in the QA, especially
warnings or the like. This patch restores the output, while still
ignoring the use cases in which we really do not care whether the
command succeeds or not.

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

5 years agoDon't lose stdout/stderr in AssertCommand
Klaus Aehlig [Tue, 4 Nov 2014 09:36:32 +0000 (10:36 +0100)]
Don't lose stdout/stderr in AssertCommand

If a command fails/succeeds that should not do so,
show stdout and stderr. This information can be
relevant for debugging.

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

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

5 years agoqa_utils: Allow passing fail=None to AssertCommand
Niklas Hambuechen [Wed, 8 Oct 2014 12:15:00 +0000 (14:15 +0200)]
qa_utils: Allow passing fail=None to AssertCommand

This is for cases where we don't care about the exit code.

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

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

5 years agoqa_utils: Make AssertCommand return stdout/stderr as well
Niklas Hambuechen [Mon, 22 Sep 2014 15:43:22 +0000 (17:43 +0200)]
qa_utils: Make AssertCommand return stdout/stderr as well

This is usefull if the run commands output something that's needed afterwards.

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

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

5 years agoIf any IO error happens during job forking, retry
Petr Pudlak [Wed, 18 Mar 2015 16:33:41 +0000 (17:33 +0100)]
If any IO error happens during job forking, retry

.. up to a given count. This ensures that problems with `exec` are
retried as well.

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

5 years agoAdd a function for retrying `MonadError` computations
Petr Pudlak [Wed, 18 Mar 2015 16:27:08 +0000 (17:27 +0100)]
Add a function for retrying `MonadError` computations

.. that don't have `MonadPlus` instance. The difference is that
`MonadError` computations must be run at least once.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Helga Velroyen [Wed, 18 Mar 2015 15:23:52 +0000 (16:23 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Renew crypto retries for non-master nodes
  Retries for the master's SSL cert renewal
  Unit tests for offline nodes
  De-duplicate testing code regarding pathutils
  Make LURenewCrypto handle unreachable nodes properly
  Error handling on failed SSL cert renewal for master
  Unit test for LURenewCrypto's valid case
  Mock support for pathutils
  Increase timeout of crypto token RPC

 Conflicts:
lib/cmdlib/cluster.py
test/py/cmdlib/cluster_unittest.py
test/py/cmdlib/testsupport/__init__.py

 Resolution:
        for all affected files: update changes to
        configuration handling

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

5 years agoRenew crypto retries for non-master nodes
Helga Velroyen [Wed, 4 Mar 2015 22:14:12 +0000 (23:14 +0100)]
Renew crypto retries for non-master nodes

If renewing the SSL certificate for non-master nodes fails,
try retring two more times. Unit tests included.

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

5 years agoRetries for the master's SSL cert renewal
Helga Velroyen [Wed, 4 Mar 2015 21:55:27 +0000 (22:55 +0100)]
Retries for the master's SSL cert renewal

If renewing the master's client SSL certificate fails, try
two more times before giving up. Unit test included.

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

5 years agoUnit tests for offline nodes
Helga Velroyen [Wed, 4 Mar 2015 21:22:38 +0000 (22:22 +0100)]
Unit tests for offline nodes

Add a unit test which tests that offline nodes are skipped
by LURenewCrypto.

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

5 years agoDe-duplicate testing code regarding pathutils
Helga Velroyen [Wed, 4 Mar 2015 21:07:09 +0000 (22:07 +0100)]
De-duplicate testing code regarding pathutils

After introducing some unit tests in the last patches,
there is some opportunity to reduce the duplicate code
around the 'pathutils' module.

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

5 years agoMake LURenewCrypto handle unreachable nodes properly
Helga Velroyen [Wed, 4 Mar 2015 21:01:23 +0000 (22:01 +0100)]
Make LURenewCrypto handle unreachable nodes properly

Currently an unreachable node can make LURenewCrypto fail
completely. This patch adds a unit test for it, and
improves the error handling of unreachable nodes in
a way, that the rest of the nodes are still handled
properly.

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

5 years agoError handling on failed SSL cert renewal for master
Helga Velroyen [Wed, 4 Mar 2015 20:31:40 +0000 (21:31 +0100)]
Error handling on failed SSL cert renewal for master

When the recreation of the master's SSL client certificate
fails, LURenewCrypto did not conclude very graciously.
This patch adds unit tests for this case and improves
the error handling.

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

5 years agoUnit test for LURenewCrypto's valid case
Helga Velroyen [Wed, 4 Mar 2015 17:41:45 +0000 (18:41 +0100)]
Unit test for LURenewCrypto's valid case

This adds a unit test which tests a successful run of
LURenewCrypto. While writing this, some options for
improvement became apparent and are fixed in this patch
as well.

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

5 years agoMock support for pathutils
Helga Velroyen [Wed, 4 Mar 2015 18:14:28 +0000 (19:14 +0100)]
Mock support for pathutils

For better LURenewCrypto unit tests, we need to be able to
mock the pathutils module. This makes it necessary to add
some support to the testutils for patching this module.

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

5 years agoIncrease timeout of crypto token RPC
Helga Velroyen [Wed, 4 Mar 2015 19:46:14 +0000 (20:46 +0100)]
Increase timeout of crypto token RPC

Currently, gnt-cluster renew-crypto is not very robust. It
fails completely as soon as one node does not create new
crypto tokens fast enough. To give the RPC more time,
increase the timeout.

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

5 years agoAnnotate every send/receive operation in Exec.hs
Petr Pudlak [Tue, 17 Mar 2015 14:29:32 +0000 (15:29 +0100)]
Annotate every send/receive operation in Exec.hs

The 'debug' log messages are now added as annotations to any I/O errors
during these operations, so if an error occurs, it'll be possible to
exactly identify the location from the error message.

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

5 years agoRefactor `rethrowAnnotateIOError` and simplify its usage
Petr Pudlak [Tue, 17 Mar 2015 14:26:41 +0000 (15:26 +0100)]
Refactor `rethrowAnnotateIOError` and simplify its usage

.. as a preparation for adding more detailed annotations later.

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

5 years agoQuery.Exec: Describe error if talking to job process fails
Niklas Hambuechen [Thu, 7 Aug 2014 17:17:14 +0000 (19:17 +0200)]
Query.Exec: Describe error if talking to job process fails

When the forked (Python) job process dies for any reason, then the next `read`
from its pipe will fail, giving an unhelpful error like:

   GenericError "<file descriptor: 13>: hWaitForInput: end of file"

This message is also returned to whoever started the job, e.g. a CLI or RAPI
invocation. It does not say more than "in some server using some FD failed",
which doesn't help tracking down the issue.

This commit makes the error location more descriptive, turning it into
either of:

  "<file descriptor: 13>: ganeti job process input pipe: end of file
  "<file descriptor: 13>: ganeti job process output pipe: end of file

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

Conflicts:
src/Ganeti/Query/Exec.hs - merge changes from both branches

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

5 years agoQuery.Exec: Log error when talking to job process fails
Niklas Hambuechen [Thu, 7 Aug 2014 17:17:13 +0000 (19:17 +0200)]
Query.Exec: Log error when talking to job process fails

When the forked (Python) job process dies for any reason, then the next `read`
from its pipe will fail, giving an unhelpful error like:

   GenericError "<file descriptor: 13>: hWaitForInput: end of file"

This commit adds an error log message when reading or writing the
pipe fails.

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

Conflicts:
src/Ganeti/Query/Exec.hs - merge changes from both branches

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

5 years agoAllow plain/DRBD conversions regardless of lack of disks
Hrvoje Ribicic [Mon, 16 Mar 2015 22:54:04 +0000 (22:54 +0000)]
Allow plain/DRBD conversions regardless of lack of disks

Because of trivial issues, it was impossible to use standard mechanisms
to convert a diskless plain instance to DRBD and vice versa. This
patch fixes that with a mechanism which will work until later versions,
where instances without disks organically take on the diskless
template.

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

5 years agoAdd support for ipolicy modifications to mock config
Hrvoje Ribicic [Mon, 16 Mar 2015 22:45:11 +0000 (22:45 +0000)]
Add support for ipolicy modifications to mock config

This patch adds a helper function making it easier to modify the
ipolicy within tests.

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

5 years agoFix the generation of Makefile.ghc rules for *_hi
Petr Pudlak [Mon, 16 Mar 2015 12:33:15 +0000 (13:33 +0100)]
Fix the generation of Makefile.ghc rules for *_hi

The replacement command only added dependencies for *.hi files, not
*.*_hi files that are used for testing.

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

5 years agoFix error handling for failed fork jobs
Petr Pudlak [Mon, 16 Mar 2015 10:49:11 +0000 (11:49 +0100)]
Fix error handling for failed fork jobs

The `onException` call we had before was wrong, as exceptions are
handled internally by `ResultT`. Instead, we need to call `onError` when
there is an error in `ResultT`, or when we're restarting the forking
process using `mzero`.

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

5 years agoIf a forked job process malfunctions, kill it thoroughly
Petr Pudlak [Mon, 16 Mar 2015 10:38:45 +0000 (11:38 +0100)]
If a forked job process malfunctions, kill it thoroughly

Repeat sending signals up to KILL to ensure that the process doesn't
survive.

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

5 years agoAdd function to run checked computations in `MonadError`
Petr Pudlak [Mon, 16 Mar 2015 10:36:18 +0000 (11:36 +0100)]
Add function to run checked computations in `MonadError`

This is just a generalized version of `try`.

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

5 years agoAdd job ID and process ID to log statements in Exec.hs
Petr Pudlak [Mon, 16 Mar 2015 10:05:22 +0000 (11:05 +0100)]
Add job ID and process ID to log statements in Exec.hs

.. so that it's easier to debug forking related problems.

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

5 years agoFix issues when generating 'lens' version definitions
Petr Pudlak [Tue, 10 Mar 2015 18:02:17 +0000 (19:02 +0100)]
Fix issues when generating 'lens' version definitions

The original version didn't work when the version was just 2 numbers,
and also wasn't robust enough when there were multiple 'lens' versions
installed.

This patch fixes that, and always takes the last installed version, as
reported by ghc-pkg.

Starting with 2.14 there is a native cabal-based mechanism for
generating these definitions, so the whole 'hs-lens-version' target
should be dropped from the Makefile in that version.

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

5 years agoSignal to the job queue when the cluster is gone
Petr Pudlak [Wed, 4 Mar 2015 16:08:36 +0000 (17:08 +0100)]
Signal to the job queue when the cluster is gone

When destroying a cluster, the single-job job queue process tries to
load the job file, which is already gone for good, resulting in the
process being stuck forever.

This patch ensures that the job queue terminates in such a case.

The added static variable to LUClusterDestroy should be removed in the
future together with the Python job queue.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Thu, 5 Mar 2015 14:06:04 +0000 (15:06 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Skip offline nodes in RENEW_CRYPTO jobs

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

5 years agoSkip offline nodes in RENEW_CRYPTO jobs
Gerard Oskamp [Tue, 3 Mar 2015 11:28:59 +0000 (11:28 +0000)]
Skip offline nodes in RENEW_CRYPTO jobs

Without this fix, RENEW_CRYPTO jobs will fail with the following error
if you have at least one offline node in your cluster:

Could not create the node's (uuid 607e6982-c6b4-4197-800f-70d3e5976800)
SSL client certificate.: Node is marked offline

Signed-off-by: Gerard Oskamp <gjo@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

5 years agoOnly read config if necessary
Klaus Aehlig [Mon, 3 Nov 2014 15:22:45 +0000 (16:22 +0100)]
Only read config if necessary

Make the ConfigWriter only rerequest the configuration if
it became outdated in the mean time. This will save unnecessary
traffic between jobs and WConfD.

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

Cherry-picked from cf12e5acbe9de19f931e142df7b702c981923c62

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

5 years agoAlways OutDate() the lu's config
Klaus Aehlig [Mon, 10 Nov 2014 12:09:48 +0000 (13:09 +0100)]
Always OutDate() the lu's config

For historic reasons, each job has two, potentially
different, configuration references: one of the processor
and one for the logical unit. When requesting locks,
make sure we also out date the configuration of the logical
unit. Note that out dating is cheap as it only sets a flag
in the configuration; the actual refetch only happens
on next read access.

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

Cherry-picked from 8303156e9d35317be0fbf68fe147b3148874408c
ignoring the OutDates related to the lock-level collation
that was only added in a later branch.

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

5 years agoOutdate the config when waiting for locks
Klaus Aehlig [Mon, 3 Nov 2014 15:06:05 +0000 (16:06 +0100)]
Outdate the config when waiting for locks

One of the reasons why jobs wait for locks is to avoid other
jobs modifying the same object. So, if we decide to wait for
locks, we cannot use our cached copy of the config any more.

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

Cherry-picked from 47dc24cbd3ef6e4480f35798f624fc5ac0d1d7b5

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

5 years agoSupport outdating a config
Klaus Aehlig [Mon, 3 Nov 2014 15:14:45 +0000 (16:14 +0100)]
Support outdating a config

The config reader has a cached copy of the configuration.
Support marking it as outdated. In that way, we will later
be able to restrict reads to the case if we don't have
an up-to-date copy.

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

Cherry-picked from 1ee7c1e2a31276113eee062b42cae54ccd4de578

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

5 years agoAllow unlocked reading of the config
Klaus Aehlig [Mon, 20 Oct 2014 11:15:11 +0000 (13:15 +0200)]
Allow unlocked reading of the config

As all writes to the config bring in all changes in an atomic
fashion, we can allow reading the configuration without owning
the ConfigLock.

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

Cherry-picked from 2fed2708535b009bceb117caccc5d7ec51efb9f8

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

5 years agoAlso in tests, open fake config before editing
Klaus Aehlig [Mon, 3 Nov 2014 18:33:52 +0000 (19:33 +0100)]
Also in tests, open fake config before editing

As our tests access the actual config object, the test
setup needs to follow the same protocol as for a real
configuration. We need to open it, before modifying,
even in the test setup. Note that the test setup is outside
the code to be tested, so should not acquire any locks
(hence we open the mock config in shared mode even though
we intend to modify it).

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

Cherry-picked from  90d03366fc1e4448958f7696a4abcc62082f5280

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

5 years agoFix a few haddock comments
Petr Pudlak [Thu, 5 Mar 2015 10:42:33 +0000 (11:42 +0100)]
Fix a few haddock comments

.. so that they're parsed correctly.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Wed, 4 Mar 2015 17:15:36 +0000 (18:15 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Remove unused import
  Use an old way to instance NFData CollectorData
  MonD: force computation of state in stateful collectors
  Instance NFData CollectorData

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 [Wed, 4 Mar 2015 16:00:37 +0000 (17:00 +0100)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Remove unused import

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

5 years agoRemove unused import
Klaus Aehlig [Wed, 4 Mar 2015 15:26:12 +0000 (16:26 +0100)]
Remove unused import

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 [Wed, 4 Mar 2015 14:48:47 +0000 (15:48 +0100)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Use an old way to instance NFData CollectorData
  MonD: force computation of state in stateful collectors
  Instance NFData CollectorData

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

5 years agoUse an old way to instance NFData CollectorData
Klaus Aehlig [Wed, 4 Mar 2015 10:04:45 +0000 (11:04 +0100)]
Use an old way to instance NFData CollectorData

...to make sure we can successfully build on platforms
with older versions of the containers library.

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

5 years agoMonD: force computation of state in stateful collectors
Klaus Aehlig [Tue, 3 Mar 2015 13:31:17 +0000 (14:31 +0100)]
MonD: force computation of state in stateful collectors

...to avoid stateful collectors that are not queried regularly
accumulating thunks.

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

5 years agoInstance NFData CollectorData
Klaus Aehlig [Tue, 3 Mar 2015 13:38:30 +0000 (14:38 +0100)]
Instance NFData CollectorData

...so that we can force the states of stateful collectors.
This is necessary to avoid thunks accumulating in unobserved
collectors.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Petr Pudlak [Tue, 3 Mar 2015 11:57:17 +0000 (12:57 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Relax expectation of accuracy
  Improve rounding accuracty in updateStatistics
  Update gnt-backup manual to reflect real behavior
  Finalize local export only if successful

* stable-2.9
  Stop MonD when removing a node from a cluster

Conflicts:
      man/gnt-backup.rst
      src/Ganeti/Utils.hs
      test/hs/Test/Ganeti/Utils.hs

Resolution: Propagate changes in 2.10 (also to the files that have been
moved in 2.12).

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Petr Pudlak [Tue, 3 Mar 2015 08:23:21 +0000 (09:23 +0100)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Relax expectation of accuracy
  Improve rounding accuracty in updateStatistics
  Update gnt-backup manual to reflect real behavior
  Finalize local export only if successful

* stable-2.9
  Stop MonD when removing a node from a cluster

Conflicts:
lib/backend.py - stop both daemons (Mond and KVMd)

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

5 years agoRelax expectation of accuracy
Klaus Aehlig [Mon, 2 Mar 2015 15:09:28 +0000 (16:09 +0100)]
Relax expectation of accuracy

When updating statistics to obtain new standard deviations,
rounding errors do happen. Testing for an accuracy of 1e-10
is still an order of magnitude better than our limit of 1e-9
for taking action.

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

5 years agoImprove rounding accuracty in updateStatistics
Klaus Aehlig [Mon, 2 Mar 2015 14:56:22 +0000 (15:56 +0100)]
Improve rounding accuracty in updateStatistics

Rearrange the arithmetic operations in statistics update
by avoiding small differences of large numbers.

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

5 years agoMerge branch 'stable-2.9' into stable-2.10
Petr Pudlak [Mon, 2 Mar 2015 16:00:57 +0000 (17:00 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Stop MonD when removing a node from a cluster

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

5 years agoStop MonD when removing a node from a cluster
Petr Pudlak [Thu, 26 Feb 2015 14:24:28 +0000 (15:24 +0100)]
Stop MonD when removing a node from a cluster

Currently if we remove a node from a cluster, or destroy a cluster, the
daemon is still running.

The non-master daemons are stopped in 'LeaveCluster', so add stopping
MonD there as well.

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

5 years agoUpdate gnt-backup manual to reflect real behavior
Hrvoje Ribicic [Thu, 12 Feb 2015 19:11:32 +0000 (19:11 +0000)]
Update gnt-backup manual to reflect real behavior

As the gnt-backup manual page still states incorrect information about
error codes stemming from 2010 and not reflecting changes of commit
44247302, this patch updates it.

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

5 years agoFinalize local export only if successful
Hrvoje Ribicic [Thu, 12 Feb 2015 17:34:47 +0000 (17:34 +0000)]
Finalize local export only if successful

Before commit 44247302, a failure in the transfer of a single disk
during an export was changed to make the entire transfer unsuccessful.
What did not change was an invocation of export finalization, which
removes the old backup if present and replaces it with whatever the
result of the transfer was. As a result, a failed backup of an instance
could destroy a previous backup.

This patch prevents the finalization from taking place - this leaves
some data lying around in a ".new" directory, but at least the old
backup is not deleted.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Tue, 17 Feb 2015 13:13:47 +0000 (14:13 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Fix haddock comment

* stable-2.9
  Fix file descriptor leak in Confd Client
  Fix hlint warnings found by hlint 1.9.11

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, 16 Feb 2015 16:25:45 +0000 (17:25 +0100)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Fix haddock comment

* stable-2.9
  Fix file descriptor leak in Confd Client
  Fix hlint warnings found by hlint 1.9.11

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

5 years agoFix haddock comment
Klaus Aehlig [Mon, 16 Feb 2015 13:44:07 +0000 (14:44 +0100)]
Fix haddock comment

In 2da679f, the CollectorData and CollectorMap types were
introduced. However, in the comment explaining those types,
the word "above" actually refered to a type introduced
later. Fix that.

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

5 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Mon, 16 Feb 2015 11:35:04 +0000 (12:35 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Fix file descriptor leak in Confd Client
  Fix hlint warnings found by hlint 1.9.11

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

5 years agoIncrease waiting time for WConfD
Klaus Aehlig [Fri, 13 Feb 2015 11:26:32 +0000 (12:26 +0100)]
Increase waiting time for WConfD

As the Ganeti 2.12 design allows for WConfD to be
restarted with jobs running, jobs accept WConfD not
be present and wait for to come back, retrying.
However, the time the jobs waited for WConfD to come
back was shorter than an actual restart might take.
So, increase it significantly and also back off with
the number of retries increasing to avoid flooding
WConfD after its restart.

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

5 years agoFix file descriptor leak in Confd Client
Klaus Aehlig [Thu, 12 Feb 2015 13:40:37 +0000 (14:40 +0100)]
Fix file descriptor leak in Confd Client

The queryOneServer function opens a UDP socket to connect
to the specified confd server. However, it would never
close it. Fix this and do so in a bracket construction
to make sure it also gets cleaned up in case of errors.

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

5 years agoFix hlint warnings found by hlint 1.9.11
Niklas Hambuechen [Fri, 7 Nov 2014 23:09:23 +0000 (00:09 +0100)]
Fix hlint warnings found by hlint 1.9.11

Our current hlint version cannot find them yet.

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

Cherry-picked-from: d05f1c86fcca10d2a52cfdcf538e8bfaf517f655

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

5 years agoConstruct lenses correctly for different 'lens' versions
Petr Pudlak [Tue, 10 Feb 2015 12:18:00 +0000 (13:18 +0100)]
Construct lenses correctly for different 'lens' versions

As the interface of the TH code for generating lenses changed twice in
4.*, we need to differentiate between versions accordingly.

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

5 years agoCreate a simple CPP macro for detecting lens versions
Petr Pudlak [Wed, 11 Feb 2015 12:45:37 +0000 (13:45 +0100)]
Create a simple CPP macro for detecting lens versions

.. in Haskell code.

This patch should be removed starting from 2.14, as there cabal
provides proper macros for all packages.

The macro in this patch is intentionally kept compatible with the cabal
macros.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Petr Pudlak [Thu, 12 Feb 2015 08:42:19 +0000 (09:42 +0100)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Also distribute devel/build_chroot
  Update ganeti download location
  Fix haddock comment

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Wed, 11 Feb 2015 13:44:49 +0000 (14:44 +0100)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Also distribute devel/build_chroot
  Update ganeti download location
  Fix haddock comment

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

5 years agoAlso distribute devel/build_chroot
Klaus Aehlig [Tue, 10 Feb 2015 15:49:59 +0000 (16:49 +0100)]
Also distribute devel/build_chroot

While not strictly necessary for using Ganeti, the distribution
tar ball is still supposed to be a complete for Ganeti development.

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

5 years agoUpdate ganeti download location
Klaus Aehlig [Tue, 10 Feb 2015 10:06:47 +0000 (11:06 +0100)]
Update ganeti download location

http://downloads.ganeti.org is now the primary location for
obtaining ganeti release tar balls.

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

5 years agoAllow LVM output parsing to work for thin volumes
Hrvoje Ribicic [Mon, 9 Feb 2015 17:23:55 +0000 (18:23 +0100)]
Allow LVM output parsing to work for thin volumes

This patch modifies the LVM output parsing code to allow for an empty
list of physical devices, as is the case with thin LVM volumes.

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

5 years agoFix haddock comment
Klaus Aehlig [Fri, 6 Feb 2015 11:19:36 +0000 (12:19 +0100)]
Fix haddock comment

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