Michael Hanselmann [Fri, 9 Dec 2011 14:33:08 +0000 (15:33 +0100)]
RAPI client: Use utilities for building query parameters
Instead of repeating a “if cond: query.append(…)” pattern, utility
functions are added and used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 9 Dec 2011 14:31:10 +0000 (15:31 +0100)]
sphinx_ext: No longer exclude “depends” parameter by default
By default parameters existing for all opcodes (e.g. “debug_level”) are
not listed in the RAPI documentation. With this change the “depends”
parameter will be listed unless explicitely excluded.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 9 Dec 2011 14:23:54 +0000 (15:23 +0100)]
opcodes: Extend description of “depends” parameter
The documentation string is used in the RAPI description and
having more details is good.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 12 Dec 2011 09:42:46 +0000 (10:42 +0100)]
Add infrastructure for, and two extra hlint rules
This will allow us to easily use add new lint rules that we
standardise on, if any.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Andrea Spadaccini [Fri, 9 Dec 2011 16:30:26 +0000 (16:30 +0000)]
Document DRBD dynamic resync params in man pages
Also, remove some spurious spaces in the documentation of other options
and uniform the style of the disk parameters descriptions, by
terminating them with a period and adding the measurement unit in square
brackets after the description.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Fri, 9 Dec 2011 14:26:27 +0000 (14:26 +0000)]
Add the remaining DRBD dynamic sync disk params
Add the c-plan-ahead, c-fill-target, c-delay-target, c-max-rate,
c-min-rate parameters; report errors while setting the
synchronization speed.
Change the error signaling model of SetSyncParams. Instead of returning
True or False, return a list of errors (to make possible error reporting
during the recursive call).
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Fri, 9 Dec 2011 12:14:19 +0000 (12:14 +0000)]
Add the dynamic-resync DRBD disk parameter
constants.py, cmdlib.py:
- add the dynamic-resync parameter, both at DT and LD levels;
lib/bdev.py:
- change SetSyncSpeed to SetSyncParams, and _SetMinorSyncSpeed to
_SetMinorSyncParams;
- use the dynamic-resync parameter.
Later patches will implement the rest of the parameters.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Wed, 7 Dec 2011 20:50:03 +0000 (20:50 +0000)]
Describe the dynamic-resync par. in the design doc
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Fri, 9 Dec 2011 15:26:15 +0000 (16:26 +0100)]
Makefile.am: fix permissions for Python scripts on install
Some Python scripts in /usr/lib/ganeti/ were getting the wrong permissions
(their 'x' bit was cleared). This patch fixes that behavior.
This patch renames the variable 'dist_tools_PYTHON' to 'python_scripts'.
Some Python scripts were listed in the 'dist_tools_PYTHON' variable, but as
said scripts have no .py extension in their names, Automake treated the scripts
as data files, and hence no 'x' bit. Now the Python scripts are processed
by the rules created for the 'dist_tools_SCRIPTS' variable, and such rules
don't depend on file name extensions.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Thu, 8 Dec 2011 23:35:47 +0000 (00:35 +0100)]
devel/upload: Fix permissions for installed directories
Permissions for the directories created during install depended on the
umask of the user running the script. Now umask is reset inside the script
to remove such dependency.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Fri, 9 Dec 2011 14:03:50 +0000 (15:03 +0100)]
QA: init cluster changes ispecs
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Agata Murawska [Fri, 9 Dec 2011 13:31:05 +0000 (14:31 +0100)]
Empty ipolicy fix
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Agata Murawska [Fri, 9 Dec 2011 11:49:06 +0000 (12:49 +0100)]
Man page for gnt-group
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Agata Murawska [Fri, 9 Dec 2011 11:33:05 +0000 (12:33 +0100)]
Man page for gnt-cluster
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Agata Murawska [Fri, 9 Dec 2011 10:55:02 +0000 (11:55 +0100)]
Resource model design update
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Agata Murawska [Fri, 9 Dec 2011 10:01:44 +0000 (11:01 +0100)]
SimpleFillIpolicy corrected
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Fri, 9 Dec 2011 09:28:44 +0000 (10:28 +0100)]
Change constants: ISPECS suffixes to prefixes
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Fri, 9 Dec 2011 08:54:34 +0000 (09:54 +0100)]
mem_count is now mem_size everywhere
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:24:57 +0000 (16:24 +0100)]
GroupSetParam supports instance policy changes
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:24:29 +0000 (16:24 +0100)]
AddGroup supports instance policy
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:22:47 +0000 (16:22 +0100)]
Group query now calculates ipolicy
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:21:40 +0000 (16:21 +0100)]
Verification of instance policy for gnt-cluster verify
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 16:35:08 +0000 (17:35 +0100)]
Introduce instance policy on nodegroup level
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:16:57 +0000 (16:16 +0100)]
Cluster-level instance policy - other
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:14:38 +0000 (16:14 +0100)]
SetClusterParams supports instance policy changes
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:35:05 +0000 (16:35 +0100)]
InitCluster supports instance policy
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:13:31 +0000 (16:13 +0100)]
Instance policy command line support
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Agata Murawska [Tue, 6 Dec 2011 15:07:50 +0000 (16:07 +0100)]
Introduce instance policy on cluster level
Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 8 Dec 2011 14:09:58 +0000 (14:09 +0000)]
Add a balloon device to all kvm instances
This can be used to resize their memory (for now only manually, as
ganeti doesn't do the job yet)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 8 Dec 2011 13:56:06 +0000 (13:56 +0000)]
kvm: get more accurate info from qmp, if possible
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 8 Dec 2011 13:28:32 +0000 (13:28 +0000)]
kvm: make qmp connections more robust
Currently qmp fails at connect() time if there are socket errors. (eg.
if the instance was started without qmp). Add some better checking.
Also in the only place where we use it avoid hiding the error connecting
to the socket as a failure to read the password file.
In addition one variable is renamed because its name now conflicts with
the newly imported stat module.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 8 Dec 2011 13:19:45 +0000 (13:19 +0000)]
Move ErrnoOnStr backend function to utils
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Mon, 28 Nov 2011 12:01:54 +0000 (12:01 +0000)]
Add documentation for disk parameters to man pages
Document the stripes parameter for the plain template and the
resync-rate, datastripes, metastripes, disk-barriers, meta-barriers,
metavg, disk-custom and meta-custom parameters for the drbd template.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Tue, 6 Dec 2011 14:50:43 +0000 (14:50 +0000)]
Add net-custom and disk-custom DRBD parameters
Those parameters can be used to pass options directly to drbdsetup disk
and drbdsetup net.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Andrea Spadaccini [Tue, 6 Dec 2011 11:18:25 +0000 (11:18 +0000)]
Add the metavg DRBD disk parameter
This parameter represents the default metadata volume group for DRBD
disks. It can be overridden at instance creation time using the metavg
instance disk parameter.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Tue, 6 Dec 2011 16:54:17 +0000 (16:54 +0000)]
Move LD parameters constants to the LDP_ namespace
Add the LDP_ prefix to the LD parameters-related constants, in order to
avoid pollution in the global constants namespace.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Thu, 8 Dec 2011 11:12:01 +0000 (11:12 +0000)]
Restore diskparams in the gnt-group options check
Commit a82823 accidentally removed opts.diskparameters from the list of
parameters that are checked for presence in gnt-group, thus causing
invocations of gnt-group modify with only disk paramaters to fail.
This commit restores the check and also simplifies the whole chain of
checks by using only conjunctions of negations (as opposed to using both
congjunctions of negations and negations of disjunctions).
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Thu, 8 Dec 2011 09:39:29 +0000 (10:39 +0100)]
Some small test simplifications
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Bernardo Dal Seno [Wed, 7 Dec 2011 16:19:44 +0000 (17:19 +0100)]
Add tests for parameter "always_failover"
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Mon, 5 Dec 2011 19:10:42 +0000 (20:10 +0100)]
Add new back-end parameter "always_failover"
Instances that have this parameter is set to True are never migrated, but
instead they can only fail over. There are some cases where freezing the
kernel may cause problems, and hence this behavior is preferable.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Wed, 30 Nov 2011 17:05:29 +0000 (18:05 +0100)]
manpages: Fix small errors in documentation
Mostly typos, except for the output of "gnt-instance migrate" in an
example, which has been updated to the current version
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Mon, 28 Nov 2011 15:03:43 +0000 (16:03 +0100)]
gnt-cluster: Allow modify disk/hv state
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Mon, 28 Nov 2011 14:45:27 +0000 (15:45 +0100)]
gnt-group: Allow modify disk/hv state
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Fri, 25 Nov 2011 13:54:29 +0000 (14:54 +0100)]
gnt-node: Allow modify disk/hv state
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Wed, 30 Nov 2011 13:57:15 +0000 (14:57 +0100)]
cmdlib: Adding hv/disk state dict helper functions
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Fri, 25 Nov 2011 13:53:47 +0000 (14:53 +0100)]
cli: Add common command flags for hv/disk state
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Fri, 25 Nov 2011 10:49:41 +0000 (11:49 +0100)]
cmdlib: Adding _UpdateAndVerifySubDict helper
This helps with 2 dimensional dicts.
For example the hv_state and the disk_state dicts.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 7 Dec 2011 17:28:01 +0000 (18:28 +0100)]
Cleanup hlint errors
First, we update the recommended hlint version to what I used to get a
clean output (1.8.15). Most of the changes are:
- remove unneeded parentheses
- some simplifications (intercalate " " → unwords, maybe … id →
fromMaybe, etc.)
- removal of some duplicate code (in previous patches)
There are still some warnings which I didn't clean out but plain
ignored:
- 'Eta reduce' in some specific files, because the type inference
specialises the function on the first call, and annotating the type
properly would be too verbose
- use of 'first', 'comparing', and 'on', since these don't seem to be
widely or consistently used (outside ganeti/htools, I mean)
- use of Control.Exception.catch, as we only care about I/O errors; at
one point yes, we will need to transition to this new API
- 'Reduce duplication', since hlint warns even for 3 duplicate lines,
and abstracting that away seems overkill to me
After this patch, make hlint is clean and doesn't exit with an error
anymore; we could enable it automatically on 'make lint' if hlint is
detected (future patch).
Note that we explicitly skip the THH.hs file from checking because it
seems that hlint doesn't parse correctly for now the splice notation.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Wed, 7 Dec 2011 17:22:19 +0000 (18:22 +0100)]
Abstract some common hspace code into a function
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Wed, 7 Dec 2011 17:21:15 +0000 (18:21 +0100)]
Abstract some common Cluster.hs code into a function
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Andrea Spadaccini [Tue, 6 Dec 2011 22:14:02 +0000 (22:14 +0000)]
Add DRBD dynamic resync speed params to design doc
* Expand the Name column of the table (for c-delay-target)
* Add the c-* DRBDparameters to the table containing the disk parameters
* Add the unit of measurement in square brackets, when needed
* Document the supported DRBD version, warn about the DRBD version
needed for barriers and for the dynamic resync speed parameters.
* Add links to some documentation about the dynamic resync speed
parameters
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 6 Dec 2011 15:39:32 +0000 (16:39 +0100)]
Convert opcode TH code to the use of Field type
This makes more explicit the field behaviour - previously an optional
field was detected via a "Maybe" constructor, and an optional one via
a "Just defval" one. With this, field behaviour become more explicit
than auto-deduced.
In THH.hs, I slightly changed the fieldVariable function to use the
field name (if the field is not renamed), so that we have the exact
same output as before.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Tue, 6 Dec 2011 14:26:01 +0000 (15:26 +0100)]
Unify some file lists in Makefile.am
These were repeated needlessly; I hope I grouped them correctly.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Andrea Spadaccini [Mon, 28 Nov 2011 18:17:04 +0000 (18:17 +0000)]
Add DRBD barriers disk parameters
Add the disk-barriers and meta-barriers parameters described in the
design doc.
constants.py:
* add the needed LD and DT-level parameters, use the defaults provided
at ./configure time;
* add constants representing which barriers should be disabled and the
set of valid options.
lib/bdev.py:
* factor the barriers handling code to a class method, for testing
purposes;
* implement the more granular version checking logic;
* use the LD level parameters;
* add stricter check on DRBD version (8.0, 8.2 or 8.3), as we do not
support 8.4 yet.
lib/cmdlib.py:
* translate DT level parameters to LD level ones.
configure.ac, Makefile.am:
* set both disk and meta barriers parameters depending on the value of
--enable-drbd-barriers.
test/ganeti.bdev_unittest.py:
* unit tests for the code that sets DRBD barrier parameters depending on
the version.
doc/design-resource-model.rst:
* reword the description of meta-barriers;
* change all disk parameters names to use dashes instead of underscores.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 6 Dec 2011 09:44:27 +0000 (10:44 +0100)]
Style fixes on confd-client
Oops, forgot to check this before initial commit, sorry!
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 6 Dec 2011 09:57:03 +0000 (10:57 +0100)]
NEWS: Add missing space
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Sun, 20 Nov 2011 17:03:30 +0000 (18:03 +0100)]
htools: small change in error message in THH.hs
We should also display the value we can't parse, otherwise debugging
is very hard.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Fri, 25 Nov 2011 11:21:52 +0000 (12:21 +0100)]
htools: improvements to JSON deserialisation
This fixes two problems:
- first, when we deserialise a big object, showing its value is not
useful, as it will hide the actual error message
- second, we shouldn't deserialise a container at once, because then
we will lose the detail of which 'key' failed to deserialise; we
change to manual deserialisation of each key/value pair, so that we
can keep this information
The last point requires that we import JSON.hs into THH.hs, in order
not to duplicate functionality.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Fri, 18 Nov 2011 09:54:02 +0000 (10:54 +0100)]
htools: add new template haskell system
This system based on explicit types instead of ad-hoc rules
(e.g. instead of deducing from "Maybe Int" an optional field, we now
can say explicitly OptionalField ''Int). In the first phase, this will
be used for the equivalent of lib/objects.py, which has slightly
different rules than luxi/opcodes.
We should look at merging the two systems later.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>
Iustin Pop [Tue, 22 Nov 2011 10:47:38 +0000 (11:47 +0100)]
Add a small confd client
This can be used to test live servers; currently there's not direct
way to interact with a confd server, except for burnin's builtin tests
(which were the source of this file).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Sun, 20 Nov 2011 00:42:11 +0000 (01:42 +0100)]
A few updates to the confd design (2.1)
While the 2.1 design is old and should be “immutable”, I can't find
documentation about the confd protocol anywhere else, so let's correct
the design doc.
The patch is mostly style changes, plus a clarification on the ‘query’
field of the request, which varies *a lot* per request type.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 1 Dec 2011 13:11:06 +0000 (14:11 +0100)]
cmdlib: Make use of cluster's new “primary_hypervisor” property
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 1 Dec 2011 12:59:25 +0000 (13:59 +0100)]
objects.Cluster: Add property for primary hypervisor
This is useful for working with a node's hypervisor state, where only
the primary hypervisor will be authoritative.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Mon, 28 Nov 2011 10:47:35 +0000 (10:47 +0000)]
LV stripes parameters for plain and drbd
configure.ac:
* change the documentation of --with-lvm-stripecount parameter to
reflect the change
doc/design-resource-model.rst:
* change drbd/stripes to drbd/data-stripes and drbd/metastripes to
drbd/meta-stripes
rest of files:
* add the plain/stripes, drbd/data-stripes and drbd/meta-stripes disk
parameters
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Mon, 21 Nov 2011 14:51:11 +0000 (14:51 +0000)]
Add DRBD8 static resync speed disk parameter
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Wed, 23 Nov 2011 11:43:40 +0000 (11:43 +0000)]
Use disk parameters in Logical Units
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Mon, 21 Nov 2011 13:48:58 +0000 (13:48 +0000)]
Use disk parameters in noded
* add the params attribute to BlockDev, and add the corresponding
parameter to all the BlockDev classes;
* change the Create, Assemble and FindDevice factory functions interface
to accept as parameters an objects.Disk instance and a list of
children block devices; update their callers;
* make the factory functions provide default values for params if
needed;
* factor out a check in the block device factory functions.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Wed, 23 Nov 2011 22:53:34 +0000 (22:53 +0000)]
qa: add gnt-cluster tests related to disk params
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Andrea Spadaccini [Mon, 21 Nov 2011 13:43:09 +0000 (13:43 +0000)]
Add basic support for disk parameters
objects.py:
* add disk parameters to Disk, Cluster, NodeGroup.
constants.py:
* add dictionaries that will hold types and default values for disk
parameters (for now, empty).
test/ganeti.constants_unittest.py:
* add unit tests for consistency in disk parameters default values.
rest of files:
* add to gnt-cluster and gnt-group the options to manipulate disk
parameters.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 30 Nov 2011 13:51:12 +0000 (14:51 +0100)]
More fixes after commit
78519c106
A quick QA run successfully finished with these changes.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Michael Hanselmann [Wed, 30 Nov 2011 13:38:15 +0000 (14:38 +0100)]
Fix “node_info” RPC result
Commit
78519c106 broke everything. Here's the fix.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 28 Nov 2011 14:07:39 +0000 (15:07 +0100)]
query: Add fields for node's disk/hv state
These fields just return the node attribute's contents. They will be
used by the watcher to detect out of date node states.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 25 Nov 2011 10:33:43 +0000 (11:33 +0100)]
hv_xen: Report memory used by hypervisor
- Report memory used by hypervisor (“mem_hv” as per resource model
design document, “xmem” in htools)
- Also report number of CPUs available to Dom0
- Some other, small changes
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 13:21:03 +0000 (14:21 +0100)]
hv_xen: Export number of CPUs for Dom0
This will be stored in the node object and used for calculations.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 22 Nov 2011 09:13:59 +0000 (10:13 +0100)]
Add objects for disk/hv state
- Data objects
- Serialization/deserialization
- Unittests
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 21 Nov 2011 10:34:03 +0000 (11:34 +0100)]
objects.Node: Add static hv/disk state
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 13:17:34 +0000 (14:17 +0100)]
hv_xen: Use constant for “Domain-0” name
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 29 Nov 2011 16:32:48 +0000 (17:32 +0100)]
Change “node_info” RPC to accept multiple VGs/hypervisors
Keeping the node state up to date will require information from multiple
VGs and hypervisors. Instead of requiring multiple calls this change
allows a single call to return all needed information. Existing users
are changed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 29 Nov 2011 15:36:26 +0000 (16:36 +0100)]
locking: Allow checking if lock is owned in certain mode
With this patch the “LockSet” and “GanetiLockManager” classes have a new
function to check if a single or a group of locks (at a certain level)
have been acquired in a specific mode. This will be used for additional
assertions. Until now they could only check if a lock has been acquired,
but not in which mode. One use-case will be updating the node state in
various places, where the node lock must be acquired in exclusive mode.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 13:59:52 +0000 (14:59 +0100)]
Merge branch 'devel-2.5'
* devel-2.5:
ConfigWriter: Fix epydoc error
ConfigWriter: Fix epydoc error
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 12:22:28 +0000 (13:22 +0100)]
Merge branch 'devel-2.4' into devel-2.5
* devel-2.4:
ConfigWriter: Fix epydoc error
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 12:15:46 +0000 (13:15 +0100)]
Merge branch 'stable-2.5' into devel-2.5
* stable-2.5:
ConfigWriter: Fix epydoc error
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 12:02:36 +0000 (13:02 +0100)]
ConfigWriter: Fix epydoc error
The parameter is called “mods”, not “modes”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
(cherry picked from commit
1730d4a1ab56ef36d082b614d3d0ab13f3e14a85)
Michael Hanselmann [Thu, 24 Nov 2011 12:02:36 +0000 (13:02 +0100)]
ConfigWriter: Fix epydoc error
The parameter is called “mods”, not “modes”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 09:50:35 +0000 (10:50 +0100)]
Merge branch 'devel-2.5'
* devel-2.5:
LUGroupAssignNodes: Fix node membership corruption
LUGroupAssignNodes: Fix node membership corruption
Fix pylint warning on unreachable code
LUNodeEvacuate: Disallow migrating all instances at once
Separate OpNodeEvacuate.mode from iallocator
LUNodeEvacuate: Locking fixes
Fix error when removing node
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 09:06:39 +0000 (10:06 +0100)]
Merge branch 'devel-2.4' into devel-2.5
* devel-2.4:
LUGroupAssignNodes: Fix node membership corruption
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 08:40:10 +0000 (09:40 +0100)]
Merge branch 'stable-2.5' into devel-2.5
* stable-2.5:
LUGroupAssignNodes: Fix node membership corruption
Fix pylint warning on unreachable code
LUNodeEvacuate: Disallow migrating all instances at once
LUNodeEvacuate: Locking fixes
Fix error when removing node
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 07:43:04 +0000 (08:43 +0100)]
LUGroupAssignNodes: Fix node membership corruption
Note: This bug only manifests itself in Ganeti 2.5, but since the
problematic code also exists in 2.4, I decided to fix it there.
If a node was assigned to a new group using “gnt-group assign-nodes” the
node object's group would be changed, but not the duplicate member list
in the group object. The latter is an optimization to require fewer
locks for other operations. The per-group member list is only kept in
memory and not written to disk.
Ganeti 2.5 starts to make use of the data kept in the per-group member
list and consequently fails when it is out of date. The following
commands can be used to reproduce the issue in 2.5 (in 2.4 the issue was
confirmed using additional logging):
$ gnt-group add foo
$ gnt-group assign-nodes foo $(gnt-node list --no-header -o name)
$ gnt-cluster verify # Fails with KeyError
This patch moves the code modifying node and group objects into
“config.ConfigWriter” to do the complete operation under the config
lock, and also to avoid making use of side-effects of modifying objects
without calling “ConfigWriter.Update”. A unittest is included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
218f4c3de706aca7e4521d7e1975f517cf5ecb9b)
Michael Hanselmann [Thu, 24 Nov 2011 07:43:04 +0000 (08:43 +0100)]
LUGroupAssignNodes: Fix node membership corruption
Note: This bug only manifests itself in Ganeti 2.5, but since the
problematic code also exists in 2.4, I decided to fix it there.
If a node was assigned to a new group using “gnt-group assign-nodes” the
node object's group would be changed, but not the duplicate member list
in the group object. The latter is an optimization to require fewer
locks for other operations. The per-group member list is only kept in
memory and not written to disk.
Ganeti 2.5 starts to make use of the data kept in the per-group member
list and consequently fails when it is out of date. The following
commands can be used to reproduce the issue in 2.5 (in 2.4 the issue was
confirmed using additional logging):
$ gnt-group add foo
$ gnt-group assign-nodes foo $(gnt-node list --no-header -o name)
$ gnt-cluster verify # Fails with KeyError
This patch moves the code modifying node and group objects into
“config.ConfigWriter” to do the complete operation under the config
lock, and also to avoid making use of side-effects of modifying objects
without calling “ConfigWriter.Update”. A unittest is included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 24 Nov 2011 07:58:56 +0000 (08:58 +0100)]
Fix pylint warning on unreachable code
Commit
c50452c3186 added an exception when all instances should be
evacuated off a node, but did so in a way which made pylint complain
about unreachable code.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 23 Nov 2011 13:01:23 +0000 (14:01 +0100)]
LUNodeEvacuate: Disallow migrating all instances at once
There is a design issue in the iallocator interface which prevents us
from doing this.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 23 Nov 2011 12:40:46 +0000 (13:40 +0100)]
Separate OpNodeEvacuate.mode from iallocator
Until now the iallocator constants for node evacuation
(IALLOCATOR_NEVAC_*) were also used for the opcode. However, it turned
out this was due to a misunderstanding and is incorrect. This patch adds
new constants (with the same values) and changes the affected places.
Fortunately the RAPI client already used good names, so no changes are
necessary.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 23 Nov 2011 12:16:14 +0000 (13:16 +0100)]
LUNodeEvacuate: Locking fixes
When evacuating a node, only an assertion without informative text was
used to check if the necessary node locks had been acquired. This was on
top of evaluating the list of nodes without having a node group lock, so
this was changed as well.
Also update some exception messages to include “retry the operation”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 23 Nov 2011 07:15:18 +0000 (08:15 +0100)]
Fix error when removing node
ConfigWriter.GetAllInstancesInfo returns a dictionary, not a list.
Removing a node would fail with “too many values to unpack”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Mon, 21 Nov 2011 11:49:21 +0000 (11:49 +0000)]
manpages: update beparams explanations
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 22 Nov 2011 10:07:45 +0000 (10:07 +0000)]
constants: reindent a few dicts
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 21 Nov 2011 11:18:22 +0000 (11:18 +0000)]
Remove BE_MEMORY from beparams but keep compatibility
Queries are already compatible (be/memory is an alias for be/maxmem) and
import/exports work. This patch patch fixes it for cluster init, modify
and instance add/start/modify.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 21 Nov 2011 11:12:00 +0000 (11:12 +0000)]
burnin: use mem_size as max and min
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 21 Nov 2011 11:05:31 +0000 (11:05 +0000)]
unittests: use max/min memory
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 21 Nov 2011 10:56:50 +0000 (10:56 +0000)]
cmdlib: use MAXMEM for all operations
Since for now we can only start instances at their maximum memory, we
modify all checks to use that value. When we'll have better support for
using a value in between some of these checks have to move to minimum
memory.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>