ganeti-github.git
5 years agoMention manual creation of {shared,}file paths in UPGRADE
Helga Velroyen [Thu, 15 Oct 2015 14:11:33 +0000 (16:11 +0200)]
Mention manual creation of {shared,}file paths in UPGRADE

This fixes Issue 653. It was unclear whether or not
'ensure-dirs' creates the directories for file and
sharedfile storage. This patch extends the documentation
to clarify this.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Oleg Ponomarev <oponomarev@google.com>

5 years agoDon't warn about broken SSH setup of offline nodes
Helga Velroyen [Wed, 14 Oct 2015 08:24:33 +0000 (10:24 +0200)]
Don't warn about broken SSH setup of offline nodes

This fixes issue 1131. 'gnt-cluster verify' should stop
complaining about broken SSH setups of offline nodes.

Additionally, this fixes a problem when readding nodes.
In some cases, Ganeti complains about a possible attack,
which is a valid case for readding a node (if a key
renew took place between offlining and readding the node).

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Klaus Aehlig [Fri, 9 Oct 2015 09:04:28 +0000 (11:04 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  QA: Retrieve only the RAPI certificate
  QA: Allow usage of specific RAPI certificates and files
  QA: Reload certificates only when renew-crypto has been run
  QA: Restart Ganeti after adding the RAPI users file
  QA: Add reading the RAPI password from a file
  QA: Allow the RAPI user to be set
  QA: Do not remove nodes from cluster without destroying it
  QA: Refactor RAPI handling
  Increase default disk size of burnin to 1G
  break line with more than 80 characters
  Only search for Python-2 interpreters
  Fix faulty comments / indentation
  Handle Xen 4.3 states better

* stable-2.11
  (no changes)

* stable-2.10
  Add a test for parsing of admin_state in IAlloc backend
  At IAlloc backend guess state from admin state

* stable-2.9
  Update harep's man page to notify users of its limitations

Conflicts:
qa/qa_cluster.py: trivial
qa/rapi-workload.py: keep removed (see c0065e0fa1730a477)

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Klaus Aehlig [Thu, 8 Oct 2015 14:35:35 +0000 (16:35 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Add a test for parsing of admin_state in IAlloc backend
  At IAlloc backend guess state from admin state

* stable-2.9
  Update harep's man page to notify users of its limitations

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Thu, 8 Oct 2015 14:16:53 +0000 (16:16 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Add a test for parsing of admin_state in IAlloc backend
  At IAlloc backend guess state from admin state

* stable-2.9
  Update harep's man page to notify users of its limitations

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

5 years agoQA: Retrieve only the RAPI certificate
Hrvoje Ribicic [Sun, 27 Sep 2015 21:55:51 +0000 (21:55 +0000)]
QA: Retrieve only the RAPI certificate

The QA previously took in the entire certificate file, along with the
private key. As this is really not necessary, change it to be more
conservative.

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

5 years agoQA: Allow usage of specific RAPI certificates and files
Hrvoje Ribicic [Wed, 23 Sep 2015 14:38:50 +0000 (16:38 +0200)]
QA: Allow usage of specific RAPI certificates and files

In some situations, we want to make sure the QA runs with a certain set
of certificates, secrets, users, and the like. This patch allows the QA
to look for a directory on the master node where all of these can be
found, and transplant them into the right place. This allow cluster
creation, renew-crypto, or any other cert-affecting operation to be
tested while preserving RAPI access.

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

5 years agoQA: Reload certificates only when renew-crypto has been run
Hrvoje Ribicic [Thu, 24 Sep 2015 10:36:31 +0000 (12:36 +0200)]
QA: Reload certificates only when renew-crypto has been run

When the cluster refreshes the RAPI certificate as it does in the
renew-crypto test, the stored certificate in the curl config of the
RAPI client has to be renewed. But it should only be renewed when the
test is enabled, so this patch moves that code into the test.

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

5 years agoQA: Restart Ganeti after adding the RAPI users file
Hrvoje Ribicic [Thu, 24 Sep 2015 21:20:30 +0000 (23:20 +0200)]
QA: Restart Ganeti after adding the RAPI users file

... otherwise we have no guarantee that the RAPI daemon will pick up
the change.

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

5 years agoQA: Add reading the RAPI password from a file
Hrvoje Ribicic [Tue, 22 Sep 2015 17:14:50 +0000 (19:14 +0200)]
QA: Add reading the RAPI password from a file

For situations where we're running the QA against a cluster which uses
a hashed password for access, it can be useful to be able to read the
password from a local file. This patch allows this to happen, throwing
in a few refactorings along the way.

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

5 years agoQA: Allow the RAPI user to be set
Hrvoje Ribicic [Tue, 22 Sep 2015 17:09:06 +0000 (19:09 +0200)]
QA: Allow the RAPI user to be set

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

5 years agoQA: Do not remove nodes from cluster without destroying it
Hrvoje Ribicic [Tue, 22 Sep 2015 15:20:46 +0000 (17:20 +0200)]
QA: Do not remove nodes from cluster without destroying it

The Ganeti QA can be set up to optionally both create and destroy a
cluster during its runtime. Before this patch, the QA removed all the
nodes barring the master one at the end of a QA, regardless of whether
the cluster was supposed to be disassembled. This patch fixes this
behaviour and lets created clusters remain in place after a QA.

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

5 years agoQA: Refactor RAPI handling
Hrvoje Ribicic [Tue, 7 Jul 2015 00:49:23 +0000 (00:49 +0000)]
QA: Refactor RAPI handling

Since the QA RAPI code already uses the horror of global variables to
save the username and password within the qa_rapi module, the code can
be refactored to make the storage of these values outside the module
unnecessary. This encapsulates the RAPI functionality better, and will
allow for easier refactoring in later commits.

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

5 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Thu, 8 Oct 2015 13:27:59 +0000 (15:27 +0200)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Update harep's man page to notify users of its limitations

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

5 years agoAdd a test for parsing of admin_state in IAlloc backend
Klaus Aehlig [Mon, 5 Oct 2015 14:34:23 +0000 (16:34 +0200)]
Add a test for parsing of admin_state in IAlloc backend

The administrative state of an instance is reported in the
IAllocator interface. Test whether that correctly propagates
to the parsed cluster state.

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

5 years agoAt IAlloc backend guess state from admin state
Klaus Aehlig [Mon, 5 Oct 2015 14:55:27 +0000 (16:55 +0200)]
At IAlloc backend guess state from admin state

At the IAlloc backend of htools we do not get the actual
state of the instance (as everything is state-of-record only).
However, we do get the administrative state. Therefore, by
assuming that for each instance the actual state is the one
corresponding to the administrated one, we can get a much better
description of the cluster than blindly assuming all instances
are running. Do so, whenever the admin_state is provided.

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

5 years agoUpdate harep's man page to notify users of its limitations
Petr Pudlak [Tue, 29 Sep 2015 12:04:11 +0000 (14:04 +0200)]
Update harep's man page to notify users of its limitations

In particular that it works only for 'drbd' and 'plain', and that it
doesn't perform hardware failure detection, which are both common user
expectations.

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

5 years agoIncrease default disk size of burnin to 1G
BSRK Aditya [Thu, 24 Sep 2015 12:14:45 +0000 (14:14 +0200)]
Increase default disk size of burnin to 1G

The previous default value causes burnin to fail at instance
creation as the disk size was too low.

Signed-off-by: BSRK Aditya <bsrk@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

5 years agobreak line with more than 80 characters
Klaus Aehlig [Mon, 21 Sep 2015 11:41:25 +0000 (13:41 +0200)]
break line with more than 80 characters

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

5 years agoOnly search for Python-2 interpreters
Klaus Aehlig [Mon, 21 Sep 2015 08:39:19 +0000 (10:39 +0200)]
Only search for Python-2 interpreters

Ganeti is not yet ready for Python 3. Therefore, at configure-time,
we effectively have two constraints for the version of Python to
use: ">=2.6" and "<3.0". As, unfortunuately, the AM_PYTHON_PATH
macro only supports minimal-version constraints, we afterwards verify
that we got an interpreter for Python 2. We also tune the search
heuristics to first check binaries that most likely are interpreters
for Python 2. To also work with older versions of the autotools, we
do the "<3.0" check manually and no rely on it already being supported
in the AM_PYTHON_CHECK_VERSION macro.

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

5 years agoFix faulty comments / indentation
Hrvoje Ribicic [Wed, 16 Sep 2015 13:23:59 +0000 (15:23 +0200)]
Fix faulty comments / indentation

As a part of patch 6b16d04a318d33a59, some errors were inadvertently
introduced by adding documentation. This patch fixes them.

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

5 years agoHandle Xen 4.3 states better
Hrvoje Ribicic [Tue, 15 Sep 2015 08:37:11 +0000 (10:37 +0200)]
Handle Xen 4.3 states better

In Xen commit e1475a6693aac8cddc4bdd456548aa05a625556b, the output from
xl list was extended to provide a reason for shutdowns. This breaks
our somewhat strict parsing of the output in certain situations where
the new states appear (e.g. the short suspension during a migration, or
an instance reboot).

This patch makes sure the new states (barring the mysterious watchdog
state) are handled correctly.

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

5 years agoImprove xl socat migrations
Hrvoje Ribicic [Thu, 10 Sep 2015 12:12:24 +0000 (12:12 +0000)]
Improve xl socat migrations

Improve their reliability by allowing socat to reuse an address,
preventing errors if migrations are executed with too narrow a
timespan.

Improve performance by choosing a better blocksize than the default 8k.

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

5 years agoFix typo in example
Klaus Aehlig [Fri, 4 Sep 2015 09:59:39 +0000 (11:59 +0200)]
Fix typo in example

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Hrvoje Ribicic [Thu, 3 Sep 2015 15:59:42 +0000 (17:59 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Add forgotten IPOLICY_SPINDLE_RATIO to __all__ variable
  Make QA turn on user-shutdown when testing it
  Fix disabling of user shutdown reporting
  Make confd answer disk requests querying by name
  gnt-node add: password auth is only one method

* stable-2.11
  (no changes)

* stable-2.10
  (no changes)

* stable-2.9
  Document quoting of special values in key-value parameters
  replace-disks: fix --ignore-ipolicy

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Hrvoje Ribicic [Thu, 3 Sep 2015 12:39:26 +0000 (14:39 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  (no changes)

* stable-2.9
  Document quoting of special values in key-value parameters
  replace-disks: fix --ignore-ipolicy

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Hrvoje Ribicic [Thu, 3 Sep 2015 12:10:34 +0000 (14:10 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  (no changes)

* stable-2.9
  Document quoting of special values in key-value parameters
  replace-disks: fix --ignore-ipolicy

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

5 years agoMerge branch 'stable-2.9' into stable-2.10
Hrvoje Ribicic [Thu, 3 Sep 2015 11:22:54 +0000 (13:22 +0200)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Document quoting of special values in key-value parameters
  replace-disks: fix --ignore-ipolicy

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

5 years agoAdd forgotten IPOLICY_SPINDLE_RATIO to __all__ variable
Oleg Ponomarev [Thu, 3 Sep 2015 09:08:49 +0000 (11:08 +0200)]
Add forgotten IPOLICY_SPINDLE_RATIO to __all__ variable

Signed-off-by: Oleg Ponomarev <oponomarev@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoDocument quoting of special values in key-value parameters
Klaus Aehlig [Tue, 1 Sep 2015 13:23:41 +0000 (15:23 +0200)]
Document quoting of special values in key-value parameters

Since the early days of Ganeti, it is possible to pass in key-value
parameters also some special non-string values (the two boolean values
True and False and the special value None). However, the syntax for
entering them was never properly documented confusing people who had
to pass one of those values. So document it now.

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

5 years agoreplace-disks: fix --ignore-ipolicy
Apollon Oikonomopoulos [Mon, 31 Aug 2015 14:20:36 +0000 (17:20 +0300)]
replace-disks: fix --ignore-ipolicy

CheckTargetNodeIPolicy was expecting an LU, but got a Tasklet instead.
This caused gnt-instance replace-disks --ignore-ipolicy to fail with a
"'TLReplaceDisks' object has no attribute 'LogWarning'" message in the
presence policy-related warnings. We fix this by passing the calling LU
to CheckTargetNodeIPolicy.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoUpdate documentation of --print-jobid
Helga Velroyen [Thu, 27 Aug 2015 11:41:08 +0000 (13:41 +0200)]
Update documentation of --print-jobid

This fixes issue 915. In the man pages, the option
'--print-jobid' was accidentally documented as
'--print-job-id'. This fixes all occurrences.

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

5 years agoMake QA turn on user-shutdown when testing it
Hrvoje Ribicic [Wed, 19 Aug 2015 21:35:22 +0000 (23:35 +0200)]
Make QA turn on user-shutdown when testing it

Commit fe6287b4 made the --user-shutdown switch meaningful for Xen,
preventing USER_DOWN reporting if disabled. The QA turned this switch
on for KVM, where it is needed to start the specialized daemon, but
not for Xen. This patch fixes the discrepancy.

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

5 years agoFix disabling of user shutdown reporting
Hrvoje Ribicic [Mon, 17 Aug 2015 18:24:24 +0000 (18:24 +0000)]
Fix disabling of user shutdown reporting

Unlike the Python-side query logic still used for more detailed
queries, the Haskell queries neglected to take into account the
user-shutdown cluster-level parameter, turning USER_DOWN reporting on
by default. This is especially bad considering that this parameter was
introduced to give time to users to adapt their automation to take the
new statuses into account. This patch makes the parameter usable,
albeit possibly too late.

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

5 years agoMake confd answer disk requests querying by name
Hrvoje Ribicic [Tue, 18 Aug 2015 14:35:21 +0000 (14:35 +0000)]
Make confd answer disk requests querying by name

As a result of an additional bit of code introduced by patch fa3c0df5,
queries for instance disks sent to the configuration daemon required
additional information about the instance. This information was fetched
through a manual search of the list of instances, rather than the
function capable of searching by name or by uuid.

This made the burnin tool used by our tests fail when inquiring for
information and broke QA, and this patch fixes the problem.

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

5 years agognt-node add: password auth is only one method
Klaus Aehlig [Tue, 11 Aug 2015 07:41:38 +0000 (09:41 +0200)]
gnt-node add: password auth is only one method

The man page for gnt-node add is slightly misleading.
In can be read to mean that we insist on password
authentication for root on the target node. However,
the only point the man page is trying to make here
is that credentials have to be provided to allow to
ssh as root to the target node; password is only of
the many options. Fix the wording accordingly.

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Petr Pudlak [Fri, 7 Aug 2015 16:49:51 +0000 (18:49 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Accept allocation of 0 jobs
  Return multiple fields multiple times
  In queries collect all needed data
  Add a function computing the filter arguments
  Utils: Add ordNub
  Accept timeout errors are luxi down

Conflicts:
      src/Ganeti/Query/Query.hs - use the 2.12 version, just renaming
        evaluateFilter to evaluateQueryFilter
      src/Ganeti/Utils.hs - keep 2.13 version (from which ordBy has been
        cherry picked)

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

5 years agoAccept allocation of 0 jobs
Klaus Aehlig [Fri, 7 Aug 2015 15:57:34 +0000 (17:57 +0200)]
Accept allocation of 0 jobs

However, short-cut them and return the empty list
directly, as we do not need to do any change to the
serial file.

Note that allocating 0 jobs has legitimate use cases,
like gnt-node migrate on an empty node. Doing so
without complaining in line with the behaviour of
earlier Ganeti versions.

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

5 years agoReturn multiple fields multiple times
Klaus Aehlig [Tue, 4 Aug 2015 16:03:03 +0000 (18:03 +0200)]
Return multiple fields multiple times

While it is not very useful, our specification still says
that we should return the values for fields requested multiple
times also multiple times. Commit 237a43b added fetching of
fields not requested but needed to evaluate the filter; to
avoid overhead the list of fields was deduplicated, thereby
breaking the said property. Restore it by only deduplicating
and filtering the additional fields.

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

5 years agoIn queries collect all needed data
Klaus Aehlig [Tue, 4 Aug 2015 13:19:01 +0000 (15:19 +0200)]
In queries collect all needed data

Queries are affected by two forms of fields:
- those the user wishes to see, and
- those needed to evaluate the filter provided.
For internal handling, we do have to fetch the
fields of either category to avoid wrong results,
even if we only output fields of the first category.
Ensure this fetch.

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

5 years agoAdd a function computing the filter arguments
Klaus Aehlig [Tue, 4 Aug 2015 13:03:31 +0000 (15:03 +0200)]
Add a function computing the filter arguments

When collecting live data for queries, we need to also
collect the fields the filter talks about, not only the
fields the user wants to see. Therefore, we need a function
computing those fields.

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

5 years agoUtils: Add ordNub
Niklas Hambuechen [Fri, 1 Aug 2014 15:27:11 +0000 (17:27 +0200)]
Utils: Add ordNub

For n*log(n) duplicate removal (as opposed to nub's n^2).

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

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Lisa Velden [Mon, 3 Aug 2015 11:45:42 +0000 (13:45 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Correct indendation
  In confd provide proper serial number

* stable-2.11
  (no changes)

* stable-2.10
  Add a new unit test for LUInstanceMultiAlloc
  Fix a bug in LUInstanceMultiAlloc LU

Conflicts:
      lib/bootstrap.py

Resolution:
        lib/bootstrap.py: take indendation from stable-2.12

Semantical conflicts:
        src/Ganeti/Confd/Server.hs: add serial number to new queries

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

5 years agoAccept timeout errors are luxi down
Klaus Aehlig [Mon, 3 Aug 2015 11:29:42 +0000 (13:29 +0200)]
Accept timeout errors are luxi down

With the extended retry-logic connecting to luxid, an absence
of luxid can also be perceived as a TimeoutError. Therefore,
also for this error, make the watcher try to restart the luxi
daemon.

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

5 years agoCorrect indendation
Lisa Velden [Mon, 3 Aug 2015 08:43:59 +0000 (10:43 +0200)]
Correct indendation

to satisfy pylint.

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

5 years agoMerge branch 'stable-2.11' into stable-2.12
Lisa Velden [Mon, 3 Aug 2015 07:00:43 +0000 (09:00 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Add a new unit test for LUInstanceMultiAlloc
  Fix a bug in LUInstanceMultiAlloc LU

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

5 years agoIn confd provide proper serial number
Klaus Aehlig [Fri, 31 Jul 2015 12:46:34 +0000 (14:46 +0200)]
In confd provide proper serial number

The confd protocol heavily relies on the serial number
to filter out outdated responses. However, the current
implementation always returned 0 as serial number. Fix
this and return a serial number that is bumped with every
change that affects the answer.

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
Lisa Velden [Fri, 31 Jul 2015 08:22:01 +0000 (10:22 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Add a new unit test for LUInstanceMultiAlloc
  Fix a bug in LUInstanceMultiAlloc LU

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

5 years agoAdd a new unit test for LUInstanceMultiAlloc
Dimitris Bliablias [Wed, 29 Jul 2015 11:21:12 +0000 (14:21 +0300)]
Add a new unit test for LUInstanceMultiAlloc

This patch, extends the 'cmdlib.instance_unittest.py' with a new test
for instances multi allocations, in order to test an allocation of more
than one instances.

Signed-off-by: Dimitris Bliablias <dblia@skroutz.gr>
Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Lisa Velden <velden@google.com>

5 years agoFix a bug in LUInstanceMultiAlloc LU
Dimitris Bliablias [Wed, 29 Jul 2015 11:21:11 +0000 (14:21 +0300)]
Fix a bug in LUInstanceMultiAlloc LU

As of commit 804d72eb, some modifications on the LUInstanceMultiAlloc LU
resulted in breaking the instances multi allocation functionality.

In details, when using an iallocator for the instances allocation, the
'jobs' list is computed for allocations using the DRBD disk template
only and not for the rest templates, due to the wrong indentation of the
relevant code line. Furthermore, for the same reason, the allocation of
more than one instances always fails since the 'missing' set is not
computed after the processing of all the allocatable instances, as it
should do, but at the end of each instance iteration.

Signed-off-by: Dimitris Bliablias <dblia@skroutz.gr>
Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Lisa Velden <velden@google.com>

5 years agoMerge branch 'stable-2.12' into stable-2.13
Klaus Aehlig [Fri, 24 Jul 2015 11:01:53 +0000 (13:01 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Also provide default arguments for mond
  Support sphinx 1.3
  Make documentation for -H serial_console more explicit

* stable-2.11
  (no changes)

* stable-2.10
  Fix typo in secondary
  When hinting to do gnt-instance info, show the instance
  Update gnt-network example in admin page

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

5 years agoAlso provide default arguments for mond
Klaus Aehlig [Fri, 24 Jul 2015 10:38:41 +0000 (12:38 +0200)]
Also provide default arguments for mond

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 [Fri, 24 Jul 2015 09:17:09 +0000 (11:17 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Fix typo in secondary
  When hinting to do gnt-instance info, show the instance
  Update gnt-network example in admin page

Conflicts:
lib/cmdlib/instance_storage.py: trivial

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

5 years agoMerge branch 'stable-2.10' into stable-2.11
Klaus Aehlig [Thu, 23 Jul 2015 17:22:39 +0000 (19:22 +0200)]
Merge branch 'stable-2.10' into stable-2.11

* stable-2.10
  Fix typo in secondary
  When hinting to do gnt-instance info, show the instance
  Update gnt-network example in admin page

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

5 years agoFix typo in secondary
Thomas Vander Stichele [Tue, 21 Jul 2015 08:33:50 +0000 (10:33 +0200)]
Fix typo in secondary

Signed-off-by: Thomas Vander Stichele <thomasvs@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoWhen hinting to do gnt-instance info, show the instance
Thomas Vander Stichele [Mon, 20 Jul 2015 20:24:59 +0000 (16:24 -0400)]
When hinting to do gnt-instance info, show the instance

Signed-off-by: Thomas Vander Stichele <thomasvs@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoAdd ``--no-ssh-key-check`` to manpage of renew-crypto
Helga Velroyen [Wed, 22 Jul 2015 09:23:40 +0000 (11:23 +0200)]
Add ``--no-ssh-key-check`` to manpage of renew-crypto

The option was implemented a while ago, but was missing
in the man page of gnt-cluster renew-crypto so far.

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

5 years agoUpdate gnt-network example in admin page
Klaus Aehlig [Thu, 23 Jul 2015 10:38:14 +0000 (12:38 +0200)]
Update gnt-network example in admin page

Commit 2243b133 changed the syntax of the gnt-network command.
Mode and link are no longer passed as positional arguments, but
instead as named parameters in the --nic-parameters option.
However, the example in the admin page was not updated. Do this
now.

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

5 years agoSupport sphinx 1.3
Klaus Aehlig [Tue, 21 Jul 2015 10:46:57 +0000 (12:46 +0200)]
Support sphinx 1.3

First, enable_manpages is now required to be a bool; fortunately,
we set it via the environment in conf.py anyway, so no need to
pass it as an option as well. Also, the default template has been
renamed to classic; so branch on the sphinx version to choose the
correct name. Fixes issue #1119.

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

5 years agoMake documentation for -H serial_console more explicit
Lisa Velden [Tue, 21 Jul 2015 12:34:42 +0000 (14:34 +0200)]
Make documentation for -H serial_console more explicit

Mention that apart from enabling the emulation of a serial port in KVM
"console=ttyS0,<serial_speed>" is appended to the end of kernel_args.

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

5 years agoRedistribute master key on downgrade
Helga Velroyen [Fri, 17 Jul 2015 13:03:43 +0000 (15:03 +0200)]
Redistribute master key on downgrade

When downgrading from 2.13 to 2.12, the SSH key pair of
each node needs to be replaced by the master's SSH key
pair. If that is not done, any node added after the
downgrade will not be reachable if the master is failed
over to one of the original non-master nodes.

This patch fixes Issue 1008. However, what is not cleaned
up is the nodes' authorized_keys file. This will need
significantly more effort, but this patch at least fixes
the user-impacting issue.

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

5 years agoUse ssconf port map when handling SSH keys
Helga Velroyen [Fri, 17 Jul 2015 07:53:19 +0000 (09:53 +0200)]
Use ssconf port map when handling SSH keys

Recently, the SSH port information was added to ssconf
file. This patch makes use of it when adding, removing,
or renewing SSH keys. The main benefit of it is to reduce
the signature of the backend functions and thus the RPC
load.

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

5 years agoMake node_daemon_setup use common functions
Helga Velroyen [Fri, 17 Jul 2015 07:44:12 +0000 (09:44 +0200)]
Make node_daemon_setup use common functions

This patch makes the node_daemon_setup tool use some of
the recently introduced functions in the tools/common.py.
By doing that, this also cleans up the correct usage of
cluster name constants.

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

5 years agoAdd docstring to certificate verification
Helga Velroyen [Fri, 17 Jul 2015 07:35:40 +0000 (09:35 +0200)]
Add docstring to certificate verification

This adds a bit of documentation to one of the
certificate verification methods to distinguish
them better. This got only apparent after the
merge of 2.12 to 2.13.

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

5 years agoNEWS: move 2.13.0 beta/rc to their place
Klaus Aehlig [Thu, 16 Jul 2015 09:24:31 +0000 (11:24 +0200)]
NEWS: move 2.13.0 beta/rc to their place

Apparently during merges in the past, the NEWS entries
for 2.13.0 rc1 and 2.13.0 beta1 ended up between the entries
for 2.12.4 and 2.12.3. Move them to their rightful place now.

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Klaus Aehlig [Thu, 16 Jul 2015 09:07:44 +0000 (11:07 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Bugfix in checkInstanceMove function in Cluster.hs
  Revision bump for 2.12.5
  Update the NEWS file for 2.12.5
  Update Xen documentation in install.rst
  Clarify need for the migration_port Xen param

Conflicts:
NEWS: take both new entries
configure.ac: keep version and revision of stable-2.13

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

5 years agoBugfix in checkInstanceMove function in Cluster.hs
Oleg Ponomarev [Wed, 15 Jul 2015 17:46:14 +0000 (20:46 +0300)]
Bugfix in checkInstanceMove function in Cluster.hs

checkInstanceMove function tries all possible moves of single instance
in order to found an optimal move. When option --no-disk-moves is
enabled, current implementation tries only Failover move while
FailoverToAny is a suitable move too. This patch fixes the bug.

Signed-off-by: Oleg Ponomarev <onponomarev@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

5 years agoDocument data collector options
Klaus Aehlig [Mon, 13 Jul 2015 15:33:32 +0000 (17:33 +0200)]
Document data collector options

The options --enabled-data-collectors and --data-collector-interval have
been added to gnt-cluster modify quite a while ago on stable-2.13. However
they have never been documented in the man page. Do so now.

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

5 years agoRevision bump for 2.12.5 v2.12.5
Petr Pudlak [Mon, 13 Jul 2015 14:02:16 +0000 (16:02 +0200)]
Revision bump for 2.12.5

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

5 years agoUpdate the NEWS file for 2.12.5
Petr Pudlak [Mon, 13 Jul 2015 14:00:57 +0000 (16:00 +0200)]
Update the NEWS file for 2.12.5

... mentioning all the changes.

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

5 years agoCorrect NEWS file entry
Hrvoje Ribicic [Mon, 13 Jul 2015 13:22:49 +0000 (15:22 +0200)]
Correct NEWS file entry

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

5 years agoUpdate Xen documentation in install.rst
Hrvoje Ribicic [Mon, 13 Jul 2015 10:14:50 +0000 (10:14 +0000)]
Update Xen documentation in install.rst

The Xen documentation in install.rst was out of date, describing
xm-specific changes at the point where 2.12 is mostly used with xl.
This patch removes xm-specific migration steps, references the official
Xen wiki instead of replicating information from it, removes the
VNC setup settings that are outdated for xl and probably for xm, and
slightly rewrites the documentation.

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

5 years agoClarify need for the migration_port Xen param
Hrvoje Ribicic [Mon, 13 Jul 2015 10:14:17 +0000 (10:14 +0000)]
Clarify need for the migration_port Xen param

... depending on which toolstack is used.

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

5 years agoRevision bump for 2.13.2 v2.13.2
Hrvoje Ribicic [Mon, 13 Jul 2015 11:30:41 +0000 (11:30 +0000)]
Revision bump for 2.13.2

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

5 years agoUpdate the NEWS file for 2.13.2
Hrvoje Ribicic [Mon, 13 Jul 2015 11:30:10 +0000 (11:30 +0000)]
Update the NEWS file for 2.13.2

... mentioning all the changes.

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Klaus Aehlig [Wed, 8 Jul 2015 16:09:30 +0000 (18:09 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Tell git to ignore tools/ssl-update
  Use 'exclude_daemons' option for master only
  Disable superfluous restarting of daemons
  Add tests exercising the "crashed" state handling
  Add proper handling of the "crashed" Xen state

* stable-2.11
  Fix capitalization of TestCase
  Trigger renew-crypto on downgrade to 2.11

Conflicts:
.gitignore: use all additions

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

5 years agoProperly get rid of all watcher jobs
Klaus Aehlig [Wed, 8 Jul 2015 15:28:44 +0000 (17:28 +0200)]
Properly get rid of all watcher jobs

Our tests running via RunWithLocks strictly depend on no
watcher jobs interfering. Therefore they pause the watcher;
unfortunately, there still is a race: the watcher only checks
the pause status upon its invocation, but submits jobs later
in its run time. Therefore not only pause it (doesn't hurt),
but also add a filter to reject all its jobs, and then wait
for all running jobs to terminate.

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

5 years agoMove stdout_of to qa_utils
Klaus Aehlig [Wed, 8 Jul 2015 15:28:43 +0000 (17:28 +0200)]
Move stdout_of to qa_utils

...so that it can be used outside the filter test as well.

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
Klaus Aehlig [Wed, 8 Jul 2015 15:36:24 +0000 (17:36 +0200)]
Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  Fix capitalization of TestCase
  Trigger renew-crypto on downgrade to 2.11

Conflicts:
tools/post-upgrade: use 2.12 condition on when to run the hook

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

5 years agoTell git to ignore tools/ssl-update
Klaus Aehlig [Wed, 8 Jul 2015 14:38:32 +0000 (16:38 +0200)]
Tell git to ignore tools/ssl-update

This tools was recently added, but not added to .gitignore. Do
so now.

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

5 years agoUse 'exclude_daemons' option for master only
Helga Velroyen [Thu, 2 Jul 2015 13:07:12 +0000 (15:07 +0200)]
Use 'exclude_daemons' option for master only

During 'gnt-cluster renew-crypto --new-cluster-certificate'
or '... --new-node-certficates' all daemons are shutdown,
except for wconfd and noded. So far, noded was not shutdown
on all nodes, although it is only necessary on the master.
This patch makes sure that the 'exclude_daemons' flag only
applies to the master, as all interesting operations will
only need them there.

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

5 years agoDisable superfluous restarting of daemons
Helga Velroyen [Thu, 2 Jul 2015 12:42:20 +0000 (14:42 +0200)]
Disable superfluous restarting of daemons

This patch fixes a little glitch where the Ganeti
daemons were stopped and started unnecessarily if
only the cluster certficate was renewed but nothing
else.

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

5 years agoAdd tests exercising the "crashed" state handling
Hrvoje Ribicic [Mon, 6 Jul 2015 17:23:31 +0000 (17:23 +0000)]
Add tests exercising the "crashed" state handling

This patch adds a few tests that make sure the state is handled
properly, using examples taken from a running cluster.

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

5 years agoAdd proper handling of the "crashed" Xen state
Hrvoje Ribicic [Mon, 6 Jul 2015 17:17:41 +0000 (17:17 +0000)]
Add proper handling of the "crashed" Xen state

Whenever an instance would enter the crashed state due to kernel issues
or other horrible problems, Ganeti would not be able to interpret the
data and would report strange and incomprehensible errors. This patch
fixes this by adding proper handling for the "crashed" state.

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

5 years agoMerge branch 'stable-2.12' into stable-2.13
Helga Velroyen [Tue, 7 Jul 2015 09:52:47 +0000 (11:52 +0200)]
Merge branch 'stable-2.12' into stable-2.13

* stable-2.12
  Handle SSL setup when downgrading
  Write SSH ports to ssconf files
  Noded: Consider certificate chain in callback
  Cluster-keys-replacement: update documentation
  Backend: Use timestamp as serial no for server cert
  UPGRADE: add note about 2.12.5
  NEWS: Mention issue 1094
  man: mention changes in renew-crypto
  Verify: warn about self-signed client certs
  Bootstrap: validate SSL setup before starting noded
  Clean up configuration of curl request
  Renew-crypto: remove superflous copying of node certs
  Renew-crypto: propagate verbose and debug option
  Noded: log the certificate and digest on noded startup
  QA: reload rapi cert after renew crypto
  Prepare-node-join: use common functions
  Renew-crypto: remove dead code
  Init: add master client certificate to configuration
  Renew-crypto: rebuild digest map of all nodes
  Noded: make "bootstrap" a constant
  node-daemon-setup: generate client certificate
  tools: Move (Re)GenerateClientCert to common
  Renew cluster and client certificates together
  Init: create the master's client cert in bootstrap
  Renew client certs using ssl_update tool
  Run functions while (some) daemons are stopped
  Back up old client.pem files
  Introduce ssl_update tool
  x509 function for creating signed certs
  Add tools/common.py from 2.13
  Consider ECDSA in SSH setup
  Update documentation of watcher and RAPI daemon
  Watcher: add option for setting RAPI IP
  When connecting to Metad fails, log the full stack trace
  Set up the Metad client with allow_non_master
  Set up the configuration client properly on non-masters
  Add the 'allow_non_master' option to the WConfd RPC client
  Add the option to disable master checks to the RPC client
  Add 'allow_non_master' to the Luxi test transport class too
  Add 'allow_non_master' to FdTransport for compatibility
  Properly document all constructor arguments of Transport
  Allow the Transport class to be used for non-master nodes
  Don't define the set of all daemons twice

Conflicts:
  Makefile.am
  NEWS
  UPGRADE
  lib/client/gnt_cluster.py
  lib/cmdlib/cluster.py
  lib/tools/common.py
  lib/tools/prepare_node_join.py
  lib/watcher/__init__.py
  man/ganeti-watcher.rst
  src/Ganeti/OpCodes.hs
  test/hs/Test/Ganeti/OpCodes.hs
  test/py/cmdlib/cluster_unittest.py
  test/py/ganeti.tools.prepare_node_join_unittest.py
  tools/cfgupgrade

Resolutions:
  Makefile.am:
    add ssl_update and ssh_update
  NEWS:
    add new sections from 2.12 and 2.13
  UPGRADE:
    add notes for both 2.12 and 2.13
  lib/client/gnt_cluster.py:
    add all new options to RenewCluster, remove version-specific
    downgrade code
  lib/tools/common.py:
    split the two mismatching versions of _VerifyCertificate
    and VerifyCertificate up into [_]VerifyCertifcate{Soft,Strong}
    and update usages accordingly
  lib/tools/prepare_node_join.py
    update usage of correct VerifyCertificate function
  lib/watcher/__init__.py
    add both new options, --rapi-ip and --no-verify-disks
  man/ganeti-watcher.rst
    update docs for both new options (see above)
  src/Ganeti/OpCodes.hs
    add all new options to OpRenewCrypto
  test/hs/Test/Ganeti/OpCodes.hs
    add enough 'arbitrary' for all new options of OpRenewCrypto
  test/py/cmdlib/cluster_unittest.py
    use changes from 2.12
  test/py/ganeti.tools.prepare_node_join_unittest.py
    remove tests that were moved to common_unittest.py
  tools/cfgupgrade
    use only downgrade code of 2.13

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

5 years agoDescribe --no-verify-disks option in watcher man page
Klaus Aehlig [Mon, 6 Jul 2015 10:54:46 +0000 (12:54 +0200)]
Describe --no-verify-disks option in watcher man page

While there, also mention that it does more than checking
for rebooted nodes.

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

5 years agoMake disk verification optional
Klaus Aehlig [Mon, 6 Jul 2015 10:35:17 +0000 (12:35 +0200)]
Make disk verification optional

In some setups, verification of disks can take a long
time, whereas it is still desirable to run the other
watcher operations more regularly. Hence support this
use case by providing an option to not run disk verification,
allowing for more elaborate cron schedules. Fixes issue 1090.

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

5 years agoHandle SSL setup when downgrading
Helga Velroyen [Wed, 1 Jul 2015 08:45:02 +0000 (10:45 +0200)]
Handle SSL setup when downgrading

This patch will handle the downgrade of the SSL setup
from 2.12 to 2.11. Essentially, all client.pem and
ssconf_master_candidates_certs files will be deleted.
This will kick the cluster in a pre-2.11 mode wrt to
SSL and result in a nagging message to re-run
'gnt-cluster renew-crypto' when as output of 'gnt-cluster
verify'.

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

5 years agoWrite SSH ports to ssconf files
Helga Velroyen [Tue, 30 Jun 2015 08:48:11 +0000 (10:48 +0200)]
Write SSH ports to ssconf files

For the downgrading of the SSL setup from 2.12 to 2.11, we
need to be able to SSH into machines while no daemons are
running. Unfortunately currently the only way to obtain
custom-configured SSH ports is by queries. In order to
access this information with daemons being shutdown, this
patch adds the SSH port information to an ssconf file.

This will also be used to simplify some backend calls for
the *SSH* handling in 2.13.

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

5 years agoNoded: Consider certificate chain in callback
Helga Velroyen [Wed, 24 Jun 2015 12:19:17 +0000 (14:19 +0200)]
Noded: Consider certificate chain in callback

This patch significantly changes the callback that is
called upon receiving an incoming SSL connection. Since
this callback is called not only with the certificate
that the client sends, but also (in some implementations)
with the entire certificate chain of the client
certificate.

In our case, the certficate chain contains
the client certificate and the server certificate as
the one that signed the client certificate. This means
that we have to accept the server certificate, but only
if we receive it with the 'depth' greater than 0, meaning
that this is part of the chain and not the actual
certificate. If the depth value is 0, we can be sure
to have received the actual certficate and match it
against the list of master candidate certificates as
before.

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

5 years agoCluster-keys-replacement: update documentation
Helga Velroyen [Wed, 24 Jun 2015 12:03:03 +0000 (14:03 +0200)]
Cluster-keys-replacement: update documentation

This patch updates the cluster-keys-replacement document
which assists user about how to replace the crypto keys
for their cluster. This now reflects the changes wrt
server/client certificates.

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

5 years agoBackend: Use timestamp as serial no for server cert
Helga Velroyen [Wed, 24 Jun 2015 11:27:30 +0000 (13:27 +0200)]
Backend: Use timestamp as serial no for server cert

So far, all of Ganeti's server certificates had the serial
number '1'. While this works, it makes it hard to
distinguish situations where the certificate is
renewed from those where it wasn't. This patch uses
a timestamp as serial number.

While this is still not stricly according to the SSL RFC,
it is at least a number that is stricly growing and we
can be sure that no two different server certificates
will have the same serial number.

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

5 years agoUPGRADE: add note about 2.12.5
Helga Velroyen [Wed, 24 Jun 2015 11:22:02 +0000 (13:22 +0200)]
UPGRADE: add note about 2.12.5

This patch adds comments to the upgrade documentation
to advise users to rerun renew-crypto if they update
to 2.12.5.

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

5 years agoNEWS: Mention issue 1094
Helga Velroyen [Wed, 24 Jun 2015 11:19:46 +0000 (13:19 +0200)]
NEWS: Mention issue 1094

This patch updates the NEWS file to advise users to rerun
renew-crypto after an update to 2.12.5.

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

5 years agoman: mention changes in renew-crypto
Helga Velroyen [Wed, 24 Jun 2015 11:17:19 +0000 (13:17 +0200)]
man: mention changes in renew-crypto

This updates the gnt-cluster man page wrt to the changes
about server and client certificates and how they affect
the operation 'gnt-cluster renew-crypto'.

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

5 years agoVerify: warn about self-signed client certs
Helga Velroyen [Wed, 24 Jun 2015 09:56:23 +0000 (11:56 +0200)]
Verify: warn about self-signed client certs

Since from this patch series on, there should be no
self-sigend certificates in a cluster anymore, add
a warning to cluster-verify to nag people to renew
their certificates.

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

5 years agoBootstrap: validate SSL setup before starting noded
Helga Velroyen [Mon, 22 Jun 2015 13:01:04 +0000 (15:01 +0200)]
Bootstrap: validate SSL setup before starting noded

This patch adds a few checks which ensure that all
files necessary for proper SSL communication are
in place before noded is started on the master node.

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

5 years agoClean up configuration of curl request
Helga Velroyen [Mon, 22 Jun 2015 12:43:12 +0000 (14:43 +0200)]
Clean up configuration of curl request

This is a small patch cleaning up some thing in the
composition of the pycurl object for RPC calls.
For example, it removes some superfluous 'str' and
increases the logging level to warning when the
server cert is used.

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

5 years agoRenew-crypto: remove superflous copying of node certs
Helga Velroyen [Mon, 22 Jun 2015 08:59:09 +0000 (10:59 +0200)]
Renew-crypto: remove superflous copying of node certs

Since now the server certificates are copied in their
own dedicated function, remove adding their file name
in the general function for renewing crypto tokens.

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

5 years agoRenew-crypto: propagate verbose and debug option
Helga Velroyen [Fri, 19 Jun 2015 11:36:06 +0000 (13:36 +0200)]
Renew-crypto: propagate verbose and debug option

This patch enables the user to add --debug and/or --verbose
to the call of 'renew-crypto'. This way, more output is
shown to debug SSL problems easier.

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