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 [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>
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>
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>
Michael Hanselmann [Wed, 12 Aug 2009 15:51:24 +0000 (17:51 +0200)]
gnt-instance replace-disks: Add new --auto option
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 13 Aug 2009 09:41:04 +0000 (11:41 +0200)]
cmdlib: Add new automatic disk replacement mode
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 11 Aug 2009 16:29:10 +0000 (18:29 +0200)]
TLReplaceDisks: Simplify argument checking logic
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 8 Jun 2009 13:23:52 +0000 (14:23 +0100)]
Fix a typo in InitCluster
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
022c3a0b36cb60644b6861ff27ad59202883963c)
Iustin Pop [Wed, 12 Aug 2009 12:22:41 +0000 (14:22 +0200)]
Ignore results from drained nodes in iallocator
Since drained nodes could be (partially or fully) broken in iallocator,
we ignore results from these nodes when building the cluster map in
preparation for sending it to the script.
This is a cheap change for the stable branch; ideally we should not
query them at all.
The patch also fixes a typo in iallocator.rst.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Tue, 11 Aug 2009 15:30:12 +0000 (16:30 +0100)]
InstanceIpToNodePrimaryIpQuery
This implements CONFD_REQ_NODE_PIP_BY_INSTANCE_IP, and maps instance ips
to primary node ips.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Tue, 11 Aug 2009 15:29:10 +0000 (16:29 +0100)]
querylib: abstract a couple of common errors
Rather than composing them every time, we'll keep "ready-made" tuples
for unknown entries and internal errors (which is, yet, unused)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 17 Jul 2009 12:53:37 +0000 (14:53 +0200)]
SimpleConfigReader: add IP address lookup helpers
Add the following functions to SimpleConfigReader:
GetInstanceByIp, nic ip -> instance name
GetNodePrimaryIp, node name -> node primary ip
GetInstancePrimaryNode, instance name -> primary node
For the first one we precalculate the _ip_to_instance, so we don't have
to loop over all instances for each query.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Tue, 11 Aug 2009 09:35:50 +0000 (10:35 +0100)]
Add NodeRoleQuery
This implements CONFD_REQ_NODE_ROLE_BYNAME.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Tue, 11 Aug 2009 09:34:44 +0000 (10:34 +0100)]
SimpleConfigReader.GetNodeStatusFlags
Adding a way to retrieve the three node status flags, all in one go,
from SimpleConfigReader. Non-existing nodes are handled by returning
"None".
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 11 Aug 2009 09:37:51 +0000 (10:37 +0100)]
Add a common error code for confd
If we standardize common error codes, clients can make use of them to
react, rather than trying to parse error strings.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 11 Aug 2009 09:33:08 +0000 (10:33 +0100)]
Add a missing node role
Apart from being a master, a candidate, offline or drained, a node can
have one more state: none of those. Adding back the normal, nice,
healthy "just" a node! :)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 10 Aug 2009 16:17:39 +0000 (17:17 +0100)]
ConfdProcessor: move verification to __init__
During a query execution we currently verify whether we have that query
supported in our dispatch table. Since it's an error not to have it
anyway, we move this verification to the class creation, erroring out
early if such a problem exists.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 10 Aug 2009 16:09:20 +0000 (17:09 +0100)]
Implement confd queries
We'll start with a simple ping query, which returns ok if it gets no
query argument, and an error if it gets any. Also non-implemented query
are handled by the base ConfdQuery class, so we don't have to
special-case them in ConfdProcessor anymore.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 10 Aug 2009 10:48:32 +0000 (11:48 +0100)]
Add constants for a ping confd request
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 10 Aug 2009 15:41:42 +0000 (16:41 +0100)]
ConfdProcessor fix __init__ docstring
The message is an error deriving from some code moving/refactoring
happening before the initial submission
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 10 Aug 2009 15:21:39 +0000 (16:21 +0100)]
Remove unused imports from confd files
confd.server and daemons/ganeti-confd import a few modules they don't
actually use. Clean them up.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Wed, 12 Aug 2009 09:03:17 +0000 (10:03 +0100)]
Design-doc: update RedistributeConfig changes
Rewrite the part which discusses the global list of files to be distributed
updating with the description of what is going to be implemented. Just read
below..
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 11 Aug 2009 13:49:44 +0000 (15:49 +0200)]
rapi: Add /2/nodes/[node_name]/storage/modify resource
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 11 Aug 2009 13:49:12 +0000 (15:49 +0200)]
rlib2: Import rapi
This fixes ganeti-rapi which was broken in commit
7a95a954.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 7 Aug 2009 13:28:47 +0000 (15:28 +0200)]
rapi: Add /2/nodes/[node_name]/storage resource
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Mon, 10 Aug 2009 16:40:08 +0000 (17:40 +0100)]
Ship the ethers hook
doc/examples/hooks/ethers has been added without being shipped in the
released tarball. Putting a stop to this.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 11 Aug 2009 09:35:38 +0000 (10:35 +0100)]
Constants: config directories cleanup
Use variables already defined.
Introduce ganeti CONF_DIR.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Tue, 11 Aug 2009 08:25:26 +0000 (09:25 +0100)]
Ssconf IP lists: change separator
Use " " instead of ",".
Signed-off-by: Luca Bigliardi <shammash@google.com>
Luca Bigliardi [Mon, 10 Aug 2009 18:24:04 +0000 (19:24 +0100)]
Map Node/IP in ssconf IP lists
Map the node hostname with its primary/secondary ganeti IP in ssconf.
In this way a node can discover which are its IPs simply grepping ssconf files,
thus avoiding checks depending on network configuration.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Luca Bigliardi [Mon, 10 Aug 2009 16:41:14 +0000 (17:41 +0100)]
Ethers hook, compatibility with old lockfile
Remove "-l" option since some ancient systems ship a version of lockfile-progs
not supporting it.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Guido Trotter [Mon, 10 Aug 2009 15:30:21 +0000 (16:30 +0100)]
Remove a few unused imports from noded/masterd
Signed-off-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Mon, 3 Aug 2009 17:13:44 +0000 (18:13 +0100)]
init script: handle ganeti-confd as well
Adding ganeti-confd to the example init script. The daemon itself will
only start on master candidates, but the init script can just try to
start it on all nodes.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 22 Jul 2009 17:09:52 +0000 (18:09 +0100)]
Initial confd implementation
ganeti-confd is a simple asynchronous daemon, which listens on a UDP
port, passes each packet to a processor, and sends back to the client
the result.
It also listens on an inotify socket, in order to reload its
configuration when the ganeti config file changes.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Sat, 8 Aug 2009 13:25:58 +0000 (14:25 +0100)]
confd.server.ConfdProcessor
A ConfdProcessor is the job processor for a confd query.
It's responsible for all the processing, from unpacking it, verifying
it, to calculating the result.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Sat, 8 Aug 2009 13:20:28 +0000 (14:20 +0100)]
Add empty ganeti.confd module
It will be used for the confd server code, and for a basic client
library.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Sat, 8 Aug 2009 13:18:55 +0000 (14:18 +0100)]
constants for the confd daemon
Adding the various basic daemon constants for confd.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Sat, 8 Aug 2009 13:17:58 +0000 (14:17 +0100)]
Reply status constants for confd
These are valid values for the "status" field in objects.ConfdReply
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Sat, 8 Aug 2009 13:16:40 +0000 (14:16 +0100)]
Basic exceptions used by confd
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 3 Aug 2009 17:32:15 +0000 (18:32 +0100)]
SimpleConfigReader.Reload, avoid double reloads
If for some reason we try to call Reload twice but the config file
hasn't changed, we don't want to load it again. Use stat() on the file
to cheaply avoid that situation.
We also return a boolean value, according to whether we have reloaded
the config or not.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Sun, 9 Aug 2009 10:08:40 +0000 (11:08 +0100)]
SimpleConfigReader: s/Reload/_Load/
Since we use it also to load the config file initially we rename the
Reload function to _Load. Then we re-export it as Reload to clients
(since for them it's a reload).
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Mon, 10 Aug 2009 08:59:50 +0000 (09:59 +0100)]
Run post cluster initialization LU
Call PostInitCluster from 'gnt-cluster init'.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Luca Bigliardi [Mon, 10 Aug 2009 08:48:48 +0000 (09:48 +0100)]
Post cluster initialization LU
Add an 'empty' logical unit to run hooks after cluster initialization.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 14 May 2009 15:00:32 +0000 (17:00 +0200)]
Move HVM's device_model to a hypervisor parameter
This moves yet another hardcoded value to a hypervisor parameter. I
removed the 64/32 difference as it doesn't seem valid to me - it's more
of a local site config rather than arch config.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit
09ea8710e47288e73746698c50f328e400c056c9)
Iustin Pop [Thu, 14 May 2009 12:58:32 +0000 (14:58 +0200)]
Implement the KERNEL_PATH parameter for xen-hvm
For the xen-hvm hypervisor, the KERNEL_PATH parameter is needed but
today is hardcoded to a constants in the xen hypervisor library (argh!).
This patch moves this to a hypervisor constant with the default value
being the current hardcoded path. This will allow cluster/instance
customisation based on the installed xen version.
This should fix Debian bug #528618.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit
e2ee1cea7709a2ef82153ec808c4fc3a5bce3ea1)
Guido Trotter [Thu, 28 May 2009 09:25:36 +0000 (10:25 +0100)]
Upgrade be/hv params with default values
From time to time we're adding new be or hv parameters. With this patch
missing parameters get set to the default value when loading the cluster
object. This patch version also considers the case when hv/be params
don't exist at all, and fixes a broken unit test triggered in that
case.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
c1b42c18b914aa7ea650362ade7489448f71a523)
Guido Trotter [Thu, 28 May 2009 09:12:58 +0000 (10:12 +0100)]
Add cluster-init --no-etc-hosts parameter
If --no-etc-hosts is passed in at cluster init time we set a new
parameter in the cluster's object to false, and avoid adding nodes to
the hosts file. The UpgradeConfig function is used to set the value to
True, when upgrading from an old configuration version.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
b86a6bcd476e420269a24a9b3d6289bebba69442)
Guido Trotter [Thu, 28 May 2009 09:10:11 +0000 (10:10 +0100)]
objects: add configuration upgrade system
Add a very basic configuration update mechanism to objects.
An object can define the UpgradeConfig method, which will be called at
init time, and use it to fill in missing defaults in the configuration.
In the future we may want to make it more complex, for example adding
the config version, but for now a basic solution will do.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit
560428be4f5852813972cd2791f425cf708ca7c6)
Guido Trotter [Fri, 7 Aug 2009 12:42:32 +0000 (13:42 +0100)]
design-2.1: Change OS Flavours with OS Variants
This is the terminology used by libvirt, it's shorter, clearer, and it
makes sense. :)
Also the final sentence about "possible futures" is changed to be a bit
more clear.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 6 Aug 2009 17:38:08 +0000 (18:38 +0100)]
SimpleConfigReader: add serial numbers reading
GetConfigSerialNo and GetClusterSerialNo return respectively the serial
number for the config and for the cluster object.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 7 Aug 2009 10:07:37 +0000 (11:07 +0100)]
serializer.DumpSignedJson
Don't indent the final message.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Thu, 6 Aug 2009 17:15:15 +0000 (18:15 +0100)]
constants: confd node roles
confd will return the node role as an integer, which represents one of
the mutually exclusive roles a node can be in.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 7 Aug 2009 11:22:16 +0000 (12:22 +0100)]
Merge branch 'master' into next
* master:
Update NEWS and version for 2.0.3 release
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
Implement --ignore-size in activate-disks
Add ignore size support in _AssembleInstanceDisks
Add a objects.Disk.UnsetSize() method
bdev: allow ignoring of size in Assemble()
Fix instance import net option
Simplify the devel/upload script
Add a Copy method to object.ConfigObject
Extend call_node_start_master rpc with no_voting
Conflicts:
daemons/ganeti-masterd
s/SimpleConfigReader/SimpleStore/ VS start-master no-voting
(kept both)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Thu, 6 Aug 2009 17:08:34 +0000 (18:08 +0100)]
constants: confd query types
Initially confd will support only two queries:
CONFD_REQ_NODE_ROLE_BYNAME
Given a node name, return its role.
CONFD_REQ_NODE_PIP_BY_INSTANCE_IP
Given an instance ip, return its node primary ip.
This rather weird query is the basis for ganeti nbma lookup.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Fri, 7 Aug 2009 10:05:04 +0000 (11:05 +0100)]
design-2.1: detail confd wire protocol
Until now it was being kept too vague, so here we give some real
examples of how things are going to be.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 7 Aug 2009 09:23:16 +0000 (11:23 +0200)]
Update NEWS and version for 2.0.3 release
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Mon, 3 Aug 2009 15:09:28 +0000 (16:09 +0100)]
SimpleConfigReader.Reload()
Rather than initializing the config statically at class creation time,
we load it every time Reload() is called.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 5 Aug 2009 12:30:51 +0000 (13:30 +0100)]
Confd{Request,Reply} objects
These objects are used to store confd queries and replies.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 6 Aug 2009 13:44:58 +0000 (14:44 +0100)]
Serializer, remove salt_verifier functionality
The salt needs to be returned anyway, so we don't have to add another
key for the sender to recognize which request an answer is answering, so
all that infrastructure is useless. :(
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 6 Aug 2009 09:45:01 +0000 (10:45 +0100)]
pyinotify: configure checks and documentation
After
74d519e3b91845a17ae095eb7d58dd9e3d1303e8 Ganeti depends on
pyinotify. Updating the documentation accordingly and checking for its
presence at configure time.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 6 Aug 2009 09:18:41 +0000 (10:18 +0100)]
asycnotifier.AsyncNotifier
AsyncNotifier is a special asyncore class that delivers inotify events
asynchronously.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 17 Jul 2009 12:52:31 +0000 (14:52 +0200)]
SimpleConfigReader: Handle errors when loading
Handling both IOErrors and ValueErrors (thrown by the simplejson loader)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>