Michael Hanselmann [Mon, 26 May 2008 14:27:06 +0000 (14:27 +0000)]
Disable twisted signal handlers for remote API daemon
Otherwise we can't exit the daemon in a clean way by sending a signal.
Reviewed-by: iustinp
Michael Hanselmann [Mon, 26 May 2008 12:24:04 +0000 (12:24 +0000)]
Remove print statement from cmdlib
Seems to be some debug code left over.
Reviewed-by: ultrotter
Michael Hanselmann [Sat, 24 May 2008 20:48:06 +0000 (20:48 +0000)]
Remove output file if docbook failed
Reviewed-by: ultrotter
Michael Hanselmann [Sat, 24 May 2008 20:47:52 +0000 (20:47 +0000)]
Add documentation for remote API
- Introduction and examples
- Update docstrings in resources.py
- Script to automatically generate documentation from resources.py
Reviewed-by: ultrotter
Guido Trotter [Sat, 24 May 2008 08:53:39 +0000 (08:53 +0000)]
Distribute dumb-allocator in examples
When creating the ganeti tarball the dumb allocator was left out.
Shipping it alongside the other examples.
Reviewed-by: iustinp
Guido Trotter [Thu, 22 May 2008 10:40:17 +0000 (10:40 +0000)]
Ganeti version 1.2.4~rc0
Make a release candidate version of 1.2.4, since it contains enough
changes that we want to be sure before declaring it stable.
Reviewed-by: schreiberal
Guido Trotter [Thu, 22 May 2008 10:40:05 +0000 (10:40 +0000)]
Add more 1.2.4 information in NEWS
This is the result of what I remember about all the changes that went
throgh, plus scrubbing through all the 1.2.4 commit messages for
user-visible changes in 1.2.4, and merging some suggestions from
Alexander.
Reviewed-by: schreiberal
Michael Hanselmann [Wed, 21 May 2008 16:04:59 +0000 (16:04 +0000)]
Fix remote API unittests
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 21 May 2008 16:04:45 +0000 (16:04 +0000)]
Use a single function for all tag fetching resources
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 21 May 2008 16:04:27 +0000 (16:04 +0000)]
Use PEP-318 decorator to acquire locks in remote API code
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 21 May 2008 16:04:09 +0000 (16:04 +0000)]
Implement better error handling in remote API
- Add dedicated file for HTTP exceptions
- Use ganeti.serializer instead of simplejson directly
- Throw exceptions instead of setting variables or returning None
for errors
- Rename "_get" method to "GET" to correspond with HTTP protocol
- Move most code of R_generic to handler class, simplifying control flow
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 21 May 2008 16:03:47 +0000 (16:03 +0000)]
Alias Dump/Load functions in ganeti.serializer to DumpJson/LoadJson
The remote API will use JSON for the foreseable future, so it's better
to put the serialization format in the function name. We can still
use another serialization format for Ganeti's core.
Reviewed-by: amishchenko, schreiberal
Michael Hanselmann [Wed, 21 May 2008 15:20:22 +0000 (15:20 +0000)]
Remove authorization code from remote API
It's not yet implemented anyway.
Reviewed-by: amishchenko, ultrotter
Michael Hanselmann [Wed, 21 May 2008 15:20:08 +0000 (15:20 +0000)]
Add /version resource to remote API
This returns the remote API version implemented and allows clients
to adjust accordingly.
Reviewed-by: amishchenko, ultrotter
Michael Hanselmann [Wed, 21 May 2008 15:19:44 +0000 (15:19 +0000)]
Remote API code cleanup
- Unify variable names
- Use constants for tag kinds
- Add functions to simplify creating URI lists
Reviewed-by: amishchenko, schreiberal
Michael Hanselmann [Wed, 21 May 2008 10:30:58 +0000 (10:30 +0000)]
Improve remote API logging
- Put HTTP request log into its own file
- Factor out logging code
- Add unittests
Reviewed-by: amishchenko
Michael Hanselmann [Wed, 21 May 2008 10:30:41 +0000 (10:30 +0000)]
Set SO_REUSEADDR on remote API socket
Reviewed-by: schreiberal
Oleksiy Mishchenko [Tue, 20 May 2008 14:14:04 +0000 (14:14 +0000)]
Fix Unittest for Ganeti RAPI
Alexander Schreiber [Mon, 19 May 2008 10:23:12 +0000 (10:23 +0000)]
Fix gnt-instance modify for HVM parameters
This patch makes gnt-instance modify work again for the advanced
HVM parameters after it was broken by other changes.
Reviewed-by: imsnah
Guido Trotter [Thu, 15 May 2008 14:22:23 +0000 (14:22 +0000)]
document cluster verify --no-nsplus1-mem option
Add this recently added option to the gnt-cluster man page before
releasing 1.2.4.
Reviewed-by: imsnah
Michael Hanselmann [Thu, 15 May 2008 14:10:14 +0000 (14:10 +0000)]
Update command line help and manpages with mandatory options
Reviewed-by: ultrotter
Michael Hanselmann [Thu, 15 May 2008 11:26:33 +0000 (11:26 +0000)]
Remove unimplemented /status resource from API
Reviewed-by: ultrotter
Guido Trotter [Thu, 15 May 2008 08:58:47 +0000 (08:58 +0000)]
Fix drbd show parser to handle valueless keywords
It turns out in some cases there can exist keywords without an
associated value exported by drbdsetup show. This patch makes the value
part optional in our parser, so that if it's not present the parsing
result will contain an array with just the keyword in it. This is not a
problem since we check all keyword names before accessing their values,
so we won't mistakenly try to access the value of a valueless keyword.
Reviewed-by: iustinp
Guido Trotter [Thu, 15 May 2008 08:58:31 +0000 (08:58 +0000)]
Split drbd command creation and execution
Make _AssembleDisk more similar to _AssembleNet by splitting the
generation of the drbdsetup command and its execution. While not
changing anything this makes it easier to manipulate the command just in
certain cases, which in the future we'll need to do.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 14 May 2008 11:52:18 +0000 (11:52 +0000)]
Optimize rapi
A lot of changes:
- Don't use eval() anymore, it's evil
- Don't compile Regex' on every request, but once when resources.py is
imported
- Use string comparison for URIs if possible
- Cleanup function used to parse requests (getController)
- Don't put class names as strings, but rather use classes directly
- Change unit tests accordingly
- Sort result of R_root._get to make unit tests reliable
Reviewed-by: amishchenko
Michael Hanselmann [Tue, 13 May 2008 16:38:41 +0000 (16:38 +0000)]
Generate devel/upload during build time from template
- Use variable with prefix instead of grep and sed
- Always run with /bin/bash
Reviewed-by: iustinp
Iustin Pop [Tue, 13 May 2008 14:38:13 +0000 (14:38 +0000)]
Small style fixes
Reviwed-by: imsnah
Iustin Pop [Tue, 13 May 2008 14:32:35 +0000 (14:32 +0000)]
Implement node daemon conectivity tests
This patch adds in gnt-cluster verify checks for inter-node tcp
communication checks on the node daemon port for both the primary and
(if defined) secondary networks.
The output looks like (4-node cluster, one with the secondary interface
down):
* Verifying node node1.example.com
- ERROR: tcp communication with node 'node3.example.com': failure using the secondary interface(s)
* Verifying node node2.example.com
- ERROR: tcp communication with node 'node3.example.com': failure using the secondary interface(s)
* Verifying node node3.example.com
- ERROR: tcp communication with node 'node1.example.com': failure using the secondary interface(s)
- ERROR: tcp communication with node 'node2.example.com': failure using the secondary interface(s)
- ERROR: tcp communication with node 'node4.example.com': failure using the secondary interface(s)
* Verifying node node4.example.com
- ERROR: tcp communication with node 'node3.example.com': failure using the secondary interface(s)
Reviewed-by: imsnah
Michael Hanselmann [Tue, 13 May 2008 14:25:54 +0000 (14:25 +0000)]
Add --readd option to “gnt-node add”
This allows us to readd a node after it failed and required a
reinstallation or replacement.
Reviewed-by: iustinp
Iustin Pop [Tue, 13 May 2008 13:28:09 +0000 (13:28 +0000)]
CLI: retry: remove command opts/args in "gnt-X"
This new version of the patch removes only the listing of the usage in
the "gnt-X" list, but keeps the strings in since we'll want to enhance
and use them in "gnt-X $cmd --help".
Reviewed-by: ultrotter
Iustin Pop [Tue, 13 May 2008 13:03:14 +0000 (13:03 +0000)]
Revert "CLI: remove command opts/args in "gnt-X""
This reverts commit 974, as it's not a good way to proceed (we still
want the usage to be shown when using gnt-X $cmd --help).
Reviewed-by: ultrotter
Iustin Pop [Tue, 13 May 2008 12:16:21 +0000 (12:16 +0000)]
CLI: remove command opts/args in "gnt-X"
This patch removes all the parameters and options from the output
"gnt-X" (i.e. the subcommand list for command). This is done in order to
uniformize the output, currently only some parameters are shown and they
are not always consistent (e.g. required versus important parameters).
Reviewed-by: ultrotter
Oleksiy Mishchenko [Tue, 13 May 2008 10:26:30 +0000 (10:26 +0000)]
Pass headers to API resource request handlers
Iustin Pop [Tue, 13 May 2008 09:38:52 +0000 (09:38 +0000)]
Watcher: do not activate disks for started instances
Currently the watcher runs first the instance startup and then the
boot-id method of disk reactivation. However, irrelevant of the fact
that a node has rebooted or not, if we just started an instance, there's
no need for its disks to be activated again, since the start instance
has done that (if it is at all possible).
The patch modifies the watcher to remember all started instances and not
run activate-disks for them.
Reviewed-by: ultrotter
Iustin Pop [Tue, 13 May 2008 09:38:44 +0000 (09:38 +0000)]
Watcher: do not activate disks for admin_down
Currently the watcher does activate disks (via bootid mechanisms) even
for admin_down instances. This patch logs and skips over these
instances.
Reviewed-by: ultrotter
Iustin Pop [Tue, 13 May 2008 07:31:28 +0000 (07:31 +0000)]
Reduce chance of ssh failures in verify cluster
The cluster verify builds a sorted list of nodes and passes that to all
the nodes (in parallel) for ssh checks. This means that for a cluster
with N nodes, there will be approximately N simultaneous connections to
the first node, then to the second node, etc. This, coupled with the
ssh daemon's “MaxStartups” parameter, can create false alarms about ssh
connectivity.
This patch randomizes the node list in the backend (therefore, each node
should have it's own order of ssh-ing to the other nodes) and the chance
of these alarms should be reduced.
Reviewed-by: ultrotter
Iustin Pop [Mon, 12 May 2008 09:07:47 +0000 (09:07 +0000)]
bdev: always log command output if it failed
Currently many error handling code paths in bdev.py log only
result.fail_reason (i.e. exit code or signal that killed the command)
but not its output. This makes debugging very hard.
The patch changes all places where we only log fail_reason to also log
result.output.
Reviewed-by: ultrotter
Iustin Pop [Sat, 10 May 2008 08:23:57 +0000 (08:23 +0000)]
DRBD: Fix another bug in diskless activation
DRBD8 requires that we pass ‘--create-device’ to the first command that
wants to activate a new DRBD minor. We do this currently when we run the
“drbdsetup ... disk” command which we run before the network setup.
But if the LVs are missing, we skip the ‘disk’ subcommand and run only
the ‘net’ one, so it might be that the activation fails because the
minor we selected was never created in the first place.
The patch adds the required parameter to the DRBD8._AssembleNet() call.
Since it's a no-op for existing minors, it should not create any
problems (tested and works both with configured and unconfigured
minors).
Reviewed-by: ultrotter
Oleksiy Mishchenko [Fri, 9 May 2008 16:38:27 +0000 (16:38 +0000)]
Implement list of avilable for RAPI resources
Add root resource with unittest for it. The unittest also mapper test as a
legacy.
Reviewed-by: iustinp
Michael Hanselmann [Fri, 9 May 2008 12:48:22 +0000 (12:48 +0000)]
Add version 1.2.4 to NEWS file and describe remote API addition
Reviewed-by: ultrotter
Michael Hanselmann [Fri, 9 May 2008 12:46:52 +0000 (12:46 +0000)]
Add --enable-rapi parameter to configure
This allows developers and packagers to control whether they want to start
the remote API daemon, ganeti-rapi, automatically or not.
Reviewed-by: ultrotter
Michael Hanselmann [Fri, 9 May 2008 09:25:55 +0000 (09:25 +0000)]
Start and stop remote API with master role
At the moment, the remote API is always started on the master with the
default port and with no SSL encryption enabled.
Reviewed-by: iustinp
Guido Trotter [Thu, 8 May 2008 19:48:14 +0000 (19:48 +0000)]
Improve DRBDev.Open docstring as well
Reviewed-by: iustinp
Guido Trotter [Thu, 8 May 2008 19:47:55 +0000 (19:47 +0000)]
Improve DRBD8.Open's docstring a bit more
Reviewed-by: iustinp
Guido Trotter [Thu, 8 May 2008 17:26:17 +0000 (17:26 +0000)]
Fix comment typo in bdev.py
Reviewed-by: iustinp
Michael Hanselmann [Thu, 8 May 2008 15:57:57 +0000 (15:57 +0000)]
Small codestyle fixes for ganeti-noded, ganeti-master and init script
Reviewed-by: iustinp
Michael Hanselmann [Thu, 8 May 2008 15:57:35 +0000 (15:57 +0000)]
Remove unimplemented rapi resources
Reviewed-by: iustinp, amishchenko
Michael Hanselmann [Thu, 8 May 2008 15:56:33 +0000 (15:56 +0000)]
Codestyle fixes and docstring updates for rapi
Reviewed-by: iustinp
Iustin Pop [Thu, 8 May 2008 08:20:00 +0000 (08:20 +0000)]
Fix DRBD8 diskless assembling
The algorithm for attaching to existing DRBD devices is not trivial. It
has four alternatives, and there is a bug in the last one when we have
diskless devices.
The last case (local disk info matches but remote/network configuration
doesn't match) we disconnect from the network and reattach with the
correct info. We do this because correct local device has higher
priority than remote device.
However, the test we use (self._MatchesLocal) can succeed in two cases:
- we have a disk and it's the same as the one attached
- we don't have a disk and the drbd is in diskless mode
But this creates problems for the fourth case as when we already have
one diskless DRBD, activating then next one will do:
- _MatchesLocal? yes, because both config data and system have no
disks (with the effect that all diskless devices are identical)
- _MatchesRemote? no, because this disk is configured to its current
remote peer, not to our new one
The fix is trivial, although the algorithm not: we only allow overriding
the network configuration when the disk information matches and we are
not diskless, by adding the <"local_dev" in info'> test.
Reviewed-by: ultrotter
Iustin Pop [Mon, 5 May 2008 09:41:33 +0000 (09:41 +0000)]
Export the number of cpus to iallocator scripts
Now that we have the number of cpus available from the hypervisors, we
can export this to the iallocator scripts.
Reviewed-by: ultrotter
Iustin Pop [Mon, 5 May 2008 09:37:48 +0000 (09:37 +0000)]
Minor doc/help update
This shortens the help output in gnt-node so that the output looks
nicer, and improves the manual page for gnt-instance with the new
'status' field.
Reviewed-by: ultrotter
Iustin Pop [Mon, 5 May 2008 09:35:10 +0000 (09:35 +0000)]
Improve the gnt-* list field selection
This patch allows the '-o' option to the list subcommands to add more
fields to the default list instead of replacing the default list by
prefixing the fields list with '+'.
The patch also moves the listing (in the help output) of the default
field list from hardcoded to built at runtime from the actual list.
Reviewed-by: ultrotter
Guido Trotter [Mon, 5 May 2008 09:09:23 +0000 (09:09 +0000)]
Wrap exception in _DistributeConfig code
nodelist.remove(X) could potentially raise a ValueError (even if the chance
that the current node is not in the list are pretty scarce, and its absence
should raise a red flag anyway). If this happens let things go on, as that's
what the code which previously distributed the config did.
Reviewed-by: iustinp
Guido Trotter [Mon, 5 May 2008 09:09:13 +0000 (09:09 +0000)]
Simplify target generation in DistributeConfig
Currently we get the list of nodes, and for each one extract all its info, and
just to exclude it if the name matches ours. Since the list of nodes is a list
of names just use .remove() to exclude ourself from it, and use that list
directly.
Reviewed-by: iustinp
Alexander Schreiber [Fri, 2 May 2008 17:26:48 +0000 (17:26 +0000)]
Show cluster hypervisor for gnt-cluster info
Reviewed-by: iustinp
Alexander Schreiber [Fri, 2 May 2008 11:10:35 +0000 (11:10 +0000)]
Another for gnt-instance modify & HVM parameters
Another tiny fix. Anybody got a nice brown paper bag I can wear?
Reviewed-by: iustinp
Alexander Schreiber [Fri, 2 May 2008 10:05:15 +0000 (10:05 +0000)]
make gnt-modify work with new HVM parameters
This fixes gnt-instance modify so it actually works with the
new HVM parameters for Ganeti 1.2
Reviewed-by: iustinp
Iustin Pop [Wed, 30 Apr 2008 15:53:19 +0000 (15:53 +0000)]
Add node cpu count to gnt-node list
This patch adds the backend and frontend changes needed for being able
to list the cpu count.
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 30 Apr 2008 12:55:15 +0000 (12:55 +0000)]
Add new Makefile.am for lib/rapi/
Reviewed-by: iustinp
Michael Hanselmann [Wed, 30 Apr 2008 12:55:00 +0000 (12:55 +0000)]
Move target creating symlinks in lib/ into Makefile.libcommon
Reviewed-by: iustinp
Iustin Pop [Wed, 30 Apr 2008 09:39:46 +0000 (09:39 +0000)]
RAPI: Change the daemon to standard calling syntax
This patch removes the start/stop options from the ganeti-rapi daemon.
The reasons for this are multiple:
- we want to have the same startup/shutdown methods in all daemon
(call with no arguments for start, stop using start-stop-daemon or
such)
- the code for parsing /proc/net/tcp does not belong in ganeti, but in
tools like fuser (fuser -kn tcp 5080)
Note that due to how the RESTHTTPServer is written, the daemon must
currently be killed via -9, so a simple killall doesn't work.
Reviewed-by: imsnah
Guido Trotter [Wed, 30 Apr 2008 09:24:26 +0000 (09:24 +0000)]
hooks.sgml: Add cluster-verify hooks information
Reviewed-by: iustinp
Guido Trotter [Wed, 30 Apr 2008 09:24:10 +0000 (09:24 +0000)]
Add cluster-verify hooks
Only post-hooks are run on cluster verify, and then their output is sent back
to the LU, which upon failure displays it to the user and changes the result of
the execution to a failure.
Reviewed-by: iustinp
Guido Trotter [Wed, 30 Apr 2008 09:23:57 +0000 (09:23 +0000)]
Add a LU Hooks notification function
Previously LUs could be failed by pre-hooks, and post-hooks just had effects by
themselves. This patch allows a LU to define the HooksCallBack function if it
wants to know about its hooks' results and alter its results in response.
The ChainOpCode execution path contains some commented out hooks code, which
this patch modifies to run the HooksCallBack function, so this is not forgot if
it ever gets uncommented out.
Reviewed-by: iustinp
Guido Trotter [Wed, 30 Apr 2008 09:23:42 +0000 (09:23 +0000)]
HooksMaster: Make RunPhase return the rpc output
Right now the hooks output is propagated from the nodes all the way up to
HooksMaster.RunPhase, which uses it for debugging PRE hooks, but then silently
discards them. We'll now propagate it up to the Processor.ExecOpCode function,
where they can be handled for other purposes (or discarded again, of course).
This patch also improves a bit the HooksMaster.RunPhase docstring.
Reviewed-by: iustinp
Guido Trotter [Wed, 30 Apr 2008 09:23:29 +0000 (09:23 +0000)]
Remove NoHooksLU.BuildHooksEnv
Since NoHooksLU defines HPATH as None, BuildHooksEnv will never be called (as
the LogicalUnit.BuildHooksEnv docstring correctly states). Removing the
function altogether, to avoid having dead code lying around, and to make sure
the non-implemented one in LogicalUnit will be called if someone mistakenly
tries to call it, so it's immediately clear that something is wrong.
Reviewed-by: iustinp
Guido Trotter [Wed, 30 Apr 2008 09:23:15 +0000 (09:23 +0000)]
LogicalUnit.BuildHooksEnv, update docstring
The LogicalUnit.BuildHooksEnv docstring used to say that the node list should
not include the master node. This is obviously not the case checking the
relevant code, and double-checking with iustin he confirmed it just document
some obsolete behaviour. This patch removes those remarks making the docstring
shorter, easier, and, last but not least, correct! ;)
Reviewed-by: iustinp
Guido Trotter [Wed, 30 Apr 2008 09:22:59 +0000 (09:22 +0000)]
Remove non-existing arguments from some docstrings
A fewdocstrings in the HooksRunner backend class list arguments the relevant
functions do not take. Clean them up.
Reviewed-by: iustinp
Oleksiy Mishchenko [Wed, 30 Apr 2008 09:22:44 +0000 (09:22 +0000)]
Implement locking in Ganeti Remote API
Reviewed-by: iustinp
Iustin Pop [Wed, 30 Apr 2008 09:20:18 +0000 (09:20 +0000)]
RAPI: Workaround twisted failure by early import rpc
This could probably solved in a nicer way, but it seems that somehow twisted
gets imported before our rpc which overrides the default twisted reactor; or
maybe it gets imported twice or such. Anyway, importing rpc early makes the rpc
layer work.
Lest this is taken as a random thing, this can be consistently
reproduced and traces of imports are not very clear of why this happens
- nor why gnt-os works, despite having a very similar import list and
not importing rpc.
Reviewed-by: amishchenko,imsnah
Iustin Pop [Mon, 28 Apr 2008 09:44:39 +0000 (09:44 +0000)]
Move iallocator script execution to ganeti-noded
Currently the iallocator execution takes place in the master, which is a
violation of the current architecture, and will create problems with a
threaded master daemon.
This patch moves the execution to the backend, similar to the hooks
runner, by:
- introducing a new class that handles the execution in the backend
(and could be used also for listing the allocators, etc.)
- introducing a new rpc call
- replacing the actual execution in IAllocator.Run() with a rpc call
This passes burnin with the dumb allocator
Reviewed-by: imsnah
Iustin Pop [Mon, 28 Apr 2008 09:44:03 +0000 (09:44 +0000)]
Fix iallocator instance info
The commit "IAllocator: some more info exported" broke the instance list
generation due to a wrong index variable. This patch fixes that.
Reviewed-by: ultrotter
Alexander Schreiber [Fri, 25 Apr 2008 14:56:40 +0000 (14:56 +0000)]
[PATCH] show only parameters relevant to the instance
This patch modifies the code for "gnt-instance info .." to only display
instance parameters that actually apply to that instance, i.e. for PVM
instances no HVM parameters are shown and vice versa.
Reviewed-by: iustinp
Alexander Schreiber [Fri, 25 Apr 2008 13:34:28 +0000 (13:34 +0000)]
patch 4/4 extended HVM features for 1.2
This patch documents the extended HVM features.
Reviewed-by: imsnah
Alexander Schreiber [Fri, 25 Apr 2008 12:37:18 +0000 (12:37 +0000)]
patch 3/4 extended HVM features for 1.2
This patch adds hypervisor support for the extended HVM features.
Reviewed-by: iustinp
Iustin Pop [Fri, 25 Apr 2008 12:06:10 +0000 (12:06 +0000)]
IAllocator: some more info exported
This patch adds the following information to the exported info:
- hypervisor type (in the main dict)
- total memory used by primary instances (in each node dict) (can be
computed from the node+instance dicts, but it's cheap to compute
from Ganeti) (this is not live data, just from the config)
- total memory used by primary instances marked to be up, similar to
the above
Reviewed-by: imsnah
Iustin Pop [Fri, 25 Apr 2008 12:05:54 +0000 (12:05 +0000)]
IAllocator: simplify node info computation
Currently we try to convert the values returned by call_node_info to
ints, and if all succeed, we actually do the conversion. Simplify this
by doing it in one step.
The patch also adds exporting of node memory as 'reserved_memory'.
Reviewed-by: imsnah
Alexander Schreiber [Fri, 25 Apr 2008 11:38:58 +0000 (11:38 +0000)]
patch 2/4 extended HVM features for 1.2
This patch adds the commandline extensions and the code to store
and display the extended HVM features.
Reviewed-by: iustinp
Oleksiy Mishchenko [Fri, 25 Apr 2008 10:05:20 +0000 (10:05 +0000)]
Generalize RAPI request handling flow
All request we goin to hanle have similar prerun steps, lets keep them in the same bucket.
Reviewd-by: iustinp
Iustin Pop [Fri, 25 Apr 2008 09:53:26 +0000 (09:53 +0000)]
Add iallocator documentation
Reviewed-by: imsnah
Guido Trotter [Thu, 24 Apr 2008 19:45:17 +0000 (19:45 +0000)]
burnin: improve -t help message
Make the help message a bit more similar to the trunk version, which is
actually better ("Disk template" is a lot clearer than "Template type")
Reviewed-by: imsnah
Iustin Pop [Thu, 24 Apr 2008 14:54:37 +0000 (14:54 +0000)]
Chage the rapi to conform to new OpDiagnoseOS
This patch modifies the remote api to conform to the new format for the
input and output of the OpDiagnoseOS opcode.
Reviewed-by: amishchenko
Iustin Pop [Thu, 24 Apr 2008 14:54:24 +0000 (14:54 +0000)]
Backport: Rework the results of OpDiagnoseOS opcode
Currently, the opcode DiagnoseOS is the only opcode that return a
structure of objects.OS (which is a custom class, and not a simple
python object) and furthermore all the processing of OS validity across
nodes is left to the clients of this opcode.
It would be more logical to have this opcode be similar to list
instances/nodes, in the sense that:
- it should return a table of results
- the fields in the table should be selectable
This patch does the above. The possible fields are:
- name (os name)
- valid (bool representing validity across all nodes)
- node_status, which is a complicated structure required for ‘gnt-os
diagnose’
With this patch, gnt-os list becomes a very simple iteration over the
list of results, filtering out non-valid ones. gnt-os diagnose is still
complicated, but no more than before.
The burnin tool has also been modified to work with the modified
results, and is simpler because of this (it only needs to know if an OS
is valid or not, not the per-node details).
Reviewed-by: imsnah,ultrotter
Iustin Pop [Thu, 24 Apr 2008 14:44:01 +0000 (14:44 +0000)]
Style fixes for the 1.2 branch
This patch fixes:
- line too long
- missing spaces around "=" or after commas
- wrong position for a docstring
- wrong indentation
Reviewed-by: imsnah
Iustin Pop [Thu, 24 Apr 2008 11:10:14 +0000 (11:10 +0000)]
Implement replace secondary via the iallocator
This patch implements secondary replace via the iallocator. The new
opcode parameter 'iallocator' behaves like this: if passed, it will
always compute and assign a new secondary, behaving in effect as if the
secondary node has been passed. It conflicts with actually giving the
secondary too.
[Note: not tested with remote_raid1, but the code should behave the
same, we only touch CheckPrereq and we assign a node.]
The patch also adds burnin support for the replace secondary operation;
with this in place, burnin can fully work with auto-assigned nodes.
Reviewed-by: ultrotter
Iustin Pop [Thu, 24 Apr 2008 07:34:21 +0000 (07:34 +0000)]
Implement memory size option for burnin
This simple patch adds memory size for the burnin instances, which helps
testing allocator algorithm response based on the available node memory
and instance memory size values.
Reviewed-by: ultrotter
Iustin Pop [Thu, 24 Apr 2008 07:26:30 +0000 (07:26 +0000)]
Fix generalized relocate mode of IAllocator
The patch which generalized the IAllocator was half-true: it actually
put the selection of the node inside the IAllocator, so callers were not
able to specify replace primary node.
This patch does:
- split the arguments to the constructor in three sets: mode and name
are always passed, and then we differentiate between allocation
parameters and relocation ones
- add a new relocate_from option to the IAllocator constructor which
is a list of nodes we want to move the instance off
- rename the 'nodes' argument in the request object to 'relocate_from'
since this is clearer and is not confused with the result field also
called 'nodes'
Reviewed-by: ultrotter
Alexander Schreiber [Wed, 23 Apr 2008 15:26:41 +0000 (15:26 +0000)]
patch 1/4 extended HVM features for 1.2
This patch extends the config objects with the slots to handle
more HVM configuration items.
Reviewed-by: iustinp
Guido Trotter [Wed, 23 Apr 2008 14:48:11 +0000 (14:48 +0000)]
burnin: improve instance create message
When the allocator or a non-mirrored template are used the message shown by
burnin at instance creation time was wrong. Fixing it.
Reviewed-by: iustinp
Guido Trotter [Wed, 23 Apr 2008 14:47:59 +0000 (14:47 +0000)]
burnin: change the default disk type to drbd
We generally discourage people from using remote_raid1, so it makes sense to
use drbd as the default disk template for burning in 1.2.
Reviewed-by: iustinp
Guido Trotter [Wed, 23 Apr 2008 14:47:46 +0000 (14:47 +0000)]
burnin: remove created exports
Make burnin remove exports after importing the instance back.
Reviewed-by: iustinp
Guido Trotter [Wed, 23 Apr 2008 13:55:37 +0000 (13:55 +0000)]
Add gnt-backup remove functionality
This patch also fixes the LUExportInstance Prereq docstring.
Reviewed-by: iustinp
Iustin Pop [Wed, 23 Apr 2008 12:05:01 +0000 (12:05 +0000)]
Generalize the replace_secondary mode in iallocator
Currently the replace_secondary mode is too restrictive. This patch
changes this to a general 'relocate' mode where the node(s) to be
changed are specified via a new key in the request dict ('nodes') so
that we can change any of the instance's nodes.
Note that for the relocate mode, len(nodes) == required_nodes, so the
required nodes field is redundant, but it is provided for consistency
with the allocate mode.
Reviewed-by: ultrotter
Iustin Pop [Wed, 23 Apr 2008 11:38:40 +0000 (11:38 +0000)]
Correctly filter out Domain-0 from domain list if requested.
Author: schreiberal
Reviewed-by: ultrotter
Iustin Pop [Wed, 23 Apr 2008 11:02:55 +0000 (11:02 +0000)]
Implement replace_secondary in the dumb allocator
This patch allows the dumb allocator to perform the replace secondary
request type. This is done simply by not allowing the current instances
nodes as a valid selection, and using the existing instance data instead
of the request (which doesn't have the instance info when doing the
replace_secondary).
Reviewed-by: ultrotter
Iustin Pop [Wed, 23 Apr 2008 11:02:44 +0000 (11:02 +0000)]
Send required_nodes field to the iallocator scripts
This patch adds the 'required_nodes' field in the request dict for the
iallocator.
This means that the handmade-checks in the create instance can be
simplified, and that the dumb allocator can be made simple. Therefore
the patch also modifies it.
The patch also sends the disk_space_total to the script in realocate
mode and a small fix for showing errors (include stderr too).
Reviewed-by: ultrotter
Iustin Pop [Wed, 23 Apr 2008 10:58:53 +0000 (10:58 +0000)]
Allow burnin to use an iallocator in instance creation
This patch adds iallocator support to burnin, currently only in instance
creation. This means that, depending on the external algorithm, not all
nodes might get instances.
The patch also restricts node selection and iallocator options together.
Reviewed-by: ultrotter
Iustin Pop [Wed, 23 Apr 2008 10:57:08 +0000 (10:57 +0000)]
Move all iallocator functions into a class
This patch moves all the iallocator function into a separate class that
is then somewhat easier to use. It doesn't bring any new functionality.
The patch also changes the way the iallocator is called - the
OpTestAllocator opcode is no longer needed, and all its parameters
should be passed directly to the IAllocator constructor.
Reviewed-by: ultrotter
Iustin Pop [Mon, 21 Apr 2008 13:20:53 +0000 (13:20 +0000)]
Only change instance status if not already so
This patch makes the _SetInstanceStatus only change the status of the
instance (in the config file) if it's not already in the desired state.
This skips the increase of the config serial no without actual data
changes.
Reviewed-by: ultrotter
Iustin Pop [Mon, 21 Apr 2008 13:20:30 +0000 (13:20 +0000)]
Reuse common code between MarkInstance{Up,Down}
This patch creates a new method ConfigWriter._SetInstanceStatus that
consists of the common code between MarkInstanceUp and MarkInstanceDown.
These two methods become wrappers over the _SetInstanceStatus.
Reviewed-by: ultrotter