On Tue, May 18, 2010 at 02:36:08PM +0200, Michael Hanselmann wrote:
> This is a first version of the instance move tool and it supports moving
> 1..N instances from one cluster to another. When moving a single instance,
> the instance can be renamed, allowing for moves within the same cluster
> (not really useful in practice, but good for testing). Documentation is
> updated to describe this new tool and its usage.
>
> The “move-instance” tool uses the workerpool to support parallel moves of
> instances. Supporting them was simple as threads were required anyway due
> to the synchronous RAPI client.
>
> Signed-off-by: Michael Hanselmann <[email protected]>
LGTM, a few small comments:
> diff --git a/doc/move-instance.rst b/doc/move-instance.rst
> new file mode 100644
> index 0000000..14e5c35
> --- /dev/null
> +++ b/doc/move-instance.rst
> @@ -0,0 +1,97 @@
> +=================================
> +Moving instances between clusters
> +=================================
> +
> +Starting with Ganeti 2.2, instances can be moved between separate Ganeti
> +clusters using a new tool, ``move-instance``. The tool has a number of
> +features:
> +
> +- Moving a single or multiple instances
> +- Moving instances in parallel (``--parallel`` option)
> +- Renaming instance (only when moving a single instance)
> +- SSL certificate verification for RAPI connections
> +
> +The design of the inter-cluster instances moves is described in detail
> +in the :doc:`Ganeti 2.2 design document <design-2.2>`. The instance move
> +tool talks to the Ganeti clusters via RAPI and can run on any machine
> +which can connect to the cluster's RAPI. Despite their similar name, the
> +instance move tool should not be confused with the ``gnt-instance move``
> +command, which is used to move an instance within the cluster.
… which is used to move without changes (instead of export/import plus
rename) an instance within the cluster.
> +
> +
> +Configuring clusters for instance moves
> +---------------------------------------
> +
> +To prevent third parties from accessing the instance data, all data
> +exchanged between the clusters is signed using a secret key, the
> +"cluster domain secret". It is recommended to assign the same domain
> +secret to all clusters of the same type, so that instances can be easily
s/same type/same security domain/ - type might be misunderstood.
> +class MoveSourceWorker(workerpool.BaseWorker):
> + def RunTask(self, rapi_factory, move): # pylint: disable-msg=W0221
> + """Executes an instance move.
> +
> + @type rapi_factory: L{RapiClientFactory}
> + @param rapi_factory: RAPI client factory
> + @type move: L{InstanceMove}
> + @param move: Instance move information
> +
> + """
> + try:
> + logging.info("Preparing to move %s from cluster %s to %s as %s",
> + move.src_instance_name, rapi_factory.src_cluster_name,
> + rapi_factory.dest_cluster_name, move.dest_instance_name)
> +
> + mrt = MoveRuntime(move)
> +
> + logging.debug("Starting destination thread")
> + source_thread = threading.Thread(name="DestFor%s" % self.getName(),
> + target=mrt.HandleErrors,
> + args=("dest", MoveDestExecutor,
> + rapi_factory.GetDestClient(),
> + mrt, ))
> + source_thread.start()
s/source_thread/destination_thread/, for clarity.
iustin