Guido Trotter [Sun, 23 Aug 2009 17:13:55 +0000 (20:13 +0300)]
Implement timers in confd
Timers are used both for checking for inotify failures, and for polling,
should inotify notices become too frequent.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Sun, 23 Aug 2009 17:07:42 +0000 (20:07 +0300)]
constants: add confd reload and rate limit times
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Sun, 23 Aug 2009 15:57:48 +0000 (16:57 +0100)]
ConfdInotifyEventHandler.enable: use InotifyError
Rather than raising ConfdFatalError directly
ConfdInotifyEventHandler.enable raises InotifyError should it not be
able to configure inotify, allowing the caller to decide what to do.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 21 Aug 2009 10:18:33 +0000 (12:18 +0200)]
Add errors.InotifyError
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Sun, 23 Aug 2009 15:50:01 +0000 (16:50 +0100)]
ConfdInotifyEventHandler, move to a callback
ConfdInotifyEventHandler used to reload the config whenever a
notification arrived. Moving to a callback system, so that
ConfdConfigurationReloader can be responsible for that functionality.
Additionally the inotify class no longer reenables itself automatically,
but just notifies the callback if it's been disabled, and waits for its
call to enable(). This allows, should ConfdConfigurationReloader decide
it wants to move to polling, to avoid having a double enable()/disable()
call.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Sun, 23 Aug 2009 15:42:59 +0000 (16:42 +0100)]
Move creation of inotify handler to a new class
This class will be responsible for managing inotify notifications,
timers, and rate-limiting reloads. For now none of these features is
implemented. :)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Sun, 23 Aug 2009 15:36:07 +0000 (16:36 +0100)]
ConfdInotifyEventHandler: add enable/disable
Make possible to enable and disable the inotify event handler. The
inotify handler will remain enabled, unless explicitely told to disable
itself.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 28 Aug 2009 08:18:04 +0000 (11:18 +0300)]
SimpleConfigReader: handle stat() errors
Also, catch EnvironmentError, rather than IOError, when trying to read
the file.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 27 Aug 2009 13:02:50 +0000 (15:02 +0200)]
Encode the actual exception raised by LU execution
Currently, the actual exception raised during an LU execution (one of
OpPrereqError, OpExecError, HooksError, etc.) is lost because the
jqueue.py code simply sets that to a str(err), and the code in cli.py
simply passes that string to OpExecError.
This patch moves to encoding the errors as per errors.EncodeError and
changes the cli code to parse and raise that (if possible).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 27 Aug 2009 13:01:23 +0000 (15:01 +0200)]
Move the luxi error handling into errors.py
Currently the luxi error handling is hardcoded as special encoding on
the masterd-side and special decoding on the client side. This patch
moves it to errors.py such that other parts of the code can reuse the
same encoding.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 16:07:14 +0000 (18:07 +0200)]
Remove watcher pause file 1h past end time
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 14:47:01 +0000 (16:47 +0200)]
ganeti-watcher: Don't run if paused
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 15:50:07 +0000 (17:50 +0200)]
gnt-cluster: Add CLI for watcher pause
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 15:59:07 +0000 (17:59 +0200)]
Add file to pause watcher for a certain duration
This can be used during maintenance work.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 14:44:58 +0000 (16:44 +0200)]
cli._Argument: Remove unused, optional “suggest” parameter
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 14:43:43 +0000 (16:43 +0200)]
bash completion: Allow arguments with min < max arguments
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 11:02:35 +0000 (13:02 +0200)]
ganeti-masterd: Master voting in separate process
One shouldn't fork a Python process after using threads. Master
voting is done before forking (utils.Daemonize), but it also uses
threads. Hence it's now called from a separate process.
This patch also fixes the check function to actually exit if
the current machine is not the master (introduced in
04ccf5e9).
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 15:30:43 +0000 (17:30 +0200)]
ganeti-masterd: Add helper to run function in separate process
This will be used to do the master voting.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Wed, 26 Aug 2009 10:34:14 +0000 (11:34 +0100)]
GenerateSecret: specify the length of the secret
Add a parameter to specify the length of the bytes sequence represented by the
returned hex string. Defaulting to 20 so it's compatible with previous SHA1
hash.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 26 Aug 2009 11:30:40 +0000 (13:30 +0200)]
cmdlib: Add some messages to LUExportInstance
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 15:51:57 +0000 (17:51 +0200)]
Style fixes for ganeti-*
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 15:52:31 +0000 (17:52 +0200)]
ganeti-noded: Close listening socket in child
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 15:50:38 +0000 (16:50 +0100)]
Document cluster destroy hook
Add documentation about new cluster-destroy-post hook.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 15:19:47 +0000 (16:19 +0100)]
LUDestroyCluster: run hooks
Run post hooks on master node before it's removed.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 14:49:29 +0000 (15:49 +0100)]
LUDestroyCluster: hooks support
We're going to call hooks from its Exec method so LUDestroyCluster has to
support them.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 12:13:33 +0000 (14:13 +0200)]
Run unittests in a temporary directory
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 11:50:01 +0000 (13:50 +0200)]
Fix building in a different directory
Also add build-bash-completion to EXTRA_DIST.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 12:14:17 +0000 (14:14 +0200)]
Add script to run build commands in temporary directory
Python always compiles imported modules. By running these targets
in a temporary directory we don't pollute the source tree.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 11:56:32 +0000 (13:56 +0200)]
Makefile: Use BUILT_SOURCES
These are always built before anything else.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 09:47:24 +0000 (11:47 +0200)]
Simplify manpage building
This eliminates one temporary directory in the process.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 15:31:09 +0000 (17:31 +0200)]
Makefile: Fix docbook2man error message
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 25 Aug 2009 12:32:32 +0000 (14:32 +0200)]
Handle more errors in bash completion
Don't print error messages if cluster hasn't been initialized yet.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 15:03:09 +0000 (16:03 +0100)]
HooksMaster: fix RunPhase logging
In case of complete failure results is empty, return immediately
(tnx unittests).
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 14:15:58 +0000 (15:15 +0100)]
LURemoveNode: no logs running post on removed node
Do not log results from hooks ran on the removed node as now it's done by
RunPhase.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 14:11:53 +0000 (15:11 +0100)]
HooksMaster: logging hooks in RunPhase
Extend RunPhase so it will log hooks results in POST phase.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 25 Aug 2009 10:36:05 +0000 (12:36 +0200)]
rapi: export more static node information
Currently not all static node information is exported over rapi, and
this makes it less complete than gnt-node list. This patch attempts to
reduce the difference.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 11:56:57 +0000 (12:56 +0100)]
Document post cluster initialization LU
Update hooks documentation with the new opcode (not deleting OP_INIT_CLUSTER
from obsolete operations because the name is different).
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Mon, 24 Aug 2009 16:48:43 +0000 (17:48 +0100)]
node-remove post on removed node
Run post phase of node-remove on the removed node as well.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 25 Aug 2009 10:22:33 +0000 (11:22 +0100)]
HooksMaster: document raised exception
HooksAbort is raised, but not documented.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Mon, 24 Aug 2009 17:32:28 +0000 (18:32 +0100)]
HooksMaster: list of nodes override
Allow the caller of HooksMaster.RunPhase() to specify an alternative list of
nodes.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 21 Aug 2009 14:23:16 +0000 (16:23 +0200)]
Add burnin support for instance moves
This patch adds support for instance moves in burnin. This means that
non-drbd instances finally get support for being moved.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 24 Aug 2009 14:53:39 +0000 (16:53 +0200)]
Fix error output in LUSetClusterParams
Before:
gnt-cluster modify --enabled-hypervisors=xen-hvm,xem-pvm
Failure: command execution error:
Enabled hypervisors contains invalid entries: set([u'xem-pvm'])
After:
gnt-cluster modify --enabled-hypervisors=xen-hvm,xem-pvm
Failure: command execution error:
Enabled hypervisors contains invalid entries: 'xem-pvm'
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 14:08:04 +0000 (16:08 +0200)]
Add ArgHost class
It expands to the hostnames known by bash.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 13:50:08 +0000 (15:50 +0200)]
Re-introduce constants for most often used arguments
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 12:50:38 +0000 (14:50 +0200)]
Use script to generate bash completion
Completion for tools/burnin is not yet implemented. It needs to be
converted to definition-based options handling first.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 09:10:11 +0000 (11:10 +0200)]
Add tools directory to constants
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 09:09:33 +0000 (11:09 +0200)]
Convert “burnin” to definition-based options
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 21 Aug 2009 13:24:19 +0000 (15:24 +0200)]
Add more auto-completion metadata
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 13:53:31 +0000 (15:53 +0200)]
Make all options use cli_option
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 12:30:42 +0000 (14:30 +0200)]
Change scripts to use new argument definitions
This can be used to generate the bash completion script automatically.
In the future it may allow for better command line validation as well.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 21 Aug 2009 13:25:55 +0000 (15:25 +0200)]
cli: Add new classes for argument definitions
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 21 Aug 2009 14:07:49 +0000 (16:07 +0200)]
Add gnt-instance move
This uses the new LUMoveInstance. It supports only single-instance moves.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 21 Aug 2009 14:06:40 +0000 (16:06 +0200)]
Add OPMoveInstance and LUMoveInstance
This patch adds a basic version of LUMoveInstance. It doesn't yet
support iallocator-mode and it's implemented in old-style (non-TL) mode.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 21 Aug 2009 14:04:40 +0000 (16:04 +0200)]
Add arbitrary node support to create/remove disks
Currently the cmdlib _CreateDisks and _RemoveDisks always work on the
instance's (current/primary) nodes. This patch extends them to take an
additional target_node parameter denoting that the creation/removal
should ignore the current instance nodes and instead operate on the
given node.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 21 Aug 2009 13:58:44 +0000 (15:58 +0200)]
Add disk copy support at backend and the rpc level
This uses a simple 'dd if=… | ssh $target dd of=…' method, like the
ExportSnapshot (which uses the OS export; here we want full disk-level
copy and not any FS-level changes).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 24 Aug 2009 11:56:19 +0000 (13:56 +0200)]
Remove extra argument from HooksMaster class
The mcpu.py:HooksMaster class needs to have a proc attribute/argument to
init in ordet to call its LogWarning method. However, this is available
from the 'lu' attribute, so we can remove this dependency.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Mon, 24 Aug 2009 11:11:35 +0000 (13:11 +0200)]
cmdlib: Fix broken QueryInstanceData for plain instances
Fixes this bug:
Failure: command execution error:
Can't compute disk status for instX.domain.tld: No error information
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 12:44:48 +0000 (14:44 +0200)]
Reinsert simple timers in Mainloop
This time we use the standard python sched module, rather than doing it
all by ourselves. The scheduler in mainloop can be manipulated directly
by callers, to enter new events.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 19 Aug 2009 12:47:17 +0000 (14:47 +0200)]
Convert ganeti-confd to Mainloop
Now that mainloop is asyncore-enabled we can easily do that.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 10:20:11 +0000 (12:20 +0200)]
Convert the http server/mainloop to asyncore
We can avoid most of the Mainloop.Run() code if we use asyncore
for delivering I/O events, and just concentrate on what's missing in
asyncore: singnal handling and timers. This way confd can be ported to
use Mainloop as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 18 Aug 2009 15:53:31 +0000 (17:53 +0200)]
Pass the correct signal to handlers
Mainloop currently calls all handlers with the signal number harcoded to
sigchild. Fixing this.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Olivier Tharan <olive@google.com>
Guido Trotter [Thu, 20 Aug 2009 10:13:12 +0000 (12:13 +0200)]
design-2.1: specify hmac key permissions
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 20 Aug 2009 10:01:57 +0000 (12:01 +0200)]
design-2.1: clarify confd usage of serial numbers
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 08:21:46 +0000 (10:21 +0200)]
Convert daemon.Mainloop to @SignalHandled
This makes the function a lot simpler, since it used to install two
different signal handlers, which are now transparently handled by the
decorator. The code is unindented, but remains unchanged apart from the
part that checks the signal handlers (which is now collapsed toghether).
The option of not installing signal handlers, which was unused, is now
removed.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 08:20:34 +0000 (10:20 +0200)]
Convert ganeti-masterd to @utils.SignalHandled
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 08:18:19 +0000 (10:18 +0200)]
Add a new SignalHandled decorator
This decorator can be used to call a function holding with protection
from a given signal. The function should accept a dict of
utils.SignalHandler, indexed by signal number, and make use of it.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 07:54:37 +0000 (09:54 +0200)]
SignalHandler, only accept list of signals
utils.SignalHandler can accept either a list of signals or a single
signal, but it's always called with a list. Removing the single signal
option.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 18 Aug 2009 15:41:18 +0000 (17:41 +0200)]
Simplify IO waiting in Mainloop
IO is never unregistered in our current usage, so dropping that
functionality for now. Also putting the poller outside of the Run()
function allows us to avoid the double step of adding tuples to an
_io_wait_add queue and adding them later in the main loop.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 18 Aug 2009 15:26:40 +0000 (17:26 +0200)]
Remove timers from Mainloop
Timers are currently unused, slightly buggy (for example timeout doesn't
get updated correctly), and unneeded in the current form. Confd will
have timeouts in more simple fashion, and is not a mainloop user
anyway.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 14:08:05 +0000 (16:08 +0200)]
QA: call ganeti-confd --version
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 19 Aug 2009 14:18:00 +0000 (16:18 +0200)]
QA: remove the --default-hypervisor option
This option is gone since
1ac0f5e6d2f06a5bf12815e1b92d1338af32833c,
fixing the QA suite to deal with this.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 18 Aug 2009 09:40:02 +0000 (11:40 +0200)]
rapi: Add /2/instances/[instance_name]/info resource
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 15:19:38 +0000 (17:19 +0200)]
cli: Merge ikv_option and keyval_option into cli_option
Merging them gets rid of two public functions in cli.py and optparse explicitly
supports more than one option type per class.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 15:24:41 +0000 (17:24 +0200)]
burnin: Don't pass any disk when replacing 2nd node
Replacing the secondary node always replaces it for all disks. Commit
2945fd2d added an error message for this case.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 13:42:51 +0000 (15:42 +0200)]
cli: Use ToStdout/ToStderr instead of print
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
03298ebe95f393fc77f8acce62e5aa0b95a2bdd0)
Iustin Pop [Mon, 17 Aug 2009 13:15:45 +0000 (15:15 +0200)]
Add support for querying the ctime/mtime
This patch adds querying of ctime/mtime for the cluster/nodes/instances.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 17 Aug 2009 13:08:34 +0000 (15:08 +0200)]
Add ctime/mtime support to the main ConfigObjects
This patch adds ctime/mtime support to the “main” config objects - the
config data itself, and the cluster/nodes/instances objects.
These are not added on auto-upgrade, but rather should be migrated if it
makes sense when 2.0 is upgraded to 2.1.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 17 Aug 2009 12:51:23 +0000 (14:51 +0200)]
Add utils.FormatTime and a simple unittest
We don't format with subsecond-precision.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 13:42:51 +0000 (15:42 +0200)]
cli: Use ToStdout/ToStderr instead of print
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 11:55:04 +0000 (13:55 +0200)]
rapi: Add /2/nodes/[node_name]/storage/repair resource
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 14 Aug 2009 15:49:10 +0000 (17:49 +0200)]
Implement “gnt-node repair-volume”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 11:19:04 +0000 (13:19 +0200)]
Add opcode to repair storage volumes
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 14 Aug 2009 15:37:45 +0000 (17:37 +0200)]
Add RPC call for storage operations
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 11:02:14 +0000 (13:02 +0200)]
storage: Add operation for “vgreduce --removemissing”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 14 Aug 2009 15:33:45 +0000 (17:33 +0200)]
storage: Add new function to execute operations
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 10:48:06 +0000 (12:48 +0200)]
cmdlib: Add function to list all instances on node
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 17 Aug 2009 10:44:03 +0000 (12:44 +0200)]
cmdlib: Use common function to list instances on node
This will be used by another new function, too.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 14 Aug 2009 15:28:59 +0000 (17:28 +0200)]
cmdlib: Make TLReplaceDisks._FindFaultyDisks global
It'll be used for repairing storage units.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 14 Aug 2009 15:27:38 +0000 (17:27 +0200)]
gnt-node: Use helper function to convert storage type
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 17 Aug 2009 09:48:28 +0000 (11:48 +0200)]
Remove obsolete ConfigObject.__setitem__
__setitem__ is used to emulate container objects. We don't use this, and
the method is not used in a couple of normal operations (add/remove
instance, add/remove disk).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 14 Aug 2009 12:33:00 +0000 (14:33 +0200)]
Implement instance recreate-disks
This can be used for a 'plain' type instance when the underlying storage
went away, to recreate the storage (and reinstall) instead of removing
the instance and readding it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 14 Aug 2009 09:46:51 +0000 (11:46 +0200)]
Fix small typo in gnt-node
The iallocator option is '-I' not '-i'.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 14 Aug 2009 09:39:41 +0000 (11:39 +0200)]
Simplify handling of boolean args in rapi
This patch replaces hardcoded boolean-type args with
bool(_checkIntVariable). There should be no other cases of this left, I
think.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 14 Aug 2009 09:07:06 +0000 (11:07 +0200)]
Fix checks in LUSetNodeParms for the master node
There was a check already in the LU for the master node, however is
wasn't correct. This patch disallows any role changes on the master node
via LUSetNodeParms (and as this LU can't change anything else, it
practically prevents it from touching the master node).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 13 Aug 2009 13:52:30 +0000 (15:52 +0200)]
Improve the example startup script
Currently, the supplised script has two issues:
- it doesn't use start-stop-daemon --start correctly, leading to
messages like "ganeti.errors.GenericError:
/var/run/ganeti/ganeti-rapi.pid contains a live process" in the logs
- it doesn't allow start/stop/restart of a single daemon, which leads
to manual launch, which is bad because we don't reuse the settings
from the defaults file
For the first one, we change from ‘--exec …’ to ‘--startas …’, which is
the actual option used for start, whereas exec is a test (that also
supplies the default to startas). We also add ‘--oknodo’ as per recent
Debian policy changes.
For the second, we do a bigger change; we basically remove the full-path
and pid variables, and construct these two from the daemon name. We then
check if we are given a daemon name (in which case we only do that)
otherwise we do the requested action on all daemons.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 13 Aug 2009 12:37:47 +0000 (14:37 +0200)]
Fix insserv dependencies
(import of a Debian patch)
This patch removes xend from the list of dependencies.
Ganeti doesn't need xend running to startup, it will only need it later
(and only if xen is used as virtualisation technology). It also removes
'Xen' from the description in the init script.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 13 Aug 2009 11:45:17 +0000 (13:45 +0200)]
TLReplaceDisks: Refuse changing secondary for specific disks
We move all disks anyway.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 13 Aug 2009 11:43:48 +0000 (13:43 +0200)]
rapi: Add /2/instances/[instance_name]/replace-disks resource
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 13 Aug 2009 09:52:53 +0000 (11:52 +0200)]
rlib2: Remove leftover DOC_URI constant
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 13 Aug 2009 11:15:33 +0000 (13:15 +0200)]
Merge commit 'origin/next' into branch-2.1
* commit 'origin/next': (28 commits)
Fix a typo in InitCluster
Ignore results from drained nodes in iallocator
Ship the ethers hook
Ethers hook, compatibility with old lockfile
Remove a few unused imports from noded/masterd
Move HVM's device_model to a hypervisor parameter
Implement the KERNEL_PATH parameter for xen-hvm
Upgrade be/hv params with default values
Add cluster-init --no-etc-hosts parameter
objects: add configuration upgrade system
Update NEWS and version for 2.0.3 release
example ethers hook: use lockfile-progs
ethers hook lock: use logger not echo
ethers hook: reduce the probability of data loss
devel/upload: revert rsync -p
export: add meaningful exit code
Fix detecting of errors in export
Implement gnt-cluster check-disk-sizes
rpc: add rpc call for getting disk size
bdev: Add function for reading actual disk size
...
Conflicts:
daemons/ganeti-masterd - trivial, kept 2.1 version
lib/bootstrap.py - trivial, kept 2.1 version
lib/cmdlib.py - integrated the 2.0.3 changes
lib/constants.py - trivial
lib/hypervisor/hv_xen.py - trivial, kept 2.1 version
lib/objects.py - trivial, kept 2.1 version
lib/opcodes.py - integrated the 2.0.3 changes
Signed-off-by: Iustin Pop <iustin@google.com>