Iustin Pop [Wed, 10 Jun 2009 10:34:47 +0000 (12:34 +0200)]
Convert node_volumes rpc to new style result
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 10:09:07 +0000 (12:09 +0200)]
Conver node_leave_cluster rpc to new style result
This patch converts this rpc call to the new style result, and also
changes in the process the meaning of the QuitGanetiException's
arguments and the node daemon rpc call exception handler.
The problem with the exception handler is that we used a two-stage one,
and the inner used to catch all exception (including this one), so in
the logs we always had an exception logged, instead of the normal
'leaving cluster message'. The patch also adds logging of the
exception's arguments, so that we have a trail in the logs about the
shutdown mode.
The exception's arguments were reversed from the normal RPC results
style. While it makes somewhat more sense for this exception, we change
them such that they match the rpc result format.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 09:11:56 +0000 (11:11 +0200)]
Convert node_stop_master rpc to new style result
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 09:08:40 +0000 (11:08 +0200)]
Convert node_start_master to new style result
This is used in multiple places outside cmdlib.py, so it's a more
interesting patch.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 08:57:50 +0000 (10:57 +0200)]
Convert node_verify rpc to new result style
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 09:40:55 +0000 (11:40 +0200)]
Remove utils.CheckDict since it's no longer used
Only the custom handling in rpc.py for call_node_info used this, so now
it can be removed.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 08:46:08 +0000 (10:46 +0200)]
Convert node_info rpc to new style result
This patch also does some cleanup and enforces valid results (with
proper type, i.e. int for memory/disk values) from remote node,
otherwise we handle the result as failure.
We do this so that we can remove custom processing in rpc.py which is
very old and doesn't play with the new style result (and has bit me by
modifying the result received from the remote node).
After this change, the node_info rpc becomes a normal one.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 08:44:51 +0000 (10:44 +0200)]
Convert node_has_ip_address rpc to new style
This should actually have a function in backend, but it's fine for now.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 15:52:43 +0000 (17:52 +0200)]
Convert instance_list rpc to new style result
Since backend.GetInstanceList() is used both as RPC endpoint and as
internal function, it can't return (status, value). Instead it returns
only valid instance info, and failures are denoted by exceptions; and
the ganeti-noded function adds the (True,) status.
The patch also fixes a typo.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 15:18:29 +0000 (17:18 +0200)]
Convert all_instances_info rpc to new result style
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 14:00:28 +0000 (16:00 +0200)]
Convert instance_info rpc to new style result
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 13:32:53 +0000 (15:32 +0200)]
Convert instance_os_import rpc to new style result
This changes from a list of booleans to «status, error messages». This
means that instead knowing which disk has failed (position based), we
get a list of all failures (with details how they failed).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 13:17:39 +0000 (15:17 +0200)]
Convert bridges_exist to new style result
This was a very simple (boolean) RPC, so converting it to actually have
more value with the new style results was more difficult.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 13:02:44 +0000 (15:02 +0200)]
Convert vg_list rpc to new style result
This doesn't have known failure modes but converting will help later.
We also now call directly utils.ListVolumeGroups() instead of the
backend.ListVolumeGroups() so that we don't have to undo the (status,
value) result type.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 12:45:49 +0000 (14:45 +0200)]
Convert volume_list rpc to new style result
This is a big change, because we need to cleanup its users too.
The call and thus LUVerifyDisks LU used to differentiate between failure
at node level and failure at LV level, by returning different types in
the RPC result. This is way too complicated for our needs.
The patch changes to new style result (easy change), and then:
- changes LUVerifyDisks.Exec() to return a tuple of 3-elements
instead of 4-elements; we collapse the «nodes not reachable» and
«nodes with LVM errors» in a single dict
- changes gnt-cluster to parse 3-element results and simplifies the
different by-error handling code
Note that the status is added in ganeti-noded, and not in the function
itself, as the function is used in other places too.
This was tested with down nodes and broken VGs.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 10:13:02 +0000 (12:13 +0200)]
Convert export_remove rpc to new style
This converts the export_remove rpc to new style result and also fixes
and old TODO by adding exception handling (and conversion to failure).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 10:02:48 +0000 (12:02 +0200)]
Convert export_list rpc to new style result
This is used in multiple places, so it has a little more changes than
the previous ones.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 09:50:00 +0000 (11:50 +0200)]
Convert export_info rpc to new style result
This also removes some code from ganeti-noded and rpc.py, which should
not do such processing of data (and be simply glue code). (Or
alternatively they could, if we had better infrastructure).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 09:41:29 +0000 (11:41 +0200)]
Convert finalize_export rpc to new style results
This rpc doesn't have explicit failure modes, but once all RPCs are
converted and we can catch and convert expceptions to failure in noded,
we will have meaningfull error messages.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 09:35:56 +0000 (11:35 +0200)]
Convert snapshot_export rpc to new style
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 09:25:42 +0000 (11:25 +0200)]
Convert blockdev_snapshot rpc to new result style
This also slightly changes the code in cmdlib that uses it for more
clarity.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 9 Jun 2009 09:10:37 +0000 (11:10 +0200)]
Convert blockdev_getmirrorstatus rpc to new style
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Wed, 10 Jun 2009 17:32:23 +0000 (18:32 +0100)]
Iallocator: NIC parameters
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 10 Jun 2009 16:46:47 +0000 (17:46 +0100)]
Xen: NIC parameters
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 10 Jun 2009 15:28:36 +0000 (16:28 +0100)]
KVM: NIC parameters
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 10 Jun 2009 13:34:03 +0000 (14:34 +0100)]
OSEnvironment: convert to NIC parameters
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 10 Jun 2009 13:25:25 +0000 (14:25 +0100)]
rpc: fill in NIC parameters in instances
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 12:29:40 +0000 (13:29 +0100)]
Remove bridge and default_bridge from objects
These values are deprecated, and not used in 2.1 anymore.
The slots are still there to allow auto-upgrading from 2.0.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 10 Jun 2009 10:41:29 +0000 (11:41 +0100)]
NIC Parameters: fix hooks environment generation
In order to do that we change the way nics are espected to be passed to
the _BuildInstanceHookEnv function, from (ip, bridge, mac) to (ip, mac,
mode, link).
To translate new nics, which have the ip, mac and nicparams fields to
this new format we add an auxiliary _PreBuildNICHooksList function,
which is called both in _BuildInstanceHookEnvByObject and in
LUCreateInstance, where we don't have an Instance object created yet, at
hooks execution time.
LUSetInstanceParams hooks generation is also changed to provide the
right override to the nics field, should any nics be modified.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 10 Jun 2009 09:53:49 +0000 (10:53 +0100)]
Remove config.GetDefBridge
Default bridge is now handled with nic parameters, and this function is
unused.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 12:56:26 +0000 (13:56 +0100)]
QueryClusterInfo: don't show default_bridge
Since default_bridge is deprecated, avoid displaying it when querying
for cluster information.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 13:07:39 +0000 (14:07 +0100)]
config unittests: use nic params
The target test cluster should have nic params, rather than a default
bridge.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 12:57:26 +0000 (13:57 +0100)]
InitCluster: don't set default_bridge
And remove the -b option, as default nic parameters can be used instead.
We could support the option, but that would add more code, and since
cluster init is not a frequent operation, it's better to keep the code
clean.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 12:44:02 +0000 (13:44 +0100)]
_CheckInstanceBridgesExist: move to NIC parameters
Rather than checking all bridges, we check all links for bridged nics,
if any. Since this function is now slightly more complex than before,
it's been split into an auxiliary function, and more parameters are
used, so that it can be called from more places, rather than
reimplementing the same code there.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 17:00:24 +0000 (18:00 +0100)]
LUSetInstanceParams: nic parameters
Hooks are dealt with in a later patch in the series.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 11 Jun 2009 12:40:28 +0000 (13:40 +0100)]
LUSetInstanceParams: abstract _GetUpdatedParams
There is some duplicated code between hv and be parameters to create the
updated parameters dict. This will need to be done also for nic
parameters, so we abstract this functionality in a function.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 16:25:46 +0000 (17:25 +0100)]
LUSetInstanceParams: save cluster
Rather than querying for the cluster multiple times, save it.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 12:34:53 +0000 (13:34 +0100)]
LUCreateInstance: NIC parameters
Instance creation is changed to support the new nic parameters.
Hooks are dealt with in a later patch in the series.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 9 Jun 2009 12:25:34 +0000 (13:25 +0100)]
Add nicparams to the NIC object
Also populate nicparams with a sensible default for imported instances.
Unfortunately we don't know if the bridge set up in old nics is the
default one or not, and we don't have access to the config cluster
object here to verify, so we'll just copy it without questions.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 10 Jun 2009 15:37:51 +0000 (17:37 +0200)]
Fix gnt-instance reinstall
Commit
55efe6dabe48e5c37dc1ff6099e0bb8afde7a468 "Convert instance
reinstall to multi instance model" actually broke instance reinstall for
single-instance cases. This one-liner fixes it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 10:53:18 +0000 (12:53 +0200)]
Fix ConfigWriter._DistributeConfig error handling
Commit
1b54fc6c2fd92b614c029cc5312d02f9f1526253 added a typo (due to
copy-paste) in the error handling path of this function.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 10 Jun 2009 09:48:47 +0000 (11:48 +0200)]
Fix node add and RedistributeAncillaryFiles
Commit
28eddce5249f35c2c330a04da07b74950877dcf5 added the
RedistributeAncillaryFiles, but it calls it with a wrong parameter and thus
makes node add fail.
This one-liner fixes it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 8 Jun 2009 16:38:00 +0000 (18:38 +0200)]
rpc: Add a simple failure reporting framework
This patch adds a simple failure reporting tool, similar to bdev's
_ThrowError. In backend, we move towards the new-style RPC results (of
type (status, payload)) and thus functions which use this style can very
easily log and return the error message using this new function.
The exception is declared here and not in errors.py since it's local to
the node-daemon/backend combination.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Mon, 8 Jun 2009 13:09:00 +0000 (14:09 +0100)]
Show nic parameters in cluster info
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 5 Jun 2009 15:09:11 +0000 (16:09 +0100)]
Allow modifying of default nic parameters
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 5 Jun 2009 15:08:23 +0000 (16:08 +0100)]
Allow setting NIC parameters at gnt-cluster init
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 5 Jun 2009 15:04:45 +0000 (16:04 +0100)]
gnt-cluster init, simplify parameter checks
Don't check for non-existant BE parameters, ForceDictType will do it
Use utils.FillDict to populate the defaults
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 8 Jun 2009 10:32:51 +0000 (11:32 +0100)]
Cluster: add nicparams, and update them on upgrade
This also migrates the default bridge from the cluster object to the nic
params, at load time. Since we don't support changing the default bridge
after cluster init, this is ok for now. In the future we'll make
gnt-cluster init --bridge to the right thing, after the nic parameter
implementation is finished.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 8 Jun 2009 11:36:14 +0000 (12:36 +0100)]
Add NIC.CheckParameterSyntax
This function will be used to check the NIC parameters for validity.
Unittests are included.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 5 Jun 2009 14:38:38 +0000 (15:38 +0100)]
nic parameters: constants
Introducing the constants used for implementing nic parameters in
Ganeti, according to the 2.1 design.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 8 Jun 2009 10:27:26 +0000 (11:27 +0100)]
Abstract Param upgrade from cluster.UpgradeConfig
A new UpgradeGroupedParams is used to upgrade all the profiles for one
parameter filling in the default values, or creating the whole dict
anew, should it be missing. This is used only for beparams, currently,
but will be used at least for nicparams and diskparams as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Mon, 8 Jun 2009 09:58:59 +0000 (10:58 +0100)]
Change BEGR_DEFAULT to PP_DEFAULT
This way the same constant can represent the default profile also for
nic, disk and OS parameters.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 5 Jun 2009 14:57:22 +0000 (15:57 +0100)]
Move FillDict at module level
This way it can be also used by scripts and other object types.
Signed-off-by: Guido Trotter <ultrotter@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>
Iustin Pop [Mon, 8 Jun 2009 15:48:48 +0000 (17:48 +0200)]
Convert call_blockdev_removechildren to new result
This patch converts blockdev_removechildren to new result type and
slightly changes a message in addchildren to match this (paired)
function.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 8 Jun 2009 15:38:31 +0000 (17:38 +0200)]
Convert call_blockdev_addchildren to new result
This patch converts the blockdev_addchildren rpc call to the new result
format.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 8 Jun 2009 15:30:44 +0000 (17:30 +0200)]
Convert rpc call_blockdev_rename to (status, data)
This small patch converts the call_blockdev_rename to the new result
type.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 8 Jun 2009 15:20:56 +0000 (17:20 +0200)]
A small makefile rule to create a TAGS file
This helps emacs users ☺
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Thu, 4 Jun 2009 12:48:35 +0000 (13:48 +0100)]
2.1 design: non bridged instances support
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 27 May 2009 15:23:44 +0000 (16:23 +0100)]
2.1 design: disk/net parameters
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
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>
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>
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>
Guido Trotter [Thu, 28 May 2009 10:25:02 +0000 (11:25 +0100)]
Convert UploadFile (and its callers) to new rpc
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 28 May 2009 10:05:22 +0000 (11:05 +0100)]
UploadFile: allow ancillary files
Currently UploadFile is restricted to a static set of files, and thus
gnt-cluster redist-conf (silently) fails to upload all config files.
With this patch we add the new static files we distribute, and all
hypervisor-provided ancillary files.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 26 May 2009 17:41:19 +0000 (19:41 +0200)]
Add a node powercycle command
This (somewhat big) patch adds support for remotely rebooting the nodes
via whatever support the hypervisor has for such a concept.
For KVM/fake (and containers in the future) this just uses sysrq plus a
‘reboot’ call if the sysrq method failed. For Xen, it first tries the
above, and then Xen-hypervisor reboot (we first try sysrq since that
just requires opening a file handle, whereas xen reboot means launching
an external utility).
The user interface is:
# gnt-node powercycle node5
Are you sure you want to hard powercycle node node5?
y/[n]/?: y
Reboot scheduled in 5 seconds
The node reboots hopefully after sending the reply. In case the clock is
broken, “time.sleep(5)” might take ages (but then I suspect SSL
negotiation wouldn't work).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 26 May 2009 15:00:16 +0000 (17:00 +0200)]
Add a new CONFIRM_OPT option to cli.py
Today we are not very consistent as to what ‘--force’ represents:
sometimes confirmation, sometimes forcing a possible dangerous option,
etc.
This patch adds a new ‘--yes’ option that should be used for all simple
confirmations of genre “yes, I really want to remove the instance”.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 22 May 2009 14:35:46 +0000 (15:35 +0100)]
IsNormAbsPath and users, use "normalized" term
We used to refer to normalized paths as "normal" which might be
confusing. This fixes the syntax in all current IsNormAbsPath users and
in the docstring.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 22 May 2009 12:48:27 +0000 (13:48 +0100)]
Hypervisors: make absolute path checking strict
Use the new utils.IsAbsNormPath function, rather than just os.path.isabs
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 22 May 2009 12:35:30 +0000 (13:35 +0100)]
Add utils.IsNormAbsPath function
Currently most of the time we check for absolute path, but that doesn't
protect us from some invalid paths. In some places we should be more
strict, and this function should help us to.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 22 May 2009 12:27:46 +0000 (14:27 +0200)]
Convert instance reinstall to multi instance model
This patch converts ‘gnt-instance reinstall’ from single-instance to
multi-instance model; since this is dangerours, it's required to pass
“--force --force-multiple” to skip the confirmation.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 22 May 2009 11:01:35 +0000 (13:01 +0200)]
gnt-instance batch-create: use the job executor
This small patch changed the batch create functionality to use the job
executor instead of single-job submits.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Fri, 22 May 2009 10:25:31 +0000 (12:25 +0200)]
Modify cli.JobExecutor to use SubmitManyJobs
This patch changes the generic "multiple job executor" to use the many
jobs submit model, which automatically makes all its users use the new
model.
This makes, for example, startup/shutdown of a full cluster much more
logical (all the submitted job IDs are visible fast, and then waiting
for them proceeds normally).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Thu, 21 May 2009 15:23:55 +0000 (16:23 +0100)]
KVM: add the network script to the ancillary files
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 21 May 2009 15:15:50 +0000 (16:15 +0100)]
Xen: add ancillary files
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 20 May 2009 13:02:28 +0000 (14:02 +0100)]
_RedistributeAncillaryFiles: add hypervisor files
Each hypervisor can declare additional files to be shipped to all nodes.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 20 May 2009 11:18:32 +0000 (12:18 +0100)]
_RedistributeAncillaryFiles function
This function is shared between AddNode and RedistributeConfig, and used
to redistribute additional files which are inherently part of the
cluster configuration.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 13 May 2009 10:33:57 +0000 (11:33 +0100)]
Remove the HTS_COPY_VNC_PASSWORD constant/feature
Currently just for xen-hvm we copy the vnc password on node-add. This
will be changed for 2.1 with a more advanced gnt-cluster redist-conf
functionality which is going to be used by node-add as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Thu, 21 May 2009 15:21:27 +0000 (16:21 +0100)]
KVM: replace hardcoded network script path
Currently the kvm automatic network scripts accepts to be overridden by
an user supplied /etc/ganeti/kvm-vif-bridge script. We keep this
functionality but move the hardcoded path to a constant, dependent also
on SYSCONFDIR.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 21 May 2009 16:02:42 +0000 (18:02 +0200)]
Add a luxi call for multi-job submit
As a workaround for the job submit timeouts that we have, this patch
adds a new luxi call for multi-job submit; the advantage is that all the
jobs are added in the queue and only after the workers can start
processing them.
This is definitely faster than per-job submit, where the submission of
new jobs competes with the workers processing jobs.
On a pure no-op OpDelay opcode (not on master, not on nodes), we have:
- 100 jobs:
- individual: submit time ~21s, processing time ~21s
- multiple: submit time 7-9s, processing time ~22s
- 250 jobs:
- individual: submit time ~56s, processing time ~57s
run 2: ~54s ~55s
- multiple: submit time ~20s, processing time ~51s
run 2: ~17s ~52s
which shows that we indeed gain on the client side, and maybe even on
the total processing time for a high number of jobs. For just 10 or so I
expect the difference to be just noise.
This will probably require increasing the timeout a little when
submitting too many jobs - 250 jobs at ~20 seconds is close to the
current rw timeout of 60s.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 20 May 2009 16:19:44 +0000 (18:19 +0200)]
Doc fixes for RAPI
After moving the documentation from the .py files to .rst, we had some
cleanups to do.
This fixes the formatting of the comments, improves them a little, and
removes deprecated info (DOC_URI) from the python source.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Wed, 20 May 2009 13:16:16 +0000 (14:16 +0100)]
Merge branch 'master' into branch-2.1
Iustin Pop [Tue, 19 May 2009 13:01:17 +0000 (15:01 +0200)]
Release 2.0rc5
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 18 May 2009 19:15:41 +0000 (21:15 +0200)]
Move to data-based hvparam checks instead of code
Currently the hypervisor parameters are checked using hard-coded snippets in
each hypervisor. However, most parameter checks fall into three cases:
- file check
- directory check
- string value in a set
And the remaining ones are checked using simple functions.
This patch moves to a declarative-style for these parameter checks; in
hv_base we add the necessary infrastructure for these checks, and the
above common cases.
This translates into complete removal of the Check/Verify functions for
the Xen hypervisors, and a drastic reduction for the KVM one (which has
inter-parameter dependencies and thus can't use a simple table).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 19 May 2009 13:43:54 +0000 (15:43 +0200)]
Merge commit 'origin/next' into branch-2.1
* commit 'origin/next': (25 commits)
Move more hypervisor strings into constants
Add -H/-B startup parameters to gnt-instance
call_instance_start: add optional hv/be parameters
Fix gnt-job list argument handling
Instance reinstall: don't mix up errors
Don't check memory at startup if instance is up
gnt-cluster modify: fix --no-lvm-storage
LUSetClusterParams: improve volume group removal
gnt-cluster info: show more cluster parameters
LUQueryClusterInfo: return a few more fields
Add the new DRBD test files to the Makefile
Remove some superfluous imports
Make Python interpreter selectable for test scripts
Pass optional arguments to the daemons
ganeti.initd: include defaults file, if present
Fix ;; indentation in the main initd loop
Avoid DeprecationWarning on Python >= 2.6
ganeti-noded: add bind address option
Fix compatibility with DRBD 8.3
Fix compatibility with DRBD 8.2
...
Iustin Pop [Mon, 18 May 2009 19:15:41 +0000 (21:15 +0200)]
Move more hypervisor strings into constants
This patch adds constants for the mouse and boot order strings; while
there are still some issues remaining, we're trying to cleanup hardcoded
strings from the hypervisors.
Since the formatting of frozensets is currently wrong, we also add an
utility function for this and change all the error messages to use it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 19 May 2009 11:23:31 +0000 (13:23 +0200)]
watcher: try to restart the master if down
Bugs in either our code or in associated libraries can bring the master daemon
down, and this (due to the 2.0 architecture) stops all work on the cluster.
Since the watcher already does periodic checks on the cluster, we modify
it to try to start the master automatically in case of failures to
connect. This will be tried only once per cycle.
Also, in this case, we modify the code so that the watcher status file
is not updated - its timestamp will reflect thus the time of last
successful connection to the master.
Side note: the except errors.ConfigurationError part could be cleaned
up, since in 2.0 we don't usually get that directly, and if we do it's
an error and we shouldn't touch the file anyway; but that is not a rc5
change.
Signed-off-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 19 May 2009 09:35:56 +0000 (11:35 +0200)]
IAllocator: export total disk size for instances
This patch adds for current instance a ‘disk_space_total’ key, similar
to the key for the new instance in case of new allocations.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 18 May 2009 17:21:44 +0000 (19:21 +0200)]
Add -H/-B startup parameters to gnt-instance
This patch modifies the start instance script, opcode and logical unit
to support temporary startup parameters.
Different from 1.2, where only the kernel arguments were supporting
changes (and thus xen-pvm specific), this version supports changing all
hypervisor and backend parameters (with appropriate checks).
This is much more flexible, and allows for example:
- start with different, temporary kernel
- start with different memory size
Note: in later versions, this should be extended to cover disk
parameters as well (e.g. start with drbd without flushes, start with
drbd in async mode, etc.).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Mon, 18 May 2009 16:39:29 +0000 (18:39 +0200)]
call_instance_start: add optional hv/be parameters
This patch modifies the rpc.call_instance_start - the master side - to
take optional hv/be parameters. The noded side is unchanged and
oblivious to the change.
This will allow implementation of single-user capability and such on
startup (temporary, as opposed to permanent).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Mon, 18 May 2009 15:57:25 +0000 (16:57 +0100)]
Fix gnt-job list argument handling
Currently QueryJob returns "None" when a wrong job ID is passed.
Handle this in gnt-job list, by printing an error for each wrong job,
and still giving output for all the jobs which actually do exist.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 15 May 2009 08:44:13 +0000 (09:44 +0100)]
Instance reinstall: don't mix up errors
If the remote info rpc call fails we can't assume that the instance is
up.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 15 May 2009 08:42:55 +0000 (09:42 +0100)]
Don't check memory at startup if instance is up
Signed-off-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Thu, 14 May 2009 12:47:49 +0000 (13:47 +0100)]
2.1 design: add VNC console password changes
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 13 May 2009 12:49:11 +0000 (13:49 +0100)]
2.1 design: OS parameters
Initial design for the OS parameter changes proposed for 2.1.
Signed-off-by: Guido Trotter <ultrotter@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>
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>
Guido Trotter [Wed, 13 May 2009 11:15:52 +0000 (12:15 +0100)]
2.1 design: propose redistribute config changes
This patch proposes a mini-design to improve redistribute-config and
integrate it better with other logical units.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 12 May 2009 17:34:42 +0000 (18:34 +0100)]
gnt-cluster modify: fix --no-lvm-storage
Currently doing a gnt-cluster-modify --no-lvm-storage is silently
ignored, as it passes a None value in vg_name, which is the same as not
modifying that parameter. Explicitely set the passed value to '', so the
non-true not-None value can be evaluate to actually remove a volume
group.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Tue, 12 May 2009 17:24:40 +0000 (18:24 +0100)]
LUSetClusterParams: improve volume group removal
Currently LUSetClusterParams will remove the volume group if the vg_name
field passed in is not true, but not None. Setting the target volume
group to False or the empty string, though, is a bad idea because it's
not a boolean value, and at cluster init we set it to None if
--no-lvm-storage is passed. With this fix we handle '' (or any other
non-None false value) as the "unset" value, but actually store None in
the config.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>