Michele Tartara [Thu, 3 Jan 2013 15:36:56 +0000 (16:36 +0100)]
Improve the reception of replies in the confd client
If a received reply is valid and there is still no valid reply,
keep it, no matter how new it is.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Constantinos Venetsanopoulos [Fri, 28 Dec 2012 14:19:00 +0000 (16:19 +0200)]
Document the ExtStorage `SetInfo' functionality
Small updates to the extstorage design document and interface.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Fri, 28 Dec 2012 14:29:43 +0000 (16:29 +0200)]
gnt-storage man page: make commands sub-sections
This makes the man page more consistent with the others (except
gnt-os, that is).
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 27 Dec 2012 14:59:38 +0000 (15:59 +0100)]
Fix a bad data type in Hcheck.hs
While trying to understand why some code was not being tested, I
realised that we have a bad data type in Hcheck.hs.
We have "data Level = GroupLvl | ClusterLvl", but then we need to pass
the group name/index as well, so we have functions that look like the
following:
f :: Level -> Maybe String -> …
f GroupLvl (Just gname) = …
f GroupLvl Nothing = … -- never used
f ClusterLvl _ = … -- wrong, since a (Just x) could be passed
It's clear that we just need to move the group name in the "GroupLvl"
constructor, and simplify the call chain.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 27 Dec 2012 14:06:11 +0000 (15:06 +0100)]
Move src/Ganeti/HTools/Program.hs to Program/Main.hs
This removes one more tab conflict; this is the last module in our
code where we have both x.hs and x/.
Furthermore, we collapse all actual code into the new Main.hs module,
leaving the htools.hs basically empty (will allow better testing in
the future).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 26 Dec 2012 14:01:21 +0000 (15:01 +0100)]
A bit more name cleanup
- gen-coverage → gen-py-coverage
- coverage-htools.tix → coverage-hs.tix
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 26 Dec 2012 13:19:54 +0000 (14:19 +0100)]
Split the hs-check test rule
Currently, both the unit test and the shell tests are run (manually)
from this rule. This has two downsides: you can't (compile and) run
just one of them easily, and make can't run them in parallel.
By splitting the rules, we can both of the above easily.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 26 Dec 2012 12:52:24 +0000 (13:52 +0100)]
Remove duplicate test file functions
This patch unifies the functions that generated the tree
reorganisation discussion in the first place :)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 26 Dec 2012 12:43:30 +0000 (13:43 +0100)]
Rename test/hs/test to htest
The current base name of 'test' means that this binary will generate
profiling, coverage, etc. files with the name 'test.*', result in
tab-completion conflicts with the test directory. Let's slightly
change its base name for typing easiness.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 26 Dec 2012 12:36:03 +0000 (13:36 +0100)]
Move htest/ files under the test/ tree
htest/data becomes test/data/htools (basically reverting commit
8feabc89), and htest/* becomes test/hs/*.
Most changes beside the rename are trivial s/…/…, with the exception
of autotools/run-in-tempdir, which needed some more changes now that
test/ is not just Python files:
- test/py is still being copied
- test/hs moves from individual symlinks to entire dir symlink
- test/data is symlinked in its entirety
Checked with make distcheck, pep8 and pylint, so at least VPATH builds
are OK.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 25 Dec 2012 23:15:05 +0000 (00:15 +0100)]
Move python test files to test/py
This is the first step of the test files reorganisation: moving test/*
(except test/data) to new directory test/py/.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 26 Dec 2012 12:10:23 +0000 (13:10 +0100)]
Return master ip script output in case of failure
Currently only the exit code is returned, which is somewhat pointless:
for failures, we already know it's ≠ 0, so we don't have enough
information (reported on the mailing list). By logging the output as
well (if any), the user will have more information available for
debugging.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 25 Dec 2012 19:18:14 +0000 (20:18 +0100)]
Replace htools→hs in configure/makefile rules
This continues the cleanup of the 'htools' name, by replacing 'htools'
with 'hs' in configure and makefile rules.
There is still 'WANT_HTOOLS' left as it is correct, but some of the
conditionals in Makefile.am will need some cleanup (in a different
patch).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 24 Dec 2012 22:16:05 +0000 (23:16 +0100)]
Fix LUInstanceRecreateDisks with iallocator
Recent iallocator changes (commit
fb60bc6a, “iallocator: Add node
whitelist”) broke the parameter validation for LUInstanceRecreateDisks
(the other LUs were manually fixed already):
$ gnt-instance recreate-disks -I hail --dry-run instance3
Failure: prerequisites not met for this operation:
error type: wrong_input, error details:
Request is missing 'node_whitelist' parameter
By just defining the new parameter, the LU works normally (“INFO:
Selected nodes for instance instance3 via iallocator hail: node2”).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 24 Dec 2012 21:56:09 +0000 (22:56 +0100)]
Fix dependency on built python sources for hs-check
Since we call into Python for opcodes and other type compatibility
checks, we need to ensure that the python sources are
built. Otherwise, full parallel make might or might not break,
depending on timing.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 24 Dec 2012 16:51:17 +0000 (17:51 +0100)]
Rename htools/ to src/
Per offline discussions, this is the first patch of the
renames. Tested with "make distcheck", seems to work fine.
The only change outside of the renaming is a bit of simplification in
the .gitignore rules; otherwise, simply s/htools/src/.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Sat, 22 Dec 2012 00:19:37 +0000 (01:19 +0100)]
Optimise autotools/run-in-tempdir
I made a mistake when adding support for htools to run-in-tempdir, by
needlessly copying the htools binaries, when it's enough to link
them. The copying is only really needed for python code, so we change
the Haskell binaries to linking and also a few other directories.
Difference:
- before: 0.8s, 95MB copied
- after: 0.6s, 6.2MB copied
And, by the way, can't wait for Python 2.6 as minimum supported
version…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Sat, 22 Dec 2012 16:52:15 +0000 (17:52 +0100)]
Fix building of Constants.hs w.r.t .pyc files
Unless this is run under run-in-tempdir, it will create as usual the
.pyc files.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Constantinos Venetsanopoulos [Fri, 30 Mar 2012 08:41:37 +0000 (11:41 +0300)]
Add ExtStorage related man pages
* ganeti-extstorage-interface man page
* gnt-storage man page
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Wed, 28 Mar 2012 09:32:56 +0000 (12:32 +0300)]
Add the gnt-storage client
Add a new client called 'gnt-storage'.
The client interacts with the ExtStorage interface, similarly to
the way gnt-os interacts with the OS interface.
For now, only two commands are supported: 'info' and 'diagnose'.
'diagnose' calculates the node status of each provider on each node,
similarly to gnt-os diagnose. Furthermore, for every provider, it
calculates it's nodegroup validity for each nodegroup. This is done
inside the LU and not the client (marked as 'TODO' for the global
validity of gnt-os diagnose).
In the future, gnt-storage can be used to manage storage pools,
or even be extended to diagnose other storage types supported by
Ganeti, such as lvm, drbd (INT_MIRROR) or rbd (EXT_MIRROR).
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: fixed Haskell compatibility and style fixes]
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 21 Dec 2012 16:34:17 +0000 (17:34 +0100)]
Extend the hcheck shell tests
This adds a few new hcheck tests, to extend the coverage.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 21 Dec 2012 16:14:20 +0000 (17:14 +0100)]
Extend the hbal shell tests
After this patch, almost all of hbal except the actual Luxi execution
is being covered by unit- or shelltests.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 21 Dec 2012 19:25:13 +0000 (20:25 +0100)]
Merge branch 'devel-2.6'
* devel-2.6:
Final update of NEWS file for 2.6.2 and version bump
Fix job completion with big job queues
confd: reduce noise during normal config reload
Change hbal handling of !auto_balance instances
Small corrections in man pages
Fix gnt-instance(8) w.r.t. growable disk templates
Stop verifying opcode results in dry_run mode
Update NEWS for 2.6.2
Fix TypeError when unsetting OS parameters
cmdlib.py: don't use GetHypervisor
Conflicts:
NEWS (trivial, integrated the 2.6.2 news)
autotools/build-bash-completion (trivial: pathutils)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Iustin Pop [Fri, 21 Dec 2012 18:25:46 +0000 (19:25 +0100)]
Fix build breakage after exclusive storage commits
This fixes:
htest/Test/Ganeti/Rpc.hs:50:14:
Couldn't match expected type `Rpc.RpcCallNodeInfo'
against inferred type `Data.Map.Map String Bool
-> Rpc.RpcCallNodeInfo'
In the first argument of `(<$>)', namely `Rpc.RpcCallNodeInfo'
In the first argument of `(<*>)', namely
`Rpc.RpcCallNodeInfo <$> arbitrary'
by adding the new parameter (empty map for now), and also:
ganeti/constants.py:432:5: E123 closing bracket does not match
indentation of opening bracket's line
By switching to 2-char indentation and (for consistency) also replaces
frozenset(…) with our unique checker (UniqueFrozenset).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Iustin Pop [Fri, 21 Dec 2012 17:50:21 +0000 (18:50 +0100)]
Merge branch 'stable-2.6' into devel-2.6
No conflicts, really trivial.
* stable-2.6:
Final update of NEWS file for 2.6.2 and version bump
Fix job completion with big job queues
confd: reduce noise during normal config reload
Change hbal handling of !auto_balance instances
Small corrections in man pages
Fix gnt-instance(8) w.r.t. growable disk templates
Stop verifying opcode results in dry_run mode
Update NEWS for 2.6.2
Fix TypeError when unsetting OS parameters
cmdlib.py: don't use GetHypervisor
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Thu, 29 Nov 2012 18:35:31 +0000 (19:35 +0100)]
LUs raise an error if they cannot handle exclusive_storage
This happens when the exclusive_storage flag is set, and the requested
operation is incompatible with the flag or not yet supported.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Fri, 7 Dec 2012 18:17:00 +0000 (19:17 +0100)]
Refactor checks for a new template in LUInstanceSetParams
All the checks have been moved to a private method, so as to make
CheckPrereq() smaller and more readable (pylint was complaining about it).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Wed, 28 Nov 2012 12:47:41 +0000 (13:47 +0100)]
Free disk space reporting follows exclusive storage rules
When exclusive_storage is set, nodes report only the space that could be
used to create new disk according to the rules set in the
design-partitioned doc (i.e., non-empty disks are ignored and the space
reserved for rounding/overhead is not reported).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 10 Dec 2012 22:27:03 +0000 (23:27 +0100)]
Call node_info RPCs with the exclusive_storage flag
The flag is read from the configuration and passed to the RPC.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 10 Dec 2012 03:30:03 +0000 (04:30 +0100)]
Add exclusive_storage parameter to node_info RPC
The flag is passed to the low-level functions that need it, but it's not
yet used. Also, RPCs get just a default value for now.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 14:46:06 +0000 (15:46 +0100)]
QA: Support master-netdev and default NIC parameters
Requested in issue 337.
The parameter “bridge” was not documented and is therefore silently
replaced with “master-netdev”. A note is added to “qa-sample.json”
describing how comments work.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 14:21:39 +0000 (15:21 +0100)]
QA: Do not pass "--bridge" to "gnt-cluster init"
Commit ec0652a (June 2009) removed the option.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 21 Dec 2012 13:44:52 +0000 (14:44 +0100)]
gnt-* list-fields: Show friendly field type
For people writing query filters (documented in ganeti(7)) knowing a field's
type can be useful.
$ gnt-instance list-fields name be/memory
Name Type Title Description
name Text Instance Instance name
be/memory Storage size ConfigMaxMem The "maxmem" backend parameter
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 21 Dec 2012 11:56:59 +0000 (12:56 +0100)]
Fix build after addition of 'empty-cluster.data'
Of course I forgot to add this to TEST_FILES… and only distcheck
catches it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michael Hanselmann [Fri, 21 Dec 2012 13:26:20 +0000 (14:26 +0100)]
Improve assertion message in LUClusterVerifyGroup
In issue 240 this assertion fails. While reproducing was not possible
with the master branch, having a more verbose message can't hurt.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 13:09:09 +0000 (14:09 +0100)]
gnt-network(8): Reorder commands
Hiding the “connect” and “disconnect” commands below the tag operations
isn't good. The same is done in “gnt-instance.rst”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 13:08:24 +0000 (14:08 +0100)]
gnt-network(8): Re-add editor settings and re-wrap
Commit a04cc7a added “gnt-network.rst”, but didn't copy the editor
settings from another reST file.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Wed, 21 Nov 2012 19:37:00 +0000 (20:37 +0100)]
LVM disk creation uses dedicated PVs
When exclusive_storage is set, PVs are allocated according to the
design-partitioned design doc.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 10 Dec 2012 22:12:39 +0000 (23:12 +0100)]
Call blockdev_create RPCs with the exclusive_storage flag
The flag is read from the configuration and passed to the RPC.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 10 Dec 2012 01:12:26 +0000 (02:12 +0100)]
Add exclusive_storage parameter to blockdev_create RPC
The flag is passed to the low-level functions that need it, but it's not
yet used.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Wed, 21 Nov 2012 13:32:31 +0000 (14:32 +0100)]
Added class to contain information about a PV
This makes the code more readable and easier to upgrade.
bdev.LogicalVolume.GetPVInfo and the code that depends on it have been
refactored to use the new class.
utils.CheckVolumeGroupSize() has been moved to lib/utils/lvm.py, where more
functions will be added.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 20 Dec 2012 18:52:07 +0000 (19:52 +0100)]
Add htest/hroller to .gitignore
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 20 Dec 2012 18:52:06 +0000 (19:52 +0100)]
Extend hroller shell tests
Currently only --help and --version are tested; the patch extends this
with testing parsing of an empty cluster, of a cluster with one group,
and other command line behaviours.
It also adds testing for --help-completion for all htools binaries.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Fri, 21 Dec 2012 10:11:03 +0000 (10:11 +0000)]
Silence erroneous hlint warning
This patch adds an ignore for an hlint warning that wants camelcase to be used
in the name of a "case" test.
But if camelcase is used, it is not a valid test name anymore.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 12:57:20 +0000 (13:57 +0100)]
opcodes: Common parameter for target groups
Also add a missing parenthesis at the end.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 13:06:26 +0000 (14:06 +0100)]
gnt-network: Fix CLI issues with node groups
The original implementation reserved the name “all” to specify all node
groups. That would prevent the use of a node group actually named “all”.
This patch changes the order and definition of the command line
arguments for “gnt-network connect” and “… disconnect” to have the
group(s) as the last argument(s). If no groups are specified all groups
are used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 13:08:47 +0000 (14:08 +0100)]
gnt-network(8): Remove "rename"
It is not implemented after all.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 11:28:54 +0000 (12:28 +0100)]
gnt-network CLI improvements
- Use unpacking instead of addressing indivdual list items
- Add “--submit” and “--priority” support where possible
- Re-use LUXI client where possible
- Fixed some typos
There is still an issue that a node group named “all” can not be
connected or disconnected. More changes are needed for that.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 11:01:24 +0000 (12:01 +0100)]
Improve network query algorithm
Similar to commit 572a277. Directly iterate over “self.wanted” instead
of iterating through all networks and checking if they're wanted.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 11:01:08 +0000 (12:01 +0100)]
Change network error text
This error is thrown if a network name already exists, not if the
network itself (e.g. “1.2.3.0/24”) is defined.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 11:00:44 +0000 (12:00 +0100)]
Format network field "group_list" in client
The field is now a list of tuples containing the group name, mode and
link.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Dimitris Aragiorgis [Thu, 20 Dec 2012 14:16:39 +0000 (16:16 +0200)]
Fix iallocator for nodegroups with no tags
_ComputeNodeGroupData() raises error if a group has no tags
when list(gdata.tags) is invoked. Use “gdata.GetTags()” instead.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 20 Dec 2012 16:29:46 +0000 (17:29 +0100)]
Replace custom strip newlines in UUID generation
Since now rStripSpace lives in Utils.hs, we can use it directly (as
UUIDs shouldn't contain spaces anyway).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michele Tartara [Fri, 14 Dec 2012 14:32:34 +0000 (14:32 +0000)]
Add Confd client to the Haskell code base
The client queries all the master candidates in parallel, until the minimum
number of replies, defined in the constant file, is received.
A timeout prevents the waiting from being of indefinite length.
The reply to be returned to the function that made the query is decided
according to the Confd design document.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Tue, 18 Dec 2012 14:51:09 +0000 (14:51 +0000)]
Add function to fetch the list of master candidates
This commits adds to the Haskell codebase a function to fetch the list of
IPs of the master candidates from the SSConf database.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Mon, 17 Dec 2012 16:10:28 +0000 (16:10 +0000)]
Add the parseReply function to the Confd utils
This function will be used by the Haskell Confd client to parse the replies
it receives from the server.
Unit test is included as well.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Mon, 17 Dec 2012 14:51:11 +0000 (14:51 +0000)]
Rename the Confd utils parseMessage function to parseRequest
With the upcoming implementation of the Haskell Confd client, requests will
no longer be the only kind of message to be parsed, therefore the parsing
function for requests is being renamed to be more specific, and to better fit
with the upcoming parseReply.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Mon, 17 Dec 2012 14:34:17 +0000 (15:34 +0100)]
Make the parseRequest function more general
The parseRequest function of the Confd utils can be used to parse both request
(in the server) and reply (in the client, soon to be implemented) signed
messages.
This patch changes the signature of the function to allow this, and its name
accordingly.
A unit test is updated as well.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Thu, 20 Dec 2012 09:03:15 +0000 (09:03 +0000)]
Add function for generating UUIDs in the Haskell codebase
Its first use will be to generate the salt for ConfD requests of the Haskell
client, as in the Python client.
Unit test added as well.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michele Tartara [Tue, 11 Dec 2012 11:11:12 +0000 (12:11 +0100)]
Move Confd getCurrentTime to Utils
The Confd server implementation has a getCurrentTime function.
This commit moves it to the Utils.hs file of Confd, so that it will be
available to be used by the future Confd client as well.
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 20 Dec 2012 15:43:38 +0000 (16:43 +0100)]
Fixup too-long-line in Objects.hs
Sorry, didn't see this before pushing the previous commit (
277a2ec9).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Constantinos Venetsanopoulos [Fri, 7 Sep 2012 10:15:40 +0000 (13:15 +0300)]
ExtStorage support in htools
This just adds new constructors for the disk template and related
types, enabling the Ext storage.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 20 Dec 2012 12:30:44 +0000 (13:30 +0100)]
confd: strip newlines before logging the request
The Python confd client sends newlines in messages (due to use of
DumpSignedJson/DumpJson), so that results in ugly debug output.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 20 Dec 2012 11:36:56 +0000 (12:36 +0100)]
Move rstripSpace from Ssconf to Utils
Also renames it in the process and adds a few tests for it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 14:45:57 +0000 (15:45 +0100)]
objects.NIC: Look up mode only once, capitalize acronym
Look up “NIC_MODE” only once, capitalize “NIC” in error messages.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 14:40:57 +0000 (15:40 +0100)]
gnt-cluster(8): Quoting, small fixes
Quote fixed strings where appropriate and replace “nic” (an acronym)
with “network interface”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 14:40:47 +0000 (15:40 +0100)]
Add utility to format dictionary as key=value strings
This will be used in QA to format network interface parameters.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Constantinos Venetsanopoulos [Fri, 7 Sep 2012 10:02:27 +0000 (13:02 +0300)]
Adjust LUInstanceSetParams wrt the `ext' template
Initial support for the `ext' template in gnt-instance modify.
Take care of all needed checks in CheckArguments and CheckPrereqs
wrt ExtStorage Providers and ext-params.
ExtStorage disk addition and specification of arbitrary ext-params
during addition is supported.
Currently, one cannot modify an existing disk's ExtStorage Provider,
neither can change an existing disk's ext-params. Only an existing
disk's `mode' can be modified.
Removal is transparent of the disk template and is also supported.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: fix bug in disk changes, pylint fixes]
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Wed, 28 Mar 2012 09:29:22 +0000 (12:29 +0300)]
Multiple ExtStorage Providers and ext-params
Add support for passing parameters to the ext template (ext-params).
Take advantage of disk-params, that don't seem to make much sense in
this template (ExtStorage Providers are not predefined and we don't
know their needs) and use them to pass the ext-params dynamically to
the template.
ext-params are correlated with gnt-os-interface's os-params.
All ext-params are exported to the ExtStorage Provider through it's
environment, with variables prefixed with 'EXTP_' (similarly to the
OS interface's 'OSP_' params).
ext-params are passed via the --disk option. If the disk template
is of type `ext', then any additional options passed to --disk and
are not in IDISK_PARAMS are considered ext-params e.g.:
gnt-instance add -t ext --disk=0:size=2G,param1=value1,param2=value2
Finally, we introduce a new IDISK_PARAM called IDISK_PROVIDER, that is
mandatory for template `ext' and is used to select the desired
ExtStorage Provider. This parameter is not a valid --disk option for
any other template type.
The IDISK_PROVIDER parameter becomes the first element of the
disk's unique_id tuple e.g.:
unique_id = ('sample_provider1', 'UUID.ext.diskX')
Example selecting different ExtStorage Providers for each disk and
passing different ext-params to them:
-t ext --disk=0:size=2G,provider=sample_provider1,param1=value1
--disk=1:size=3G,provider=sample_provider2,param2=value2
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: small simplification in bdev code, pylint fixes]
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Mon, 12 Mar 2012 15:49:18 +0000 (17:49 +0200)]
Implement the External Storage Interface
With this commit we introduce the External Storage Interface
to Ganeti, abbreviated: ExtStorage Interface.
The ExtStorage Interface provides Ganeti with the ability to interact
with externally connected shared storage pools, visible by all
VM-capable nodes. This means that Ganeti is able to handle VM disks
that reside inside a NAS/SAN or any distributed block storage provider.
The ExtStorage Interface provides a clear API, heavily inspired by the
gnt-os-interface API, that can be used by storage vendors or sysadmins
to write simple ExtStorage Providers (correlated to gnt-os-interface's
OS Definitions). Those Providers will glue externally attached shared
storage with Ganeti, without the need of preprovisioned block devices
on Ganeti VM-capable nodes as confined be the current `blockdev' disk
template.
To do so, we implement a new disk template called `ext' (of type
DTS_EXT_MIRROR) that passes control to externally provided scripts
(the ExtStorage Provider) for the template's basic functions:
create / attach / detach / remove / grow
The scripts reside under ES_SEARCH_PATH (correlated to OS_SEARCH_PATH)
and only one ExtStorage Provider is supported called `ext'.
The disk's logical id is the tuple ('ext', UUID.ext.diskX), where UUID
is generated as in disk template `plain' and X is the disk's index.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: small simplification in bdev code, pylint fixes]
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 13:22:27 +0000 (14:22 +0100)]
Stop all daemons on cluster initialization
Addresses issue 145. When daemons are still running from a previous
cluster instance, starting the daemons again will fail.
“ConfigWriter.IsCluster” only looks at the configuration file, which
could already have been deleted.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Helga Velroyen [Wed, 19 Dec 2012 16:21:57 +0000 (17:21 +0100)]
Make node groups' networks field a dict of nicparams
The networks field of the node groups class is a dictionary
of nic params and not a list of networks. This should fix
the broken QA.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Mon, 2 Apr 2012 17:05:51 +0000 (20:05 +0300)]
Update the shared storage design document
Update the shared storage design document to reflect the current
changes, after the implementation of the ExtStorage interface.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: small style fixes]
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 20 Dec 2012 10:45:44 +0000 (11:45 +0100)]
Final update of NEWS file for 2.6.2 and version bump
I'm already setting this to a release date of tomorrow, since QA on
the 2.6 branch has been clean.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 20 Dec 2012 09:53:36 +0000 (10:53 +0100)]
netutils: Normalize all FQDNs
Addresses issue 147. Only the hostnames resolved using
“netutils.Hostname($name)” were normalized, but those returned by the
class method “GetSysName” weren't.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Iustin Pop [Wed, 19 Dec 2012 22:29:30 +0000 (23:29 +0100)]
Display command description in htools usage message
By abstracting the command/personality formatting, we can easily
switch htools to the same output as the rest of the commands.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Wed, 19 Dec 2012 17:06:14 +0000 (18:06 +0100)]
More style updates for network-related code
Error message formatting, else/if merging to elif, docstrings.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 14:00:12 +0000 (15:00 +0100)]
NEWS: Opportunistic locking, clarifications
Some rewording, some clarifications, and a new item on opportunistic
locking.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 14:00:01 +0000 (15:00 +0100)]
cmdlib: Additional opportunistic locking check
If opportunistic locking is requested in the opcode, but no iallocator
is used (not specified or no default), an error will be raised.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Wed, 19 Dec 2012 17:34:38 +0000 (18:34 +0100)]
Detect wrong Python module structure
If, for one reason or another, a module named "ganeti.ganeti" can be
succesfully imported (e.g. through a symlink in the wrong place), error
which are diffcult to debug can occur. This piece of code tests for the
unlikely case of that happening.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 19 Nov 2012 14:49:48 +0000 (15:49 +0100)]
Use hroller to print nodes to reboot by groups
This is highly incomplete, as per the manpage BUGS section.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 15 Nov 2012 10:21:36 +0000 (11:21 +0100)]
Add hroller htools personality
This is a new personality that for the moment doesn't do anything.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Dec 2012 12:33:02 +0000 (13:33 +0100)]
Fix QA for --offline semantics modification
The previous patch series made it simpler to deal with ERROR_up offline
instances, but didn't fix qa, that had the old expectations. This fixes
that, and adds more testing about the expected behavior.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Dec 2012 13:43:37 +0000 (14:43 +0100)]
One more offline+shutdown fix
Currently gnt-instance shutdown --force of an offline instance
resets the offline status. Which of course is bad and completely
unintended. Fix. (caught by the new qa tests)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 19 Dec 2012 14:59:19 +0000 (15:59 +0100)]
Fix network LUs use of error code in OpPrereqError
Currently, most network LUs simply use EINVAL instead of correct error
codes; this patch tries to adjust the obvious cases.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 13:11:05 +0000 (14:11 +0100)]
_NetworkQuery: Simplify statistics computation
The code can loop directly over “self.wanted”, saving a lookup. An
explicit loop is also replaced with a generator.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 17:44:23 +0000 (18:44 +0100)]
cmdlib: Factorize network conflict detection
LUNetworkConnect and LUNetworkDisconnect had very similar code to detect
conflicts between instance's network interfaces and networks. This code
factorizes the common part and does some cleanup:
- Remove single-letter variable for lambda (“l”)
- Don't repeat instance name in warning output
- Fixed error messages to match style guide
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 17:21:33 +0000 (18:21 +0100)]
gnt-network: Fix import for textwrap
The style guide says to use “import foo”-style imports, not “from foo
import bar” unless it's a Ganeti module. There are some places with
exceptions, but this one certainly isn't warranted. Also fix the import
order.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 17:19:59 +0000 (18:19 +0100)]
gnt-network add: "--network" is required
Also do some minor code re-formatting.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:48:30 +0000 (17:48 +0100)]
cmdlib: Replace period with colon in error message
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:38:54 +0000 (17:38 +0100)]
query: Factorize code for getting statistics value
This was not only copied for the networking fields in commit
306bed0e,
but commit
cfcea7ef fixed wrongly ordered parameters and didn't fix the
original. Either way, this patch merges the two cases again. The newly
added function is already tested through the tests for
_GetLiveNodeField.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:42:16 +0000 (17:42 +0100)]
gnt-network(8): s/ipv6/IPv6/
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:21:16 +0000 (17:21 +0100)]
gnt-network add: Network mode bash completion
This makes entering the command easier.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:21:05 +0000 (17:21 +0100)]
OpNetworkConnect: Check for network mode
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:20:36 +0000 (17:20 +0100)]
Use generated field list in gnt-network.8
The list of query fields can be automatically generated.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Dec 2012 16:19:48 +0000 (17:19 +0100)]
Improve descriptions of network query fields
They should be in the same style as other descriptions.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 10 Dec 2012 17:45:26 +0000 (18:45 +0100)]
Replace frozenset with compat.UniqueFrozenset
This is not a trivial s/frozenset/compat.UniqueFrozenset/, but rather
only replaces “frozenset” where appropriate. Most of the places are
“static” information that doesn't change after the module has been
loaded.
Some docstrings and code formatting (e.g. empty lines) issues are
addressed as well. Some lines got too long and were wrapped.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Helga Velroyen [Wed, 19 Dec 2012 15:27:41 +0000 (16:27 +0100)]
Renaming fam -> net_family on test network generation
Small renaming to make the test more readable.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Helga Velroyen [Tue, 18 Dec 2012 13:29:08 +0000 (14:29 +0100)]
Serialization compatibility test for node groups
This creates a number of node groups with up to 3 networks,
serializes them and compares them with their python equvalents.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Helga Velroyen [Tue, 18 Dec 2012 13:33:37 +0000 (14:33 +0100)]
Add a network fields to NIC params and node group type
This adds a network field to the NIC params and a list of networks
to the node group type. It adjusts the nodegroup's unit tests accordingly.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>