Dato Simó [Fri, 19 Oct 2012 14:54:54 +0000 (15:54 +0100)]
BasicTypes.hs: fix docstring for eitherToResult
eitherToResult now converts from `Either a b` to `GenericResult`, not
necessarily from `Either String` only. Also, fix a typo.
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 19 Oct 2012 14:25:23 +0000 (16:25 +0200)]
Add note about running individual test cases
This was asked a few times offline, so let's document it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 19 Oct 2012 11:42:35 +0000 (13:42 +0200)]
Add a small QA check in instance renames for tags update
We also need to change the signature for _GetInstanceInfo, since we
don't have access to the instance dictionary in the rename instance
test.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 18 Oct 2012 15:59:56 +0000 (17:59 +0200)]
Update blockdev's "info" at instance rename
Currently, we set "info" metadata on block devices at device creation
time, but we never update it, leading to stale data in case of
instance renames. This would not be a big problem in case of regular
renames (assuming this is a rare operation), but importing instances
into the cluster via the import/export feature usually is done with a
rename; this means that all imported instances have wrong information
in their block devices.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 18 Oct 2012 15:58:45 +0000 (17:58 +0200)]
LVM: remove old tags when adding new ones
This patch adds a small helper function to clear an LV's tags, and
calls it at SetInfo time. We need this to be able to correctly track
instance renames, once we will call SetInfo at such times.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 18 Oct 2012 15:56:48 +0000 (17:56 +0200)]
Add a small bdev helper function
I wanted to write that snippet the third time, which is too much :)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 18 Oct 2012 14:11:13 +0000 (16:11 +0200)]
Add a small note about tab completion and generated files
This can indeed be annoying, so let's document it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>
Michael Hanselmann [Thu, 18 Oct 2012 11:38:40 +0000 (13:38 +0200)]
Update for SSH design: Cluster name, ignore node daemon
While writing the initial version of this design I misunderstood what
“setup-ssh” does. It doesn't actually start the node daemon and just
configures SSH, nothing else.
This patch adds the cluster name as a field to the JSON structure and
clarifies the purpose of the node daemon certificate given.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 18 Oct 2012 17:59:22 +0000 (19:59 +0200)]
Compare significant fields only for simple SSH keys
For simple SSH keys, that is those without options such as
“command="…"”, only the first two parts need to be compared. The third
field is a free-form comment.
This patch changes the comparison used in
AddAuthorizedKey/RemoveAuthorizedKey to take this into account. Lines
with options are still compared in full.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 18 Oct 2012 15:15:19 +0000 (17:15 +0200)]
Add instance uptime to monitoring info
This can be used to detect a reboot between two checks.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Thu, 18 Oct 2012 15:39:42 +0000 (17:39 +0200)]
test/*.py: Replace '' with ""
There might be more, but at least replace all these low-hanging fruits.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Wed, 10 Oct 2012 10:07:15 +0000 (12:07 +0200)]
Add cluster monitoring agent design document
This design addresses the lack of a uniform way to query ganeti nodes
for real time information that can be used by monitoring.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Sun, 7 Oct 2012 20:12:56 +0000 (22:12 +0200)]
Remove custom OpResult type/monad
Since we now have the GeneralResult as a multi-purpose monad, we can
remove the custom OpResult monad, and just use 'GeneralResult
FailMode' as our type. This allows removal of a few bits of
specialised infrastructure, relying instead on the generic one.
The restriction on using OpResult as a general monad remains as
before.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 18 Oct 2012 10:44:37 +0000 (12:44 +0200)]
Merge branch 'devel-2.6'
* devel-2.6:
ensure-dirs: Don't accept arguments
ensure-dirs: Fix program name on usage screen
cli: Fix small typo
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 17 Oct 2012 15:40:11 +0000 (17:40 +0200)]
ensure-dirs: Don't accept arguments
Before they would just be silently ignored.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 17 Oct 2012 15:32:15 +0000 (17:32 +0200)]
ensure-dirs: Fix program name on usage screen
No string replacements are used, so doubling of the percent sign is not
necessary.
Before: Usage: %ensure-dirs [--full-run]
After: Usage: ensure-dirs [--full-run]
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 17 Oct 2012 23:11:24 +0000 (01:11 +0200)]
Convert man page highlighting to standard RST
Instead of using the sphinx-specific highlight extension, which is not
parsed by Pandoc, let's switch to the standard RST directive, which
will be picked up and will result in slightly nicer man pages when
converted to HTML (in man output it remains the same).
Note that I've converted only some of the examples (the one that
actually had shell scripts); the ones that show command lines
(e.g. starting with '#') I didn't convert, as they don't look nice
(and Pandoc/Kate highlighting doesn't have the equivalent of our
shell-example lexer we use in sphinx).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Iustin Pop [Wed, 17 Oct 2012 22:19:57 +0000 (00:19 +0200)]
Convert two more 'sh' highlight styles to 'shell-example'
This is straightforward; only one shell example remained, but as we
process the man pages via pandoc and not sphinx, it's not actually
used, we leave it as such for now.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Iustin Pop [Wed, 17 Oct 2012 22:09:32 +0000 (00:09 +0200)]
Small improvements to the move-instance doc
While reading the docs, I saw that this is not converted to the shell
lexer, and that a few other small improvements can be done.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Helga Velroyen [Thu, 18 Oct 2012 08:56:30 +0000 (10:56 +0200)]
Use exitErr instead of explicit error message and exitWith
Furthermore, a few messages have their capitalisation changed (fixed).
Signed-off-by: Helga Velroyen <helgav@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 17 Oct 2012 16:50:58 +0000 (18:50 +0200)]
Fix running of Haskell tests
Commit
21a5e56c forgot to rename a variable used in a conditional (of
course shell didn't complain about unused vars), so the AM_CONDITIONAL
was always false.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>
Iustin Pop [Sun, 7 Oct 2012 19:52:11 +0000 (21:52 +0200)]
Generalise the Result type
Currently, our error monad—Result—has a plain string error type. This
is not good, as we don't have structured errors, we can't pass back
proper error information to Python code, etc.
To solve this, we generalise this type as 'GenericResult a', and make
Result an alias to 'GenericResult String' for compatibility with the
old code. New error hierarchies will be introduced as different
types. Furthermore, we generalise our helper functions too, so that
they can work on any 'GeneralInstance a' type, not only Result.
There are two small drawbacks to this generalisation. First, a Monad
instance requires (at least for the way we use it) a 'fail :: String
-> m a' instance, so we need to be able to build an 'a' value from a
string; therefore, we can implement the Monad instance only for a
newly-introduced typeclass, 'FromString', which requires the needed
conversion function. Second, due to the fact that 'String' is a type
alias (for [Char]) instead of an actual type, we need to enable the
FlexibleInstances language pragma; as far as I know, this has no
significant drawbacks.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Dato Simó [Wed, 17 Oct 2012 15:40:05 +0000 (16:40 +0100)]
Merge branch 'devel-2.6' into master
* devel-2.6:
htools-excl.test: add test case for exclusion tags in hbal
Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'
Group.hs: add 'allTags'; adjust loaders and test data for it
Add hbal-excl-tags.data to Makefile.am, missed in 0397694
Conflicts:
Makefile.am: hbal-excl-tags.data moved under htest/
htools/Ganeti/HTools/Luxi.hs: types from Qlang are now used
htools/Ganeti/HTools/QC.hs: defGroup definition now in TestHTools.hs
lib/cmdlib.py: IAllocator class now in iallocator.py
test/htools-excl.test: moved under htest/
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 17 Oct 2012 15:29:12 +0000 (17:29 +0200)]
cli: Fix small typo
s/it/if/
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Dato Simó <dato@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Dato Simó [Wed, 17 Oct 2012 15:24:51 +0000 (16:24 +0100)]
Add hbal-excl-tags.data to Makefile.am, missed in 0397694
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Dato Simó [Wed, 10 Oct 2012 21:51:30 +0000 (22:51 +0100)]
Group.hs: add 'allTags'; adjust loaders and test data for it
This commit adds a Group.allTags field to store the tags of node groups,
and teaches each loader backend in HTools to populate it (additionally, the
IAllocator class in lib/cmdlib.py now includes tags for groups too). Test
data is updated to include an empty set of tags for node groups in all
affected test cases.
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dato Simó [Wed, 10 Oct 2012 16:58:37 +0000 (17:58 +0100)]
Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'
The mergeData function in Loader.hs included a step to filter an instance's
tags to include only the exclusion tags (as specified via the commandline,
or cluster-level tags). Later on, code in Node.hs assumed Instance.tags to
contain only tags to be used for exclusion.
Because in the future we will need to access the full list of an instance's
tags (and not only exclusion tags), this commits deprecates the 'tags'
field, and introduces Instance.exclTags and Instance.allTags.
Instance.allTags is now populated from the different backends (Text, Luxi,
Rapi, etc.), and Instance.exclTags is only populated from Loader.mergeData,
as was done previously. This means that loading tags from e.g. Text or Simu
and assuming that they'll be used as exclusion tags without going through
Loader.hs will no longer work; but this was already the case with other
fields, and 'mergeData' or 'loadExternalData' continue to be the only entry
points to get a consistent view of the cluster. (Additionally, there were
no tests that made this assumption that I could find.)
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dato Simó [Fri, 12 Oct 2012 15:03:15 +0000 (16:03 +0100)]
htools-excl.test: add test case for exclusion tags in hbal
In preparation for future modifications in the exclusion tags field, add a
test that verifies that exclusion tags are being honored: in a test cluster
with two instances of the same exclusion group in each node, hbal should
shuffle instances around to improve the score.
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 17 Oct 2012 11:55:53 +0000 (13:55 +0200)]
Fix small typo in NEWS file
Sorry, I didn't see this before pushing
5a7cb9d3…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>
Iustin Pop [Wed, 17 Oct 2012 05:47:51 +0000 (07:47 +0200)]
Remove support for PUT in noded
This takes care of a FIXME; 2.6 already uses the new method, so we're
good during upgrades.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 17 Oct 2012 07:50:00 +0000 (09:50 +0200)]
Ignore empty/comment lines in OS variants file
Per a conversation on ganeti@googlegroups.com:
- gnt-os diagnose ; gnt-os list take in consideration blank lines in
/etc/ganeti/instance-image/variants.list that could be confusing.
Let's fix this and also let's ignore comment lines.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 09:10:13 +0000 (11:10 +0200)]
gnt-job cancel: Confirmation and selection of jobs
New parameters, “--pending”, “--queued” and “--waiting”, are added to
select all jobs in the respective state. If one of those options is used
and “--force” is not given, the user is asked to confirm the operation.
Unit tests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 5 Oct 2012 01:39:42 +0000 (03:39 +0200)]
Update NEWS for file storage paths
Mention that the file is something new and should be written by
cfgupgrade.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 09:26:23 +0000 (11:26 +0200)]
Replace custom algorithm in constants unittest
There is no need for the “_IsUniqueSequence” function anymore, it can
easily be replaced by utils.FindDuplicates. Also, pass the message as a
keyword parameter and use the more commonly used assert* functions.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 13:53:35 +0000 (15:53 +0200)]
Design for remote command execution via RPC
This is a first design for executing commands via RPC.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 13:05:41 +0000 (15:05 +0200)]
Makefile: Verify version of security.rst document
This document should be kept up-to-date.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 09:35:54 +0000 (11:35 +0200)]
Add new constant for pending job status
This constant contains the job status' “queued”, “waiting” and
“cancelled”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 16 Oct 2012 14:40:26 +0000 (16:40 +0200)]
Merge branch 'devel-2.6'
* devel-2.6:
ensure-dirs: Fix permissions on master socket
Update security document for version 2.6
Update NEWS and bump version to 2.6.1
Text.hs: update field lists in parseData comments
Conflicts:
NEWS: Trivial
lib/tools/ensure_dirs.py: constant moved to pathutils
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 13:07:47 +0000 (15:07 +0200)]
ensure-dirs: Fix permissions on master socket
A socket shouldn't have its executable bit set.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 13:06:40 +0000 (15:06 +0200)]
Update security document for version 2.6
Quite some things were out of date. Some formatting was also updated.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 16 Oct 2012 10:56:40 +0000 (12:56 +0200)]
Add a very simple test rpc program
This only supports test delay for now, is not built by default (only
on demand), and is also not installed anywhere.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 16 Oct 2012 10:55:42 +0000 (12:55 +0200)]
confd: add the test_delay RPC call
Also add some more haddock structure to the module. The RPC call
itself is rather trivial.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 16 Oct 2012 10:55:06 +0000 (12:55 +0200)]
Add htools program code to hlint call
Currently only the libraries are added, but not the actual main binary
(usually short) code.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Mon, 15 Oct 2012 17:03:39 +0000 (19:03 +0200)]
Add design for changing node SSH setup
The goal is to remove the dependency on Paramiko.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 15 Oct 2012 19:50:50 +0000 (21:50 +0200)]
confd: fix RpcVersion call
By accident, we sent the node object as call data in this rpc call,
instead the version request (i.e. nothing). This is due to the fact
that the 'call' data comes second, not first in the function argument.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Sun, 7 Oct 2012 18:46:28 +0000 (20:46 +0200)]
Cleanup HTools.Types/BasicTypes imports
Before we reorganised the source tree, the 'Result' type was exported
from HTools/Types.hs. This changed during the reorg, but at that time
we didn't change the exports; instead, we kept re-exporting it from
the old module for compatibility.
In light of future changes to the Result type, let's stop this
re-export and cleanup the imports of the other modules.
One test is slightly rewritten with explicit types declaration (part
of the values already needed one, let's make it explicit).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Mon, 15 Oct 2012 13:52:45 +0000 (15:52 +0200)]
Merge branch 'stable-2.6' into devel-2.6
* stable-2.6:
Update NEWS and bump version to 2.6.1
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Bernardo Dal Seno [Fri, 12 Oct 2012 15:28:03 +0000 (17:28 +0200)]
Update NEWS and bump version to 2.6.1
This is a small bug-fix only release.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 10:30:49 +0000 (12:30 +0200)]
errors: Document arguments to QueryFilterParseError
Also fix one small mistake in the docstring for QuitGanetiException.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 12 Oct 2012 09:11:16 +0000 (11:11 +0200)]
Fix distcheck after commit 7a962ec
I only ran “make check” and forgot about “distcheck”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 11:10:56 +0000 (13:10 +0200)]
Makefile/check-local: Ensure design document exists
This way a missing design document is detected.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 11:06:45 +0000 (13:06 +0200)]
Add design document for version 2.7
- Move design document for batch instance creation into it
- Sort list of hidden files in index.rst
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Thu, 11 Oct 2012 01:34:45 +0000 (03:34 +0200)]
QA: TestAssignNodesIncludingSplit can be disabled
The test can now be enabled/disabled with the "group-rwops" flag.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Tue, 9 Oct 2012 15:38:27 +0000 (17:38 +0200)]
QA: never put a master node offline
Before, it could happen that the master node was chosen to be set offline
in the "instance-remove-drbd-offline" test. Also changed a finally clause
to make sure that an exception while making the node online doesn't break
undoing other things.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Mon, 8 Oct 2012 13:43:16 +0000 (15:43 +0200)]
Add option to disable iallocator use in QA
By default some QA tests use iallocators. It is now possible to disable
iallocators in QA, so that QA doesn't force having iallocators set up.
The affected tests have now alternatives pathways.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Sébastien Bocahu [Wed, 19 Sep 2012 13:42:04 +0000 (15:42 +0200)]
Add support for cpu_cap and cpu_weight Xen params
This patch adds support for Xen's CPU scheduler 'cpu_cap' and
'cpu_weight' parameters.
Ganeti default values (cap: 0=unlimited, weight: 256) are Xen defaults.
cpu_cap is not validated correctly because of actual Ganeti limitation
on checks. I'd need check methods to get beparams or vcpus to get moved
to hvparams.
Signed-off-by: Sébastien Bocahu <sebastien.bocahu@nuxit.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dato Simó [Wed, 10 Oct 2012 21:05:03 +0000 (22:05 +0100)]
Text.hs: update field lists in parseData comments
The comments in parseData had become out of date with the implementations
of load{Group,Node,Inst}. This commit updates the field list in comments to
match the implementations.
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Sun, 7 Oct 2012 21:26:43 +0000 (23:26 +0200)]
Enable conversion of errors constants
These will be needed for the serialisation of errors.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 4 Oct 2012 23:58:34 +0000 (01:58 +0200)]
LUClusterVerifyGroup: Localize virtual file paths
The check for file consistency didn't properly handle virtual paths
in case of a virtual cluster. This didn't cause any breakage as in
a standard virtual cluster setup with only one node all files are
visible for every node.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 5 Oct 2012 01:06:40 +0000 (02:06 +0100)]
Cleanup haddock documentation a bit
While grepping for htools imports in the non-htools subdirectory, I
saw that our haddock prologue and title are very very old and refer to
the old htools-only state. Let's cleanup a bit…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 5 Oct 2012 01:01:22 +0000 (02:01 +0100)]
Cleanup network timeouts and htools imports
This patch removes the last HTools module imports from non-htools code
(the HTools.Types module), but it requires an associated cleanup:
using luxi-specific constants for luxi timeouts (the only effect is
that one timeout decreases from 15 to 10, the default value in the
python code), and moving of the (now) RAPI specific constants to
RAPI.hs (which allows simplifying their type/usage).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 5 Oct 2012 00:43:24 +0000 (01:43 +0100)]
Cleanup/expand the filter/query tests
This patch cleans up duplicate code in Test.Ganeti.Query.Filter and
then adds a test for names consistency with Python's code behaviour
(stable ordering for simple filters and otherwise niceSort'ed
ordering).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 4 Oct 2012 23:32:06 +0000 (00:32 +0100)]
Add a helper for query field checks
… and also use it to simplify 'needsLiveData'. Additionally, add an
explicit export list to Ganeti.Query.Types, since otherwise we'd
(re)export all imported symbols.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Thu, 4 Oct 2012 01:30:36 +0000 (02:30 +0100)]
Enable query socket usage in gnt-node/gnt-group
This switches gnt-node/gnt-group (and their equivalent RAPI resources)
to go over the query socket.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 4 Oct 2012 01:22:14 +0000 (02:22 +0100)]
Add support for classic queries
This patch adds support for classic-style queries (before query2) to
the query socket server. The patch is rather trivial, since as in
Python we just piggy-back on the query2 implementation.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Thu, 4 Oct 2012 01:08:56 +0000 (02:08 +0100)]
Add a makeSimpleFilter function
And associated unittests. This will be needed for classic-style
queries.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 3 Oct 2012 23:51:00 +0000 (00:51 +0100)]
Fix the node powered field
When initially implementing the node query, I thought the 'powered'
field is a representation of the run-time powered status, which would
make its query complex.
In reality, it's a simple config query, which we can support
easily. We also add a small helper, so that we don't hardcode the
RSUnavail case in many places.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Wed, 3 Oct 2012 23:27:59 +0000 (00:27 +0100)]
Simplify a bit queryFields
We don't add a type class for fully-generic handling, but we do
abstract the duplicate part.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Tue, 2 Oct 2012 23:45:12 +0000 (00:45 +0100)]
Add function for getting a group's merged disk params
… and use it in the Query implementation, removing the last
non-correct query field for Groups.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 5 Oct 2012 00:05:20 +0000 (01:05 +0100)]
Switch ordering of names on query to niceSort
This makes the "all" names queries consistent with the Python
results. The change requires updating the unittests, at which point a
duplicate error message is simplified.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 2 Oct 2012 23:43:46 +0000 (00:43 +0100)]
Use the new name filtering behaviour in query
We do this not quite generically, which means we have to add
another layer in the call chain, and rename the current query
function, plus add special-case code for each query type. Hopefully we
will be able to improve on this in the future.
A (good) side effect of this patch is that we get the desired
ordering when names are requested, matching the Python code.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Tue, 2 Oct 2012 23:39:11 +0000 (00:39 +0100)]
Add functionality for checking validity of names
This replicates in the Haskell Query2 implementation the behaviour of
the Python code: if a "simple" filter is passed (one that contains
only Or aggregators and EQ binary ops on the name field), then an
failure is flagged if the given values are not known.
Our implementation is pretty straightforward, with a few details:
- we ignore any NumericValues passed, since that inconsistency will be
flagged by the filter compiler
- we return an the non-normalized names from the getRequestedNames
function, and not the fully-normalized ones; this will be done later
in individual query functions
- we test a few of the desired behaviours of the above-mentioned
function
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 09:09:33 +0000 (11:09 +0200)]
vcluster: Don't virtualize /etc/hosts path
/etc/hosts is a bit special as it's a system-wide file and the virtual
cluster/node root doesn't apply. The modification of /etc/hosts should
be disabled in virtual clusters. If it isn't, however, the vcluster
functions would raise an exception complaining about a path outside of
the virtual node root. This patch adds a whitelist to exclude
/etc/hosts.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 08:53:00 +0000 (10:53 +0200)]
vcluster-setup: Stop hardcoding /etc/hosts
… use a constant instead.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 08:51:24 +0000 (10:51 +0200)]
qa_utils: Stop hardcoding path to /etc/hosts
- Simplified shell command for adding hosts, too
- The exception handling is also improved by re-raising any exceptions
instead of swallowing qa_error.Error
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 08:51:03 +0000 (10:51 +0200)]
cli: Stop hardcoding /etc/hosts path
There is a constant for this purpose.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 08:42:38 +0000 (10:42 +0200)]
Move constant for /etc/hosts to pathutils
Needed for coming patches.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 09:52:39 +0000 (11:52 +0200)]
bash_completion: Fix mistake introduced in merge 6a74f58
This part of the code was duplicated by accident.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 09:29:55 +0000 (11:29 +0200)]
Merge branch 'devel-2.6'
* devel-2.6:
verify-disks: Explicitely state nothing has to be done
Add list of design documents implemented in version 2.6
Better list of replace-disks arguments + typos fixed
jqueue: Look at archived jobs when watching
Show old primary/secondary node on disk replacement
gnt-instance reinstall: Don't always exit with success
LUClusterVerify: Ignore /proc/drbd if DRBD is disabled
Fixed typos in devnotes.rst
Always_failover doesn't require --allow-failover anymore
bash_completion: Enable extglob while parsing file
rpc: Remove duplicated logic, fix unittests
Annotate disk params on instance_start
cmdlib: Handle locking.ALL_SET correctly when copying locks
Conflicts:
Makefile.am: Sorted file lists
autotools/build-bash-completion: Compact output
lib/rpc_defs.py: instance_start changed on both sides
qa/qa_instance.py: Modified on both sides
test/ganeti.cmdlib_unittest.py: Tests added on both sides
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 09:16:29 +0000 (11:16 +0200)]
Merge branch 'stable-2.6' into devel-2.6
* stable-2.6:
verify-disks: Explicitely state nothing has to be done
Add list of design documents implemented in version 2.6
Better list of replace-disks arguments + typos fixed
jqueue: Look at archived jobs when watching
Show old primary/secondary node on disk replacement
gnt-instance reinstall: Don't always exit with success
LUClusterVerify: Ignore /proc/drbd if DRBD is disabled
Fixed typos in devnotes.rst
Always_failover doesn't require --allow-failover anymore
bash_completion: Enable extglob while parsing file
rpc: Remove duplicated logic, fix unittests
Annotate disk params on instance_start
cmdlib: Handle locking.ALL_SET correctly when copying locks
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 08:58:28 +0000 (10:58 +0200)]
gnt-job list: Add option to include archived jobs
This provides a convenience option to include archived jobs in the
output list. It's equivalent to using “-o +archived”, but tab completion
is nicer.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 08:44:38 +0000 (10:44 +0200)]
gnt-job: List archived jobs if requested
If requested via a filter or by including the “archived” output,
archived jobs will be loaded and shown. This is significantly slower
than just listing normal jobs, therefore by default they are not loaded
at all.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 08:44:12 +0000 (10:44 +0200)]
query: Report data type for unary operators
All data kinds (used to restrict the data collected) referenced in a
filter can be requested once it's been “compiled”. However, the kinds
of fields used in boolean expressions (e.g. ["?", "xyz"]) were not
recorded. This patch changes the code accordingly and provides a unit
test update.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 08:12:07 +0000 (10:12 +0200)]
jqueue: Add new in-memory attribute for archived jobs
This attribute is set to True for jobs which were restored from an
archived file. A new filter will act on this field.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 07:54:40 +0000 (09:54 +0200)]
jqueue: Correct docstring
The description was not accurate.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 11 Oct 2012 09:01:01 +0000 (11:01 +0200)]
Add htools/ganeti-confd to .gitignore
Sorry, this should have went in
b0dcdc10, but I forgot it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 11 Oct 2012 05:21:07 +0000 (07:21 +0200)]
verify-disks: Explicitely state nothing has to be done
Example output:
$ gnt-cluster verify-disks
Submitted jobs 4327
Waiting for job 4327 ...
No disks need to be activated.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 11:15:47 +0000 (13:15 +0200)]
Add basic unit tests for "gnt-cluster epo"
This patch adds some unit tests for “gnt-cluster epo”. Not everything is
covered, but at least the bug fixed in the previous patch is.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 4 Oct 2012 02:44:23 +0000 (03:44 +0100)]
Fixup node disk free/total queries
The disk free/total values are optional ones, wrapped in a Maybe, so
we shouldn't directly serialise them. In order to simplify the
embedded extraction, we add a small helper function.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Dato Simó [Wed, 10 Oct 2012 15:14:56 +0000 (16:14 +0100)]
(htest) Text.hs: fix typo in comment
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 10 Oct 2012 11:45:07 +0000 (13:45 +0200)]
Fix pylint breakage due to unused var in gnt_cluster
The usage of that variable was removed in
45a36f36, but accidentally
the enumerate() was left in.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 4 Oct 2012 02:09:57 +0000 (03:09 +0100)]
Fixup hypervisor queries in node query
We need to only query the default (first enabled) hypervisor, not all
hypervisors. For this, we need to add a manual check to ensure that we
don't have a corrupt config (there's no "NonEmptyList" type…).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 4 Oct 2012 02:08:56 +0000 (03:08 +0100)]
Fixup node live field names
The String parameter to 'nodeLiveFieldExtract' is the query2 field
name, not the RPC-layer field name. Grrr for not having a real data
type for this.
Furthermore, we add some safety check that we don't return JSNull via
rsNormal…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Wed, 10 Oct 2012 05:12:43 +0000 (07:12 +0200)]
Improve Haskell configure options and detection
This patch cleans up the Haskell library detection and defaults.
First, it makes the base compiler/libraries required, per the email discussion.
It then adds two new small autoconf macros, on to check for a required
Haskell library and one to do custom action based on test results. We
use these macros to cleanup and simplify a bit the module detection:
- rapi, confd, and split query are auto detected and enabled if _all_
required libraries are present
- unittests are enabled if _all_ required libraries are present
The patch also updates the documentation regarding required libraries.
After this patch, base Ganeti fully buildable on Debian Squeeze/Ubuntu
Lucid.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Oct 2012 10:17:58 +0000 (12:17 +0200)]
Make regex-pcre an optional dependency
This patch makes regex-pcre optional, allowing its disable via a
preprocessor define NO_REGEX_PCRE. This define will be added to
config.ac/Makefile.am in the next patch.
The patch also changes multi-line strings into string concatenation,
due to limitations with the CPP language extension.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 11:16:30 +0000 (13:16 +0200)]
cluster epo: Fix bug where IndexError is raised
Updating the “node_query_list” variable would fail if no arguments were
passed and the “--all” option wasn't specified. A follow-up patch will
add unit tests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 10 Oct 2012 09:44:13 +0000 (11:44 +0200)]
Add list of design documents implemented in version 2.6
Each version should have its dedicated list.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 2 Oct 2012 23:47:33 +0000 (00:47 +0100)]
Try to auto-enable htools-rapi and split query
We try to automatically enable the htools-rapi and split query (if
confd and htools-rapi are enabled) options. This is our intended
default configuration, and allows easier test of the new code
path. Further cleanups for checking whether confd can be enabled will
come later.
The move block is due to the fact that we first have to check for
htools-rapi, and only then we can auto-enable the feature.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Oct 2012 10:38:50 +0000 (12:38 +0200)]
Fix usage of errors.ResolverError
This exception is documented to have three arguments, but in one case
we raise it with a simple string argument. Let's fix that.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 8 Oct 2012 15:44:01 +0000 (17:44 +0200)]
Remove unused/deprecated error classes
It seems a few of the error classes are no longer used:
- LVMError, deprecated in
8c5533a5 (before ganeti 1.2.2!)
- ConfdRequestError, deprecated in
b0dcdc10
- SshKeyError, introduced in the initial open source commit but never used (⁈)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>