Bernardo Dal Seno [Fri, 1 Feb 2013 15:31:43 +0000 (16:31 +0100)]
Moved uniformity check for exclusive_storage flag
Cluster-verify used to check that the value of exclusive_storage is uniform
within node groups. Now, it's impossible to change the flag for a single
node, so that check has been removed and an equivalent one has been added
in ConfigWriter.VerifyConfig(). Unit test provided. The unit test covers
only the new check, not the whole VerifyConfig method.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Fri, 1 Feb 2013 14:46:54 +0000 (15:46 +0100)]
"exclusive_storage" cannot be changed on single nodes
There's never been support for a configuration where nodes in the same node
group have different values of the exclusive_storage flag. This patch
disables the possibility to change the flag for individual nodes.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Wed, 6 Feb 2013 13:52:30 +0000 (14:52 +0100)]
Upgrades made on loading the configuration are always saved
Before, only some upgrades were written back to the configuration file. A
little refactoring of _UpgradeConfig() has been done to write unit tests.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 8 Feb 2013 15:51:25 +0000 (16:51 +0100)]
Show correct daemon name on Luxi connect errors
Since now confd also serves a Luxi endpoint, the current message in
cli.FormatError is misleading when actually failing to connect to
it. The patch adds a somewhat hackish way to show the right daemon
name.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 8 Feb 2013 14:47:07 +0000 (15:47 +0100)]
Update the security document for Ganeti 2.7
This should address 359, but I'm not sure if it covers all of 2.7…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Thu, 7 Feb 2013 13:30:38 +0000 (14:30 +0100)]
OS environment: add network information
1) Move the hooks environment dict generator inside the object. This
also adds missing values such as network family and uuid.
2) Use the same generator both for the os environment and for the
instance hooks.
3) Update manpage and hooks documentation.
Also update a forgotten docstring about a tuple's content.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 8 Feb 2013 07:44:48 +0000 (08:44 +0100)]
ConfigData: run UpgradeConfig on network objects
Although this does nothing for now, running it is safe, and consistent
with how other objects behave.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 7 Feb 2013 14:47:48 +0000 (15:47 +0100)]
Make ParticalNic's network field of type String
This was applied to "master" along with extra changes affecting the
master branch only. Cherry-picking just the Objects.hs change.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 8 Feb 2013 09:47:04 +0000 (10:47 +0100)]
Make gnt-os list work with no OSes
When absolutely no OSes are present on the cluster, the result of
OpOsDiagnose is an empty list. This is currently handled in gnt-os as
an error condition, probably due to how OpOsDiagnose used to return
errors in the past.
However, with the query backend, an empty list is a reasonable answer,
so I see no reason why gnt-os should treat that as an error,
especially as it doesn't give any hint of what is "wrong". Simply
removing that code block allows it to proceed normally, and list no
OSes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 8 Feb 2013 09:34:45 +0000 (10:34 +0100)]
Fix OCF files installation in devel/upload
LIBDIR was not defined, so the files ended up directly under /, not
good. Now they're properly installed under /usr/lib/ocf, as per
http://linux-ha.org/wiki/OCF_Resource_Agents.
Also add "set -u" to prevent future occurrences of this kind of bug.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Fri, 8 Feb 2013 09:52:26 +0000 (10:52 +0100)]
baserlib: Fix two mistakes in docstring
The method names were wrong due to copy & paste.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 7 Feb 2013 13:32:49 +0000 (14:32 +0100)]
Workaround hlint behaviour with no warnings/errors
When hlint sees a perfectly nice code tree, it will skip generating
the reports (both stdout and html). This means that usually the old
report will remain in place, so it makes development harder, as the
html file is out of sync with the tree.
To workaround this, we generate an empty/minimal file in this case.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 7 Feb 2013 13:22:01 +0000 (14:22 +0100)]
Remove use of 'head' and add hlint warning for it
Since 'head' is unsafe to use in most cases, this patch removes its
use from most of the code, adds a lint warning for it (and for tail as
well), and adds override annotations in the few cases where it's
actually OK to use it (mainly when using head over the result of
functions which guarantee to return a non-empty list by documentation,
not type).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Wed, 6 Feb 2013 13:11:35 +0000 (14:11 +0100)]
Add release date for 2.7.0 beta1
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Guido Trotter [Mon, 4 Feb 2013 14:28:41 +0000 (15:28 +0100)]
Version bump for 2.7.0~beta1
Also update the documentation target versions and the cfgupgrade tool to
recognize 2.6 and upgrade to 2.7
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 6 Feb 2013 10:28:12 +0000 (11:28 +0100)]
Update hooks.rst for Ganeti 2.7
- The migrate instance hook now also executes on the primary node in
the "pre" phase.
- Instance hooks now get full network information on each nic, if a
nic's network is set.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 5 Feb 2013 15:26:04 +0000 (16:26 +0100)]
Redirect output for gnt-* list/list-fields commands
This enabled the redirection; QA output after this patch should become
much much smaller (on a 'quick' QA, we are left with ~0.5MB output on
stdout and 64MB redirected output).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 5 Feb 2013 15:24:05 +0000 (16:24 +0100)]
Add function to execute QA commands with redirected output
Some QA commands generate non-trivial output: for a full QA, the gnt-*
list commands generate more than 300MB of data. To make the QA logs
more parseable by humans, we need support for redirecting output of
commands to a different place.
This patch adds a 'AssertRedirectedCommand' that does this,
redirecting the output to a (fixed) log file in the Ganeti log
directory.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 5 Feb 2013 15:22:00 +0000 (16:22 +0100)]
Implement option to skip logging of QA commands
This patch adds an optional kwarg that allows skipping the "Command:
…" line in QA output. This is helpful if we only need to run some
maintenance actions, that are QA-related and not Ganeti-related.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 5 Feb 2013 13:04:14 +0000 (14:04 +0100)]
Fix typo in a comment
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Iustin Pop [Mon, 4 Feb 2013 13:52:43 +0000 (14:52 +0100)]
Add some more Haskell/Python equivalence tests
This would have caught the log file problem fixed in the previous
patch (
9411474b), for example. Also we test user/group equivalence,
name only.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 4 Feb 2013 13:34:33 +0000 (14:34 +0100)]
Fix Haskell log file naming after virtual cluster changes
Commit
3329f4de changed the Haskell log file from constants to
functions, but introduced a bug: it uses now the daemon name instead
of the correct log file, which means "ganeti-confd.log" instead of
"conf-daemon.log".
In order to fix this, we need to abstract the log file base (in
constants.py) into a separate set of constants, so that we can reuse
it in the Haskell code.
This fixes issue 343.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Fri, 1 Feb 2013 17:32:42 +0000 (18:32 +0100)]
QA: Clean up after "instance-remove-drbd-offline" test
This test used to leave a node with orphan logical volumes and unused DRBD
minors. Now, the expected leftovers are cleaned up after the test, and
cluster-verify is run.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 4 Feb 2013 10:12:23 +0000 (11:12 +0100)]
Switch KVM to multi-error verify results
This uses the new _FormatVerifyResults helper function to return
multiple errors.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 4 Feb 2013 09:57:22 +0000 (10:57 +0100)]
Make LXC fail verification if cgroup is not mounted
Since LXC now relies on cgroup memory limits to enforce memory, let's
make hypervisor verification (and thus cluster-verify) return errors
when the cgroup filesystem is not mounted.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 4 Feb 2013 10:10:14 +0000 (11:10 +0100)]
Add a helper function for hypervisor verification
This will allow easier multi-error results from hypervisors; right
now, we only report the first error, which is not nice.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Sat, 2 Feb 2013 12:06:27 +0000 (13:06 +0100)]
hv_lxc: fix whitespace errors
The latest lxc patches included a few whitespace style errors, that make
lint fail. This patch fixes those.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Sat, 2 Feb 2013 11:38:49 +0000 (12:38 +0100)]
s/nic/NIC/ in manpages
For consistency, let's make sure NICs are capitalized always in the same
way.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Faidon Liambotis [Sun, 23 Dec 2012 16:14:25 +0000 (18:14 +0200)]
LXC: add support for the memory controller
Add support for the memory resource controller, useful to actually place
memory limits on instances.
Support is still optional, in case the kernel doesn't have it compiled
in, or -in the case of Debian- has it dependent on a kernel command-line
switch (cgroup_enable=memory specifically).
Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Faidon Liambotis [Sun, 23 Dec 2012 16:14:24 +0000 (18:14 +0200)]
LXC: adapt hv for newer lxc userspace tools
Currently hv_lxc depends on the behavior and output of older LXC tools,
which have since changed, making it unable to function in current
distributions (e.g. Debian wheezy).
Adapt the tools and expectation for the output and make it into a
working state again, at least for LXC 0.8.0.
LXC tools seem to be split into two categories: the actual, binary lxc
tools, plus a set of shell scripts to provide a higher-level interface.
Ganeti doesn't need the latter and the shell scripts make some
assumptions (like /var/lib/lxc) so remove the only reference to such a
shell script (lxc-ls).
While at it, remove a few comments about "current (Spring 2010)
distributions" that do not apply anymore.
This is a backwards-incompatible change, meaning it won't work on
systems with older LXC userspace. However, hv_lxc is experimental anyway
and there's virtually no documentation about it in the tree.
Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michele Tartara [Fri, 1 Feb 2013 13:46:04 +0000 (14:46 +0100)]
Fix typo in ganeti-noded man page
Add a missing "in".
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 28 Jan 2013 16:26:40 +0000 (17:26 +0100)]
QA: Run instance tests with different cluster configurations
Instance tests are run with or without the exclusive-storage flag set. More
configurations can be added easily.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Sat, 26 Jan 2013 01:40:03 +0000 (02:40 +0100)]
QA: Run cluster-verify after instance tests
We want to make sure that instance operations don't leave the cluster in a
bad state. The "instance-remove-drbd-offline" test leaves some debris
behind, so it's been moved to the last position.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Wed, 23 Jan 2013 16:23:48 +0000 (17:23 +0100)]
QA: Refactored launching of the various instance tests
The code launching instance tests for "plain" and "drbd" templates has been
unified. In this way it's easier to add more templates, and to re-use the same
tests with different configurations.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 25 Jan 2013 20:39:38 +0000 (21:39 +0100)]
QA: Use lists of nodes as argument to instance tests
Some instance test functions took two node arguments, some took one, and
some took two but the second argument could be None. This patch makes such
functions uniform by using a list of nodes as an argument. This simplifies
the following refactoring.
No test logic has been changed.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 25 Jan 2013 20:01:23 +0000 (21:01 +0100)]
QA: Instance tests check the configuration before running
Instance test functions check the current configuration, and they will run
the actual tests only if the configuration supports them. This will be
used for refactoring in following patches.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 25 Jan 2013 18:06:40 +0000 (19:06 +0100)]
QA: Added functions to allocate/free N nodes at once
These make possible to simplify the logic of tests requiring more
nodes. Used in the following patches.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Mon, 28 Jan 2013 12:55:50 +0000 (13:55 +0100)]
QA: Added exclusive_storage to qa_config
QA configuration now tracks the state of the exclusive_storage flag at
cluster level. This will be used to selectively enable tests according to
the configuration.
Also, it's now possible to specify the initial value of the
exclusive_storage flag in the configuration file.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 28 Jan 2013 15:46:23 +0000 (16:46 +0100)]
QA: Better initialization of a global dictionary
The global 'cfg' variable is initialized to an empty dictionary, so there
is no more need to disable some pylint checks.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Tue, 22 Jan 2013 16:41:12 +0000 (17:41 +0100)]
QA: Added disk template to config
The disk templates used by the instances are tracked in the QA
configuration. This will be used to selectively enable tests according to
the configuration.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Tue, 29 Jan 2013 17:11:31 +0000 (18:11 +0100)]
QA cleanup: Removed instance-disk-failure test
The test was broken, out of sync with the rest of the code, and prone to
crashes. Until someone does a better job, it's better to remove the
test. This simplifies further refactoring.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Sat, 26 Jan 2013 02:38:10 +0000 (03:38 +0100)]
QA fix: TestInstanceExportWithRemove() updates configuration
When the instance is removed from the cluster by this test, it's also freed
in the QA configuration.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Mon, 21 Jan 2013 13:58:55 +0000 (14:58 +0100)]
QA: Cluster-verify reports shared PVs with exclusive storage
Exclusive storage forbids sharing PVs between unrelated LVs. This is a test
that cluster-verify correctly report such cases.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Wed, 30 Jan 2013 21:44:24 +0000 (22:44 +0100)]
QA: Added constants for LVM volumes
The LVM volume group becomes a configurable parameter, and a prefix for
logical volume names used in tests is introduced as a constant.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Fri, 18 Jan 2013 20:00:21 +0000 (21:00 +0100)]
QA: Templates incompatible with exclusive storage reported
Cluster-verify should report instances whose disk template is not
compatible with the exlusive storage setting.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 18 Jan 2013 17:52:25 +0000 (18:52 +0100)]
QA: Uniformity check for exclusive_storage in cluster-verify
Cluster-verify should report nodes in the same nodegroup with different
values of the exclusive_storage flag.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Wed, 16 Jan 2013 10:49:20 +0000 (11:49 +0100)]
QA: Test for basic features of exclusive storage
Check that creation of instances doesn't trigger any error.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 18 Jan 2013 16:57:08 +0000 (17:57 +0100)]
QA: Added function to read cluster configuration fields
This function will be used in following patches.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 18 Jan 2013 15:35:55 +0000 (16:35 +0100)]
QA: Added function to check cluster-verify result
Now it's possible to check that cluster-verify reports all the expected
errors, instead of simply checking that it fails.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Thu, 31 Jan 2013 12:53:12 +0000 (13:53 +0100)]
Document better gnt-network
Specify clearly that the nic parameters depend on the
network-to-nodegroup connection.
Clarify in gnt-network how instance nics are connected to a network.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Guido Trotter [Thu, 31 Jan 2013 12:46:02 +0000 (13:46 +0100)]
Fix the gnt-instance section in the htools manpage
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Guido Trotter [Thu, 31 Jan 2013 11:39:57 +0000 (12:39 +0100)]
update 2.7 NEWS file
Include a handful of important changes that weren't mentioned.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Guido Trotter [Wed, 30 Jan 2013 10:27:54 +0000 (11:27 +0100)]
Update 2.7 design doc
Move two designs that have been implemented in 2.7 to design-2.7 and out
of drafts.
Other designs were partly implemented: explain what part was, and leave
them as drafts pending their completion.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 30 Jan 2013 16:31:25 +0000 (17:31 +0100)]
Disable live-RPC queries under split query
Currently, the node listing RPC is very slow due to missing
parallelisation. For the 2.7 release, we reset these back to masterd,
hoping to revert them by the time 2.8 is ready.
There are a number of queries that I've left pointing to confd, as
they are non-RPC:
- node fields query
- node static fields query (and added a note in one case where it
could become a problem)
All the other converted queries (job listing, group queries, tags,
cluster config) remain pointing to confd, as they don't use RPC.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Wed, 30 Jan 2013 15:21:22 +0000 (16:21 +0100)]
hv_kvm: Original error message, keyword parameter
- Include original error message when creating TAP interface failed
- Pass keyword parameter as such
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dato Simó [Mon, 28 Jan 2013 17:56:38 +0000 (17:56 +0000)]
CLI.hs: fix double spaces in option help strings
Some help strings with continuation backslashes ('\') were providing a
space both before and after the backslash, resulting in double spaces in
help output. Provide it only after the backslash, which fixes the issue and
is consistent with the rest of the file.
Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Mon, 28 Jan 2013 16:49:51 +0000 (17:49 +0100)]
Add new NIC parameter to man page of 'gnt-instance'
According to doc/design-network.rst, there is a new NIC
parameter 'network', which can be used to link an instance
to a network. This was so far undocumented in the man
page of 'gnt-instance'.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Benjamin Kerensa [Tue, 22 Jan 2013 00:32:08 +0000 (16:32 -0800)]
Fix spelling issue in hroller.rst
'explicitly' was spelled the wrong way
Signed-off-by: Benjamin Kerensa <bkerensa@ubuntu.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 25 Jan 2013 11:31:22 +0000 (12:31 +0100)]
kvm: fix bug while fetching -device list
_GetKVMOutput expects the command to succeed, but unfortunately on some
versions of kvm "-device ?" will output a correct list of devices, while
exiting with an error code.
To fix this we accept failure in that case (note that this doesn't
change the situation when this command is not supported, as in that case
the output will still not contain the correct string).
This patch also updates the docstring, adding the parameter types and
description.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 24 Jan 2013 13:29:18 +0000 (14:29 +0100)]
hv_xen: Remove config after shutdown was successful
If stopping an instance failed, the configuration would already be gone
and other operations depending on it (e.g. migration) would no longer
work. With this patch the configuration file is only removed once the
instance was succesfully stopped or destroyed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michael Hanselmann [Wed, 23 Jan 2013 17:41:34 +0000 (18:41 +0100)]
hv_*: Always return from Verify, style fixes
Change all “Verify” methods in hypervisor abstractions to explicitely
return None if no problem was detected. Remove punctuation from error
messages. Update docstrings with “@return” and some small mistakes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 21 Jan 2013 21:43:24 +0000 (22:43 +0100)]
_VerifyErrors()._Error() and _ErrorIf() are now consistent
_Error() didn't contain the logic for demoting errors to warnings and for
marking an operation as failed. Now _ErrorIf() is just a minimal wrapper
for _Error().
Unit tests included.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 23 Jan 2013 13:37:42 +0000 (14:37 +0100)]
Merge branch 'master' into devel-2.7
* master:
Handle the result of QueryGroups() correctly
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dimitris Aragiorgis [Tue, 22 Jan 2013 13:58:32 +0000 (15:58 +0200)]
Handle the result of QueryGroups() correctly
If no group is given for the “gnt-network connect“/“… disconnect”
commands, the client uses the result of “QueryGroups()” which is a list
of lists. Use “itertools.chain()” to handle the return value correctly.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
(cherry picked from commit
af3aea481c3b8528239770edcae75d406a57de81)
Dimitris Aragiorgis [Tue, 22 Jan 2013 13:58:32 +0000 (15:58 +0200)]
Handle the result of QueryGroups() correctly
If no group is given for the “gnt-network connect“/“… disconnect”
commands, the client uses the result of “QueryGroups()” which is a list
of lists. Use “itertools.chain()” to handle the return value correctly.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 22 Jan 2013 13:25:52 +0000 (14:25 +0100)]
hv_xen: Compose file name outside error handling
In _ReadConfigFile, the filename should be prepared outside the
try/except block. Fixes bad code formatting, too.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Michael Hanselmann [Tue, 22 Jan 2013 15:41:24 +0000 (16:41 +0100)]
testutils: Module-level method for reading test data
This patch moves the functions “_ReadTestData” and “_TestDataFilename”
to module level. They do not depend on a class instance at all.
Some cases of “utils.ReadFile(self._TestDataFilename(…))” are also
corrected.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 22 Jan 2013 12:50:57 +0000 (13:50 +0100)]
Add test for backend._GetBlockDevSymlinkPath
Add a unit test for the trivial “_GetBlockDevSymlinkPath” function in
backend (small changes in the function were required).
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Michael Hanselmann [Tue, 22 Jan 2013 12:55:33 +0000 (13:55 +0100)]
hv_base: Remove empty constructor
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Helga Velroyen [Mon, 21 Jan 2013 15:12:04 +0000 (16:12 +0100)]
Fix format string of KVM output
This fixes a missing 's' in the format string and
the wrong quotes. Those bugs were introduced in
commit
6e043e60.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 17 Jan 2013 12:13:02 +0000 (13:13 +0100)]
Renames and cleanup of variable names in confd
The current names are quite confusing; this patch cleans up the
confusion by making sure we use different terms for the two threads,
etc.
No actual code changes besides the renames.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 17 Jan 2013 12:04:13 +0000 (13:04 +0100)]
Change the polling thread sleep behaviour
Currently, the polling thread sleeps at the end of its body; the
original reason was that when the thread initially starts, we want to
load the config immediately (in the old-style config load model).
However, now we explicitly load the config, so we can make this thread
behave like the watcher thread: sleep first, then do the work. This
model improves for example the startup of the thread, by not redoing a
config check immediately after switching to polling mode.
We also increase the max idle poll rounds interval from 2 to 3; the
new behaviour means that we revert from polling to inotify after
around one second of no changes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 17 Jan 2013 11:22:40 +0000 (12:22 +0100)]
First part of confd timer changes
This patch changes the resolution of the timers: the watcher timer
goes from 60s to 17s, and the polling-mode timer goes from 2 seconds
to 250ms. The code changes a bit more due to the changes in the units
of the various constants.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 17 Jan 2013 11:15:39 +0000 (12:15 +0100)]
Increase Haskell log file resolution
Currently the Haskell logging goes with the default time formatting,
which lacks sub-second resolution. This is not good, as it's too
coarse.
The patch adds picoseconds to the log; they will contain usually too
many zeroes, but the other option is to use a log format that (for
precisely zero fractional part) omits the separator, so it's not
consistent from line to line, and which also uses a dot as a
separator, different from the Python code.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 17 Jan 2013 10:38:45 +0000 (11:38 +0100)]
Add a function to get the current time in microseconds
In some cases we need higher resolution that seconds; I've settled on
microseconds as that is what 'threadDelay' wants, for exactly, so it's
easier if we keep the same units.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Iustin Pop [Wed, 16 Jan 2013 16:32:00 +0000 (17:32 +0100)]
Start confd in notify mode if we can
This patch changes the default model—where confd is always started in
polling mode—to a model where if possible we enable inotify mode
before starting any of the background threads.
There are some tricky details here: if we enable inotify, we should
not modify the server state after wards, as inotify events could have
already fired and took ownership; therefore we presume that inotify
will work and set reloadModel=ReloadNotify, and only if we fail to
enable it we change it back to polling mode.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 16 Jan 2013 14:28:40 +0000 (15:28 +0100)]
Explicitly load the config at confd startup
Currently, confd main function doesn't load the config, but simply
forks the individual timer threads, which will—as a side effect-also
load the configuration as soon as they start.
However, this makes codes to the startup more complex, so let's
explicitly (try to) load the configuration as first thing.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Christos Stavrakakis [Fri, 18 Jan 2013 14:44:13 +0000 (16:44 +0200)]
Fix type of 'node_whitelist' request parameter
If opportunistic_locking is used, then 'node_whitelist' parameter passed
to the allocator is set to the LU's owned node locks. However, LU owned_locks
has type of 'set' while IReqInstanceAlloc expects type of
'ht.TMaybeListOf(ht.TNonEmptyString)'.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Fri, 18 Jan 2013 14:30:41 +0000 (15:30 +0100)]
hv_xen: Add test for CPU pinning configuration
Add a unittest for a function formatting CPU pinning information for
Xen's configuration.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 18 Jan 2013 14:06:33 +0000 (15:06 +0100)]
kvm: remove last version-based feature detection
This was left behind because it required a different kvm invocation.
Now that we can add new ones cheaply (two constants) it's easy to get
rid of it. Differently than in other cases we support old version which
don't have the actual option, and error out when it's invoked.
This also removes two hardcoded strings, and brings them at constant
level. A lot more are present, but two is megl che one (cit).
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 18 Jan 2013 14:06:33 +0000 (15:06 +0100)]
kvm: extract a regexp matching out of a for loop
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 18 Jan 2013 13:54:08 +0000 (14:54 +0100)]
kvm: deduplicate 'get output' code
We had the same code twice, and were about to add a third time. Better
to collapse it into just one function.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 18 Jan 2013 12:57:50 +0000 (13:57 +0100)]
Make Xen config path a build-time option
Stop hardcoding the path in “hv_xen.py”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Fri, 18 Jan 2013 13:00:04 +0000 (14:00 +0100)]
Makefile.am: Protect placeholders for sed
If the placeholder has exactly the same name as the variable used in
autoconf it would be replaced as well. In the case of
“@ENABLE_SPLIT_QUERY@” this led to the sed command “s#False#False#g”.
Inserting additional quotes after the first @ sign prevents this.
Since ENABLE_SPLIT_QUERY was not actually used it is removed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Michael Hanselmann [Fri, 18 Jan 2013 13:13:56 +0000 (14:13 +0100)]
burnin: Don't keep hypervisor class around
Just determine whether it can migrate and keep that value instead of the
full hypervisor class.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Yiannis Tsiouris [Wed, 16 Jan 2013 15:02:16 +0000 (17:02 +0200)]
Text wrap in Haskell code
This adds two functions in Utils.hs: 'wrap' and 'trim' along with some
simple tests. 'wrap' is used in Common.hs for wrapping command
descriptions to a fixed line length, e.g. useful for the "--help"
option.
Signed-off-by: Yiannis Tsiouris <gtsiour@softlab.ntua.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Constantinos Venetsanopoulos [Thu, 17 Jan 2013 15:49:13 +0000 (17:49 +0200)]
Run pre-migrate hooks on primary node too
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 17 Jan 2013 14:41:09 +0000 (15:41 +0100)]
Makefile: Allow tarball creation when man-in-doc is active
Documentation with included man pages should not be distributed as it
contains fixed paths. Since the documentation with man pages is actually
written to a separate directory, tarball creation is still possible.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Dimitris Aragiorgis [Wed, 16 Jan 2013 17:24:44 +0000 (19:24 +0200)]
Check if KVM machine version is supported
If machine version is passed as an hv param, a check is made
in target node whether this version is included in the supported
ones derived from kvm -M ? command.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Wed, 16 Jan 2013 17:34:05 +0000 (18:34 +0100)]
Revert "run-in-tempdir: Improve speed"
This reverts commit
dd60179dfd8 as it broke coverage for Python.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Sun, 13 Jan 2013 17:47:27 +0000 (18:47 +0100)]
Verify that templates are compatible with exclusive storage
cluster-verify reports instances with disk templates not compatible with
exclusive storage but that are running on nodes with the exclusive storage
flag set.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Sun, 13 Jan 2013 15:37:11 +0000 (16:37 +0100)]
cluster-verify checks that PVs are not shared
When exclusive_storage is set, cluster-verify complains if PVs are shared
among unrelated LVs.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Sun, 13 Jan 2013 14:54:33 +0000 (15:54 +0100)]
bdev.GetPVInfo() returns list of LVs
This will be used for checks related to exclusive storage.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 11 Jan 2013 16:45:31 +0000 (17:45 +0100)]
Moved checks within LUClusterVerifyGroup
Almost all instance-specific checks have been moved from the Exec method to
the _VerifyInstance method. This cleans up Exec, which was becoming too big
even for pylint…
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Fri, 7 Dec 2012 18:19:02 +0000 (19:19 +0100)]
add-node checks PVs
add-node now performs a few checks on LVM before adding a node to the
cluster.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Mon, 10 Dec 2012 03:58:55 +0000 (04:58 +0100)]
New RPC call for node verify in dns-only RPC client
This will be used in node-add.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Thu, 6 Dec 2012 17:01:11 +0000 (18:01 +0100)]
cluster-verify checks uniformity of PV sizes
When exclusive_storage is set, cluster-verify complains if the size of PVs
is not uniform across a node group.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Tue, 8 Jan 2013 20:54:29 +0000 (21:54 +0100)]
utils.LvmExclusiveCheckNodePvs() returns more info
utils.LvmExclusiveCheckNodePvs() now returns the size of the smallest and
biggest PVs of a node. They will be used for cross-node consistency checks.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Sun, 13 Jan 2013 15:07:19 +0000 (16:07 +0100)]
cluster-verify checks uniformity of exclusive_storage flag
The value of the flag should be the same for nodes within the same group.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Mon, 7 Jan 2013 16:10:06 +0000 (17:10 +0100)]
Small cleanup in constants.py
- compat.UniqueFrozenset used in one more place, for consistency.
- The order of NV_XXX constants is fixed so that all values are now sorted
by name.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>