Andrea Spadaccini [Thu, 5 Jan 2012 14:56:25 +0000 (14:56 +0000)]
qa: fix disk parameters tests
Fix an error in the disk parameters tests (the arguments to gnt-cluster
were not passed correctly) and move them to separate functions.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 5 Jan 2012 12:54:37 +0000 (13:54 +0100)]
man/gnt-node: Improve powercycle documentation
Reword a bit, capitalize “SSH”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 5 Jan 2012 13:05:08 +0000 (14:05 +0100)]
rpc_defs: Enable “node_powercycle” for offline nodes
With this change it's possible to powercycle nodes marked as offline. Of
course the node might not be running the node daemon anymore.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 5 Jan 2012 13:03:47 +0000 (14:03 +0100)]
rpc._NodeConfigResolver: Support resolving offline nodes
This is needed to powercycle a node marked offline.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 4 Jan 2012 19:33:55 +0000 (20:33 +0100)]
rpc: Pass resolver options to actual resolver
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 5 Jan 2012 14:23:49 +0000 (15:23 +0100)]
rpc: Add support for resolver options callback
This adds support for a callback returning name resolver options. This
is required for powercycling offline nodes. While it would be possible
to implement this using a separate RPC client class, doing so would
require some code duplication with the standard “RpcRunner” class.
The callback can generate the options based on the call arguments.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 4 Jan 2012 18:59:13 +0000 (19:59 +0100)]
rpc._RpcProcessor: Make read timeout a non-keyword argument
It is always used and can be set to “None” if intended.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Thu, 5 Jan 2012 10:18:37 +0000 (11:18 +0100)]
QA: Make the ispec values configurable
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Wed, 4 Jan 2012 13:15:50 +0000 (14:15 +0100)]
Update the resource model DD with current state
On my work for instance policies we decided not to overload --force
more, instead we go with a new flag --ignore-ipolicy. This is just a
small patch to reflect this decision.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Thu, 22 Dec 2011 13:49:24 +0000 (14:49 +0100)]
Fix failure in distcheck and coverage tests
autotools/testrunner was missing in distcheck. Now some changes from
7004106119c5c56c93085ccfb1250b3561b5b6ad have been reverted, and testrunner
is not built anymore. coverage now uses fakeroot when needed.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 22 Dec 2011 18:19:28 +0000 (19:19 +0100)]
Makefile: Fix parallel distcheck
Running “make -jN distcheck” for any N > 1 would reliably break when
building the RPC client wrappers. This was due to wrong dependencies in
Makefile.am, fixed by this patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 22 Dec 2011 16:43:40 +0000 (17:43 +0100)]
Merge branch 'devel-2.5'
* devel-2.5:
jqueue: Factorize checking job processor's result
jqueue unittest: Rename simple fake-job class
jqueue: Fix epylint errors introduced in
37d76f1e4
jqueue: Fix deadlock between job queue and dependency manager
locking: Add “__repr__” to SharedLock and PipeCondition
daemon.GenericMain: Don't generate backtrace on conflicting daemons
utils.io.WritePidFile: Improve error reporting
utils.ListVisibleFiles: Hide “lost+found” directories
Fix race condition in test for *FileID functions
Conflicts:
lib/utils/io.py: Trivial
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 22 Dec 2011 16:35:03 +0000 (17:35 +0100)]
Merge branch 'stable-2.5' into devel-2.5
* stable-2.5:
jqueue: Fix epylint errors introduced in
37d76f1e4
jqueue: Fix deadlock between job queue and dependency manager
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 22 Dec 2011 15:00:53 +0000 (16:00 +0100)]
test/lockperf: Use a list of integers, not booleans
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 22 Dec 2011 13:16:57 +0000 (14:16 +0100)]
Add lock performance utility
I had an idea for improving locking performance. To see if it worked I
wrote this tool. Unfortunately the idea didn't quite work (broke
unittests left and right), but the tool is still handy for evaluating
future changes to the “SharedLock” class.
It is not installed or run at build/test time. In its current form it is
intended for manual use. Example output:
---
Total number of acquisitions: 32642
Per-thread acquisitions:
Thread 0: 6536 (20.0%)
Thread 1: 6488 (19.9%)
Thread 2: 6536 (20.0%)
Thread 3: 6529 (20.0%)
Thread 4: 6553 (20.1%)
Benchmark CPU time: 5.010s
Average time per lock acquisition: 0.15348ms
Process:
User time: 4.160s
System time: 1.030s
Total time: 5.190s
---
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 19 Dec 2011 15:25:24 +0000 (16:25 +0100)]
jqueue: Factorize checking job processor's result
This allows for more unittesting.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 19 Dec 2011 15:26:08 +0000 (16:26 +0100)]
jqueue unittest: Rename simple fake-job class
Also add a parameter for priority, to be used in an upcoming
patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Tue, 13 Dec 2011 15:01:24 +0000 (16:01 +0100)]
noded: Fix /etc/hosts group ownership
When Ganeti was compiled with the option of running as a different
user/group, the group ownership of /etc/hosts was set to gnt-daemons. Now
permissions for /etc/hosts are preserved (or set correctly).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Bernardo Dal Seno [Tue, 13 Dec 2011 16:17:10 +0000 (17:17 +0100)]
unit tests: Add tests for uid and gid handling in utils.WriteFile
These tests need fakeroot. If it's not present, they are not run (they
don't fail).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Tue, 13 Dec 2011 14:51:02 +0000 (15:51 +0100)]
unit tests: Add tests for file mode handling in utils.WriteFile
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Tue, 13 Dec 2011 14:49:38 +0000 (15:49 +0100)]
utils.WriteFile: Add new parameter to preserve file permissions
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Bernardo Dal Seno [Tue, 13 Dec 2011 16:16:42 +0000 (17:16 +0100)]
unit tests: added fakeroot support
Tests ending in "-runasroot" or "-runasroot.py" are run through fakeroot,
so activity that needs root privileges can be tested.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 21 Dec 2011 16:01:08 +0000 (17:01 +0100)]
jqueue: Fix epylint errors introduced in
37d76f1e4
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 21 Dec 2011 13:48:13 +0000 (14:48 +0100)]
Switch blockdev_getmirrorstatus_multi to per-node bodies
Even for a small 4-node node-group, this reduces the payload of this
RPC call by half for each node; for a big node group, previous testing
(using a different patch) showed a general reduction in traffic over
the entire cluster verify from 9MB to ~2MB.
We only need to change the RPC call, not its return value, since that
was already in an "optimised" form.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 21 Dec 2011 13:11:32 +0000 (14:11 +0100)]
Change internal RPC client body values
Currently, all RPC payloads sent by the client to the remote node
daemons must be identical, due to how the data is passed
internally. This is deficient in both use (from the programmer's point
of view) and from the network traffic (cluster verify/disk data
gathering has a total payload which is O(n²) in size of the nodes
being queried, instead of O(n)).
This patch changes the RPC internals so that we always pass
dictionaries indexed by target node name. For the default use case,
when the payload is identical, we only serialise the payload once, so
the extra overhead is just a dict with the node names and values all
pointing to the same object. For different payloads, we will encode
the body multiple times, but hopefully the bodies will be smaller.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 21 Dec 2011 12:58:29 +0000 (13:58 +0100)]
Extend RPC definition change with another parameter
This will be used in a later patch for parameter pre-processing. For
now we just add the parameter as 'None' and add a consistency check
for the parameter definitions.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 21 Dec 2011 15:43:28 +0000 (16:43 +0100)]
hv_kvm: Make string containing regex a raw string
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 21 Dec 2011 14:50:51 +0000 (15:50 +0100)]
hv_kvm: Style fixes
Change a few lines to match rest of code.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 21 Dec 2011 14:47:13 +0000 (15:47 +0100)]
test/hv_kvm: Code style, additional tests
Change code style to match rest of Ganeti code and add
two tests checking for single-line messages.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 21 Dec 2011 14:45:59 +0000 (15:45 +0100)]
hv_kvm.QmpMessage: Use dict.get
No need to look up the key twice.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 21 Dec 2011 14:29:32 +0000 (15:29 +0100)]
serializer: Remove JSON indentation and dict key sorting
Serializing to JSON using “simplejson” is significantly slower when
indentation and/or sorting of dictionary keys is used. In simplejson 1.x
the difference isn't that big, but with simplejson 2.x the difference
can be up to a factor of 7.5. The reason is that the latter no longer
uses C functions when sorting or indentation is used.
With this patch we revert everything to simplejson's defaults, which
should provide us with the best performance available.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 19 Dec 2011 15:26:55 +0000 (16:26 +0100)]
jqueue: Fix deadlock between job queue and dependency manager
When an opcode is about to be processed its dependencies are
evaluated using “_JobDependencyManager.CheckAndRegister”. Due
to its nature that function requires a lock on the manager's
internal structures. All of this happens while the job queue
lock is held in shared mode (required for the job processor).
When a job has been processed any pending dependencies are re-added
to the job workerpool. Before this patch that would require
the manager's lock and then, for adding the jobs, the job queue
lock. Since this is in reverse order it will lead to deadlocks.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 14 Dec 2011 11:11:46 +0000 (12:11 +0100)]
Fix unittests for daemon_util with disabled confd
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Andrea Spadaccini [Mon, 19 Dec 2011 15:46:39 +0000 (15:46 +0000)]
Fix parameters for QueryJob in JobExecutor
When gnt-job submit is used with the --each option, it sends as
parameters for QueryJobs a list of lists, each containing a job ID.
While this works now, it is not the intended format for QueryJobs.
This patch fixes this behavior, by making it send a list of job IDs.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 19 Dec 2011 14:21:04 +0000 (15:21 +0100)]
locking: Add “__repr__” to SharedLock and PipeCondition
These help when debugging.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>
Andrea Spadaccini [Mon, 19 Dec 2011 10:42:32 +0000 (10:42 +0000)]
Fix cluster destroy failure
Cluster destroy would fail if there were errors while deactivating the
master IP address. This patch demotes such errors to warnings, allowing
the cluster to be destroyed even if the master IP address turndown
fails.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Andrea Spadaccini [Fri, 16 Dec 2011 20:54:06 +0000 (20:54 +0000)]
Add docs for missing option in gnt-debug man page
Document the --each option of gnt-debug submit-job.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
René Nussbaumer [Fri, 9 Dec 2011 12:54:20 +0000 (13:54 +0100)]
gnt-node: Add hv/disk state to add
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Thu, 8 Dec 2011 11:43:16 +0000 (12:43 +0100)]
gnt-group: Add hv/disk state to add
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Thu, 8 Dec 2011 10:55:56 +0000 (11:55 +0100)]
gnt-cluster: Add hv/disk state to init
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 9 Dec 2011 14:50:13 +0000 (15:50 +0100)]
RAPI client: Export feature constants
Users of the RAPI client may want to use feature strings too, therefore
they should be explicitely public.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 9 Dec 2011 14:44:41 +0000 (15:44 +0100)]
RAPI client: Replace body value assignments with helper
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
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>
Michael Hanselmann [Thu, 8 Dec 2011 14:35:23 +0000 (15:35 +0100)]
daemon.GenericMain: Don't generate backtrace on conflicting daemons
Instead, print a nicer error message. This should fix issue 200.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 8 Dec 2011 14:33:31 +0000 (15:33 +0100)]
utils.io.WritePidFile: Improve error reporting
If the PID file is already locked by another process, try to read
the content and report it as part of the error message.
Signed-off-by: Michael Hanselmann <hansmi@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>
Michael Hanselmann [Thu, 8 Dec 2011 10:23:38 +0000 (11:23 +0100)]
utils.ListVisibleFiles: Hide “lost+found” directories
If a “lost+found” directory is found at a filesystem's root path it is
ignored. In all other cases directory entries named “lost+found” are
treated normally. Unittests are included. Fixes issue 153.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@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>