Iustin Pop [Wed, 18 Apr 2012 16:15:51 +0000 (18:15 +0200)]
Add design document for query path splitting
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Fri, 4 May 2012 06:39:40 +0000 (23:39 -0700)]
Implement reverse mapping of values to names
This adds a bit of dumb mapping of values to names, while trying to be
safe. This is the best we can do without resorting to parsing or
interpreting ASTs.
The difference in the output is:
-- | Converted from Python list or set ADMINST_ALL
adminstAll :: [String]
-adminstAll = ["down", "offline", "up"]
+adminstAll = [adminstDown, adminstOffline, adminstUp]
Since for most such values we use strings, we don't gain in type
safety on the Haskell side. But it makes the output more readable and
it might open up other opportunities later.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 4 May 2012 06:11:30 +0000 (23:11 -0700)]
Implement support for multi-module export
This add support for exporting constants from multiple modules (as
opposed to hard-coding constants), and also makes the output more
readable by skipping things we know for sure we don't want to convert
(as opposed to things we would like to but don't know _how_ to
convert).
Additionally, we export the constants from the luxi module too.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 4 May 2012 12:34:16 +0000 (14:34 +0200)]
Add missing qa/__init__.py file
The file was there and listed in Makefile.am, but I forgot to add it to
commit
a0c3e7264a.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 26 Apr 2012 17:57:29 +0000 (19:57 +0200)]
QA: Fix shutdown for reinstall/rename tests
The “RunTestIf” uses an AND association between the passed test names,
so the instance would be be shut down if both rename and reinstall were
enabled. Since this is not necessarily the case, OR must be used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 26 Apr 2012 17:35:46 +0000 (19:35 +0200)]
QA: Enable use of OR conditions in test checks
Until now “TestRunIf” and “TestEnabled” could only handle AND. With this
patch a new class named “Either” is added to “qa_config” and allows OR.
The name “Either” was chosen instead of “Or” as the latter is very close
to the reserved keyword “or”.
Examples:
["rapi", Either(["instance-rename", "instance-reboot"])]
Either(["node-list", "instance-list", "job-list"])
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 30 Apr 2012 23:53:59 +0000 (16:53 -0700)]
Further fixes for new-style exception handling
Commit
30d25dd8 moved the htools code to new-style exception handling,
but the hconfd code hasn't been, which fails when compiling on newer
GHC versions.
This patch does the rest of the move; however, the situation is not
very nice, we should have a better way to handle this (introduce
catchIO? or something like that).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 30 Apr 2012 21:33:18 +0000 (14:33 -0700)]
Add NEWS entry for paramiko/pycrypto warnings
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Iustin Pop [Fri, 27 Apr 2012 10:04:59 +0000 (12:04 +0200)]
Fix grow-disk handling of invalid units
The reason why grow-disk was doing:
$ gnt-instance grow-disk instance3 0 -64
Unhandled Ganeti error: Invalid format
Is because it does it's own ParseUnit call, and doesn't transform that
into a nicer message.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Fri, 27 Apr 2012 09:33:12 +0000 (11:33 +0200)]
Fix rapi.testutils unittest
Since we use a testutils.InputTestClient(), then the actual error
expected is VerificationError, and not GanetiApiError (which is used
at real run-time).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Thu, 26 Apr 2012 15:03:36 +0000 (17:03 +0200)]
Make setup-ssh behave more friendly
So while testing my previous patch I run setup-ssh manually without
any arguments, and it did nothing (no complains, no messages,
anything). That was very surprising, so let's make it behave better if
no nodes are passed.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 26 Apr 2012 14:56:58 +0000 (16:56 +0200)]
Silence Paramiko deprecation warnings
This works around a problem in Paramiko, but which looks like it's a
Ganeti problem:
[cluster] root@node4:~# gnt-node add --readd node3
/usr/lib/python2.6/dist-packages/Crypto/Util/randpool.py:40:
RandomPool_DeprecationWarning: This application uses RandomPool, which
is BROKEN in older releases. See http://www.pycrypto.org/randpool-broken
RandomPool_DeprecationWarning)
To silence this, we do an ugly thing (since Python 2.4 doesn't support
context managers): manually reset the warnings filter, which resets
any -W command line flags (hopefully noone calls this tool manually so
often).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 10 Apr 2012 21:09:57 +0000 (23:09 +0200)]
Add example script for using RAPI test utilities
This script shows a few examples on how to use the RAPI input test
client. It is also run at “make check” time to ensure it's not
completely broken.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 30 Mar 2012 14:52:30 +0000 (16:52 +0200)]
Add more RAPI test utilities
This patch adds a mock RAPI client to test input values to methods. All
methods either raise an exception if there was a problem or return None.
Third-party code can use this to test their input values to the RAPI
client.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 30 Mar 2012 14:41:04 +0000 (16:41 +0200)]
rapi.testutils.FakeCurl: Add header support
With this patch headers are constructed from the PycURL options
and passed to the mock implementation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Mon, 30 Jan 2012 10:25:54 +0000 (11:25 +0100)]
Move _FakeCurl from tests/ganeti.rapi.client to ganeti.rapi.testutils
This is preparation for the mock system, where we need the same cURL
mock.
Signed-off-by: René Nussbaumer <rn@google.com>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 30 Mar 2012 11:58:33 +0000 (13:58 +0200)]
errors: Add exception for RAPI testing utilities
This exception is raised to abort before actually sending a LUXI call
(there is no LUXI server involved in the test). The testing utilities
catch the exception to report a success (i.e. the code didn't throw
an exception before due to invalid types, etc.). To allow the exception
to be thrown all the way to the test utilities, the HTTP server library
must ignore it. Also some overly generic exception handling is removed
from the RAPI request handler.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 30 Mar 2012 11:51:18 +0000 (13:51 +0200)]
luxi: Add list of all requests
This will be used in a unittest for RAPI testing utilities.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 29 Mar 2012 15:31:08 +0000 (17:31 +0200)]
server.rapi: Factorize RAPI user loading
By moving the code loading RAPI users from a file into a standalone
function it becomes easier to use the RAPI request handler in
tests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 29 Mar 2012 13:04:50 +0000 (15:04 +0200)]
RemoteApiHandler: Add support for mocked LUXI client
This will be used for providing a type-checking RAPI client for tests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 26 Apr 2012 08:40:03 +0000 (10:40 +0200)]
Man page update for grow-disk
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 25 Apr 2012 12:47:46 +0000 (14:47 +0200)]
Add grow-disk tests in QA
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 25 Apr 2012 11:59:33 +0000 (13:59 +0200)]
Add absolute grow-disk mode at CLI level
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 25 Apr 2012 11:58:47 +0000 (13:58 +0200)]
Add 'absolute' grow-disk mode at OpCode/LU level
This also improves the log messages for the (default) relative mode
("by %s to %s").
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 25 Apr 2012 11:42:47 +0000 (13:42 +0200)]
Ensure that the grow disk amount is positive
The CLI currently doesn't permit this, but a direct job submission
would allow it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 26 Apr 2012 09:50:17 +0000 (11:50 +0200)]
Log all external commands execution
This logs all external commands in normal (non-debug) mode. This will
leak the DRBD secrets, but in any case we do log failed commands, so
it's not a significant change.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 20 Apr 2012 18:53:42 +0000 (20:53 +0200)]
QA: Add default setting for tests
Commit
1010ec70b1 enabled all tests by default. In some scenarios where
the configuration is static one may not want newly added tests to be
run.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Chris Schrier [Fri, 20 Apr 2012 16:22:26 +0000 (12:22 -0400)]
Update NEWS to mention that CertificateError change.
Signed-off-by: Chris Schrier <schrierc@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Chris Schrier [Fri, 20 Apr 2012 16:22:25 +0000 (12:22 -0400)]
Change CertificateError to subclass GanetiApiError
Signed-off-by: Chris Schrier <schrierc@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 20 Apr 2012 17:51:04 +0000 (19:51 +0200)]
Add opcode parameter descriptions
Fixes QA after commit
cfdf561dade7.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Chris Schrier <schrierc@google.com>
Michael Hanselmann [Tue, 20 Mar 2012 16:57:12 +0000 (17:57 +0100)]
Stop acquiring BGL for LUXI queries
Short description: This fixes an issue whereby masterd would become
unresponsive on the LUXI socket, leading to client timeouts. While made
worse in 2.5, the underlying issue was already present in 2.4.
Longer description: Until now all LUXI queries would acquire the BGL
(big Ganeti lock) in shared mode. With the exception of OpNodeAdd and
OpNodeRemove, this was also the case for all opcodes before version 2.5.
In 2.5 we split OpClusterVerify into multiple opcodes, one of which
(OpClusterVerifyConfig) now acquires the BGL in exclusive mode. Whether
or not doing so is good is a separate discussion: OpNodeAdd and
OpNodeRemove, as of this writing, still require an exclusive BGL.
OpClusterVerifyConfig is run more often than OpNodeAdd or OpNodeRemove
in normal clusters, which is why we only recognized this issue in 2.5.
What would happen is that once OpClusterVerifyConfig tried to acquire
its exclusive BGL while it was actually held by other opcodes (e.g.
OpInstanceReplaceDisks), the locking code would not grant shared
acquires for the BGL, even when the exclusive acquire is removed from
the queue for a short amount of time after a timeout. This is necessary
to prevent lock starvation.
In this situation further LUXI queries requiring the BGL in shared mode,
e.g. OpClusterQuery, would block and the client eventually time out.
Over time they fill the client request workerpool's queue and at that
point even requests not requiring the BGL stop working. Once the
long-running operation(s) holding the BGL in shared mode finished,
OpClusterVerifyConfig gets it in exclusive mode and everything returns
to normal. LUXI recovers very soon too.
I'd like to thank Bernardo Dal Seno for his contribution to this bugfix.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
0fa753bad2cf5a0cf88953347e5da3aebbf21956)
Michael Hanselmann [Wed, 18 Apr 2012 21:15:38 +0000 (23:15 +0200)]
Stop using locks in LUXI "QueryTags"
Also mark it as deprecated in NEWS as normal queries can be used
instead.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 19 Apr 2012 18:03:12 +0000 (20:03 +0200)]
Convert LUClusterConfigQuery to query2
The main intention of this patch is to make it possible to retrieve
cluster tags via query2. While at it I decided to convert
LUClusterConfigQuery right away. Some of the values returned by
LUClusterQuery are also included, but the conversion of LUClusterQuery
is not yet complete.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 19 Apr 2012 18:10:18 +0000 (20:10 +0200)]
Fix RAPI QA with exports via query2
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 19 Apr 2012 20:14:49 +0000 (22:14 +0200)]
Remove unused constants
These are not used anywhere in Python or Haskell.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 18 Apr 2012 16:38:14 +0000 (18:38 +0200)]
Convert listing exports to query2
This solves one case where locks are acquired during LUXI queries.
Pretty late into the transition I noticed that OpBackupQuery had a
“use_locking” parameter for a long time, but didn't use it. Since
most of the other changes were already and this allows exports to
be listed via RAPI (/2/query) I decided to finish.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 18 Apr 2012 16:39:38 +0000 (18:39 +0200)]
utils.algo: Use str.isdigit instead of regular expression
str.isdigit is about 4x faster than using a regular expression ("\d+").
This is in the inner sorting code so speed matters.
$ python -m timeit -s 'import re; s = re.compile("^\d+$")' \
's.match(""); s.match("Hello World"); s.match("1234")'
1000000 loops, best of 3: 0.937 usec per loop
$ python -m timeit '"".isdigit(); "Hello World".isdigit(); "1234".isdigit()'
1000000 loops, best of 3: 0.218 usec per loop
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Chris Schrier [Wed, 18 Apr 2012 22:10:50 +0000 (18:10 -0400)]
Include PycURL error code in GanetiApiError.
Signed-off-by: Chris Schrier <schrierc@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 17 Apr 2012 18:48:30 +0000 (20:48 +0200)]
Drop objects.QueryRequest
It was only used in one place and wasn't really necessary.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:11:49 +0000 (21:11 +0200)]
gnt-os modify: Add "--submit" option
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:11:36 +0000 (21:11 +0200)]
gnt-node: Add "--submit" and "--priority" to commands
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:11:21 +0000 (21:11 +0200)]
gnt-instance: Add "--submit" and "--priority" to commands
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:11:05 +0000 (21:11 +0200)]
gnt-group: Add "--submit" and "--priority" to commands
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:10:42 +0000 (21:10 +0200)]
gnt-cluster modify: Add "--submit" option
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:10:26 +0000 (21:10 +0200)]
gnt-backup: Add "--submit" to two commands
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 19:09:43 +0000 (21:09 +0200)]
Document "--submit" in ganeti.7
Like “--priority” and “--dry-run”, the “--submit” option is available
for many commands and can be documented in a central place. This patch
also fixes a small number of style issues.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 18 Apr 2012 11:58:56 +0000 (13:58 +0200)]
Fix further QA failures due to query changes
Hopefully these will be the last ones…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 17 Apr 2012 18:06:55 +0000 (20:06 +0200)]
Fix error in opcode result processing
LUXI queries are processed without callbacks (see
server.masterd.ClientOps._Query). With commit
07923a3c the logic for
checking an opcode's result for jobs to submit was changed and
subsequently raised an exception (“'NoneType' object has no attribute
'SubmitManyJobs'”) in such a case. Before said commit the exception
would also have been raised if an opcode used by a query submitted jobs.
This patch changes the logic to only resolve the method if callbacks are
defined and to use an exception-raising implementation otherwise.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Alexander Schreiber [Tue, 17 Apr 2012 14:47:53 +0000 (16:47 +0200)]
Add "show" as alias for "info" to gnt commands
This patch adds support for "show" as an alias for "info" to
gnt-(cluster|instance|node|os). It already exists in gnt-job.
Signed-off-by: Alexander Schreiber <als@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 21:28:21 +0000 (23:28 +0200)]
Copy debug level, priority and set comment for LU-generated opcodes
Before this patch, a node evacuation submitted with high priority would
only compute the solution at that priority, but the actual evacuation
ran at normal priority.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 13 Apr 2012 14:53:21 +0000 (16:53 +0200)]
Fix QA failures with "gnt-job list"
Jobs have no “name” field.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 12 Apr 2012 22:08:20 +0000 (00:08 +0200)]
gnt-job list: Add options for commonly used filters
While “gnt-job list” would also accept filters on the command line (e.g.
“'status == "error"'”, having shortcuts in the form of options comes in
handy.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 12 Apr 2012 19:17:24 +0000 (21:17 +0200)]
Merge branch 'devel-2.5'
* devel-2.5: (29 commits)
gnt-* {add,list,remove}-tags: Unify options
Bump version for 2.5.0 final release
configure.ac: Fix “too many arguments” error
Fix extra whitespace
Further fixes concerning drbd port release
Fix a bug concerning TCP port release
Fix extra whitespace
Fix a bug concerning TCP port release
ganeti.initd: Add “status” action
Add whitelist for opcodes using BGL
LUOobCommand: acquire BGL in shared mode
Fix docstring bug
LUNodeAdd: Verify version in Prereq
LUNodeAdd: Verify version in Prereq
Fix LV status parsing to accept newer LVM
gnt-instance info: Show node group information
cmdlib: Factorize checking acquired node group locks
Bump version for 2.5.0~rc6 release
cmdlib: Stop forking in LUClusterQuery
locking: Notify only once on release
...
Conflicts:
NEWS: Trivial
daemons/daemon-util.in: Copyright line
lib/client/gnt_group.py: Tag operations
lib/cmdlib.py: Not so trivial, hopefully correct
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 12 Apr 2012 17:31:37 +0000 (19:31 +0200)]
gnt-* {add,list,remove}-tags: Unify options
- Listing tags is a query, so neither “--priority” nor “--submit” make
sense
- Support both options for adding/removing tags
- Also remove “--submit” from “gnt-node health”; it doesn't work and
doesn't make sense for listing node health
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 12 Apr 2012 16:12:48 +0000 (18:12 +0200)]
Merge branch 'stable-2.5' into devel-2.5
* stable-2.5:
Bump version for 2.5.0 final release
configure.ac: Fix “too many arguments” error
Fix extra whitespace
Further fixes concerning drbd port release
Fix a bug concerning TCP port release
Fix extra whitespace
Fix a bug concerning TCP port release
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 11 Apr 2012 17:34:58 +0000 (19:34 +0200)]
Bump version for 2.5.0 final release
Also update NEWS file.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 11 Apr 2012 18:26:35 +0000 (20:26 +0200)]
Merge branch 'devel-2.4' into stable-2.5
* devel-2.4:
Fix extra whitespace
Further fixes concerning drbd port release
Fix a bug concerning TCP port release
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 11 Apr 2012 17:34:54 +0000 (19:34 +0200)]
configure.ac: Fix “too many arguments” error
If GHC_PKG_QUICKCHECK contains multiple values, the test would fail
with “too many arguments”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 30 Mar 2012 10:44:51 +0000 (12:44 +0200)]
Fix extra whitespace
Sorry, didn't catch this before…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
54b010cad1ea0a536ed037bf315a04dd1c079964)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Dimitris Aragiorgis [Mon, 2 Apr 2012 18:27:35 +0000 (21:27 +0300)]
Further fixes concerning drbd port release
Commit 3b3b1bc does not entirely fix the bug introduced in commit
f396ad8. It fixes consistency of config data in permanent storage, but
does not ensure consistency in data held in runtime memory of masterd.
The bug of duplicate ports is still triggered when LUInstanceRemove()
invokes _RemoveDisks() and this returns False (in case
call_blockdev_remove RPC fails). The drbd ports get returned in the
pool, but execution is aborted and RemoveInstance() is never invoked.
Due to the fact that port handling is not done with
TemporaryReservationManager, ensure that ports are released, only if
disk related config data is deleted.
In _RemoveDisks() release ports only if all RPCs succeed.
Extend _RemoveDisks() to include ignore_failures argument passed by
_RemoveInstance() to handle the ports appropriately.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Dimitris Aragiorgis [Fri, 30 Mar 2012 09:47:14 +0000 (11:47 +0200)]
Fix a bug concerning TCP port release
Commit f396ad8 returns the TCP port used by DRBD disk back to the
TCP/UDP port pool using AddTcpUdpPort().
However, AddTcpUdpPort() writes the config on every invocation,
using _WriteConfig(). This causes two problems:
* it causes critical errors logged by VerifyConfig(), after the DRBD
disk removal, and until the actual instance removal.
* if the code following AddTcpUdpPort() fails, the port is already
returned back the pool, which causes the port to have duplicates
(inconsistent config).
AddTcpUdpPort() is invoked in three cases:
* during InstanceRemove() through _RemoveDisks().
* during InstanceSetParams() in case of disk removal.
* during InstanceSetParams() through _ConvertDrbdToPlain().
This commit fixes the problem by removing the _WriteConfig() call from
AddTcpUdpPort(), delegate it to Update() via the
TemporaryReservationManager and ensure AddTcpUdpPort() precedes
Update().
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
[iustin@google.com: small comments adjustements]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
3b3b1bca566a005acd622a5b6e49528e5e3dbe85)
Michael Hanselmann [Fri, 30 Mar 2012 13:01:38 +0000 (15:01 +0200)]
Fix query unittests after converting jobs to query2
I missed these among some shelltest-related failures.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:31:46 +0000 (14:31 +0200)]
QA: Add tests for “gnt-job list”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:37:55 +0000 (14:37 +0200)]
gnt-job list: Switch to query2
This brings “gnt-job list” up to the same level as “gnt-instance list”
with filters. Further updates will add more parameters for the most
common filters (e.g. only running jobs).
Also update the man page.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:36:12 +0000 (14:36 +0200)]
gnt-job info: Convert to query2
Otherwise detecting unavailable jobs is hard (“status” is None, is this
an error or just an unavailable job?).
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:34:16 +0000 (14:34 +0200)]
Add job support to query2 via LUXI
This enables the use of filters through query2 when listing jobs.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:32:59 +0000 (14:32 +0200)]
jqueue: Cache prepared field list in _JobChangesChecker
… instead of re-calculating it on every file change.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:30:37 +0000 (14:30 +0200)]
NEWS: Deprecate LUXI calls replaced with query2
Adding the “luxi” namespace is necessary in “sphinx_ext”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:28:50 +0000 (14:28 +0200)]
jqueue: Convert GetInfo to query2
This rather inefficient implementation (fields are evaluated on every
call to GetInfo) is not good for WaitForJobChanges and doesn't support
filters, but that will be rectified in later patches.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:29:54 +0000 (14:29 +0200)]
query: Add definitions for job fields
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:25:48 +0000 (14:25 +0200)]
qlang.MakeFilter: Enable use of different name field
Jobs don't have a “name” field, so we must be able to control
the field used for simple filters.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 14:19:55 +0000 (16:19 +0200)]
Merge cli.FormatTimestamp and utils.FormatTime
… to some degree at least. Unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 13:55:21 +0000 (15:55 +0200)]
constants: Don't hardcode priorities for LOCK_ATTEMPTS_TIMEOUT
Also include unittest for LOCK_ATTEMPTS_TIMEOUT.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 13:41:36 +0000 (15:41 +0200)]
jqueue._QueuedOpCode: Change a docstring
There was a typo and it's not necessary to repeat the class name.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 12:32:03 +0000 (14:32 +0200)]
locking: Remove unused OldStyleQueryLocks
No longer used after commit
090377807.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 30 Mar 2012 10:44:51 +0000 (12:44 +0200)]
Fix extra whitespace
Sorry, didn't catch this before…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Dimitris Aragiorgis [Tue, 13 Mar 2012 14:48:58 +0000 (16:48 +0200)]
Fix a bug concerning TCP port release
Commit f396ad8 returns the TCP port used by DRBD disk back to the
TCP/UDP port pool using AddTcpUdpPort().
However, AddTcpUdpPort() writes the config on every invocation,
using _WriteConfig(). This causes two problems:
* it causes critical errors logged by VerifyConfig(), after the DRBD
disk removal, and until the actual instance removal.
* if the code following AddTcpUdpPort() fails, the port is already
returned back the pool, which causes the port to have duplicates
(inconsistent config).
AddTcpUdpPort() is invoked in three cases:
* during InstanceRemove() through _RemoveDisks().
* during InstanceSetParams() in case of disk removal.
* during InstanceSetParams() through _ConvertDrbdToPlain().
This commit fixes the problem by removing the _WriteConfig() call from
AddTcpUdpPort(), delegate it to Update() via the
TemporaryReservationManager and ensure AddTcpUdpPort() precedes
Update().
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
[iustin@google.com: small comments adjustements]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 17:00:49 +0000 (19:00 +0200)]
ganeti.initd: Add “status” action
Eric Rostetter sent a patch adding a “status” action, but unfortunately
his code was apparently specific to Red Hat. I hope this implementation
is more distribution-agnostic; after all “status_of_proc” is part of
LSB. Example output:
$ /etc/init.d/ganeti status
ganeti-noded is not running ... failed!
ganeti-masterd is running.
ganeti-rapi is running.
ganeti-confd is running.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 16:11:04 +0000 (18:11 +0200)]
Add whitelist for opcodes using BGL
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dimitris Aragiorgis [Fri, 23 Mar 2012 19:29:55 +0000 (21:29 +0200)]
Update IP pool management design doc
Update IP pool managenent design doc to be consistent
with the implementation.
* Add new NIC parameter: 'network'
Can be None for backwards compatibility.
* Introduce the term 'netparams'
The NIC inherits netparams (mode, link) as its nicparams
if assinged to a network. Netparams are defined during
network connection to a nodegroup.
* Introduce the term 'Conflicting IPs'
Ensure IPs uniqueness inside nodegroups.
* Update 'Hooks' section.
* Update 'Hook variables' section
* Update 'Userland interface' to reflect the implementation
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 28 Mar 2012 16:04:20 +0000 (18:04 +0200)]
Merge branch 'stable-2.5' into devel-2.5
* stable-2.5:
LUOobCommand: acquire BGL in shared mode
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Wed, 28 Mar 2012 11:42:46 +0000 (13:42 +0200)]
LUOobCommand: acquire BGL in shared mode
Fixed a typo so that now LUOobCommand acquires the BLG in shared mode, as
intended.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Mon, 26 Mar 2012 15:15:55 +0000 (17:15 +0200)]
LUNodeAdd: Make the version call only dependend on DNS
Also move the version check into prereq to abort before alter cluster
state if the version mismatch.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Mon, 26 Mar 2012 15:06:02 +0000 (17:06 +0200)]
RPC: Add a new client type for DNS only
This patch moves the “call_version” to a new RPC client definition and
then adds a new runner using the DNS resolver for getting the host
address.
The standard “BootstrapRunner”, where the call was before, tries to
resolve node names using ssconf first, which doesn't work properly when
re-adding a node with a new primary IP address.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 27 Mar 2012 09:27:29 +0000 (11:27 +0200)]
Update install document
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 27 Mar 2012 09:27:22 +0000 (11:27 +0200)]
Update admin doc
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 27 Mar 2012 09:27:09 +0000 (11:27 +0200)]
Update walkthrough document
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 23 Mar 2012 09:17:56 +0000 (09:17 +0000)]
Update default instance kernel version
We switch from vmlinuz-2.6-… to vmlinuz-3-…. To do this nicely, we
also add a ./configure-time setting for the KVM instance kernel.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 23 Mar 2012 08:58:02 +0000 (08:58 +0000)]
Update INSTALL and devnotes documents
Added the new Haskell library requirements, for both normal and
developer usage.
Furthermore, all commands are now converted to the shell-example
lexer.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 27 Mar 2012 09:00:35 +0000 (11:00 +0200)]
Fix escaping of percent signs in the shell lexer
Of course, we do have cases where we want to escape the percent signs,
and our regexes were not fully correct for this case.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Mon, 26 Mar 2012 12:57:26 +0000 (14:57 +0200)]
Add a special lexer for sphinx/pygments
This will be used throughout our docs for better formatting example
shell sessions, with custom markup for comments, user fixed input and
user variable input.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 23 Mar 2012 14:59:06 +0000 (15:59 +0100)]
ganeti.7: Add more filter examples
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Sun, 25 Mar 2012 14:32:35 +0000 (16:32 +0200)]
Enable -Werror by default for htools
Since the code base is now "clean" across all supported GHC versions
(6.12-7.4), we can enable -Werror again.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Sun, 25 Mar 2012 14:26:02 +0000 (16:26 +0200)]
Switch to new-style exception handling
Currently, we're using Prelude.catch to handle I/O errors in
htools. This style of error handling has been deprecated for a while,
but it still used to work without warnings.
However, the GHC release 7.4 has started to emit deprecation warnings
for it, so we change to the Control.Exception module; the code is a
bit less clean since we only care about I/O errors (but
Control.Exception deals with other error types too), so we have to
filter the exceptions.
Note that the new style exception handling is not really "new"; it has
existed since at least GHC 6.12, which is our oldest supported
compiler.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Sat, 24 Mar 2012 23:21:15 +0000 (00:21 +0100)]
Change a type computation for compatibility with 6.12
This is the last warning related to TemplateHaskell that was 6.12
specific; for some reason, it doesn't "see" that traw/tname were used.
The patch just replaces the quoting syntax with an explicit type
declaration; while less readable, it also has less warnings.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Sat, 24 Mar 2012 22:34:42 +0000 (23:34 +0100)]
Fix compatibility with TemplateHaskell from GHC 7.4
GHC 7.4 has updated the TemplateHaskell library, and it turns out that
the way we built the JSON instance implementation for showJSON was not
good (probably this is why GHC 6.12 was generating some warnings).
The patch changes the build of showJSON to be the same as readJSON,
which was working fine. As a bonus, this fixes both the 7.4 issue and
the 6.12 one.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Fri, 23 Mar 2012 16:32:57 +0000 (17:32 +0100)]
Add trivial tests for gnt-* cli
While testing some other stuff, I realised that the gnt-* commands
could be broken (as in, the script fails with syntax errors), but make
check doesn't detect it. Since we have shelltest, we can now add
trivial tests for this case.
One downside is that starting the scripts seems to be much slower
than the htools binaries, so we can't add as many tests.
The other downside is that shelltest is now required for all
development work, but I think this is a small disadvantage compared to
the increased testing possibilities.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 23 Mar 2012 09:08:41 +0000 (09:08 +0000)]
Fix hardcoded Xen kernel path
We already have a ./configure-time variable for this, but it seems to
be actually unused.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 22 Mar 2012 21:00:06 +0000 (21:00 +0000)]
Fix docstring bug
Fix a typo introduced in commit
c85b15c1, which breaks epydoc.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Thu, 22 Mar 2012 23:30:28 +0000 (23:30 +0000)]
Enable selection between Python and Haskell confd
This patch changes configure.ac Makefile.am so that the user can pass:
- --disable-confd (or --enable-confd=no) to disable it completely
- --enable-confd=yes or --enable-confd=python to select the
traditional implementation (this is the default setting)
- --enable-confd=haskell to select hconfd
The only "not nice" thing is that I've chosen to keep the
hconfd.hs/hconfd name, and we rename it after install via an
install-exec-hook. The other choice is possible too (to rename the
source file/binary).
One additional note is that if we select haskell, the _rule_ for
creating daemons/ganeti-confd dissapears; whereas if we select python,
the rule for htools/hconfd still exists (one can build it explicitly),
it just is not installed. This is due to the different way in which
the rules are declared.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>