From 17227cd122c519a8e17531c08b835bf1ccc1ff24 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Sun, 14 Mar 2010 01:55:19 +0100 Subject: [PATCH] Update documentation for disk adoption Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- doc/admin.rst | 21 +++++++++++++++++++++ man/gnt-instance.sgml | 26 +++++++++++++++++++++----- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/doc/admin.rst b/doc/admin.rst index 61f572b95..89941c0b4 100644 --- a/doc/admin.rst +++ b/doc/admin.rst @@ -326,6 +326,27 @@ one must specify the location of the snapshot. The command is:: Most of the options available for the command :command:`gnt-instance add` are supported here too. +Import of foreign instances ++++++++++++++++++++++++++++ + +There is a possibility to import a foreign instance whose disk data is +already stored as LVM volumes without going through copying it: the disk +adoption mode. + +For this, ensure that the original, non-managed instance is stopped, +then create a Ganeti instance in the usual way, except that instead of +passing the disk information you specify the current volumes:: + + gnt-instance add -t plain -n HOME_NODE ... \ + --disk 0:adopt=lv_name INSTANCE_NAME + +This will take over the given logical volumes, rename them to the Ganeti +standard (UUID-based), and without installing the OS on them start +directly the instance. If you configure the hypervisor similar to the +non-managed configuration that the instance had, the transition should +be seamless for the instance. For more than one disk, just pass another +disk parameter (e.g. ``--disk 1:adopt=...``). + Instance HA features -------------------- diff --git a/man/gnt-instance.sgml b/man/gnt-instance.sgml index c898cb504..1436bcc96 100644 --- a/man/gnt-instance.sgml +++ b/man/gnt-instance.sgml @@ -75,7 +75,10 @@ <sbr> <group choice="req"> - <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg> + <arg rep="repeat">--disk=<replaceable>N</replaceable>:<group choice="req"> + <arg>size=<replaceable>VAL</replaceable></arg> + <arg>adopt=<replaceable>LV</replaceable></arg> + </group>,mode=<replaceable>ro|rw</replaceable></arg> <arg>-s <replaceable>SIZE</replaceable></arg> </group> <sbr> @@ -126,15 +129,28 @@ The <option>disk</option> option specifies the parameters for the disks of the instance. The numbering of disks starts at zero, and at least one disk needs to be passed. For each - disk, at least the size needs to be given, and optionally - the access mode (read-only or the default of read-write) can - also be specified. The size is interpreted (when no unit is - given) in mebibytes. You can also use one of the suffixes + disk, either the size or the adoption source needs to be + given, and optionally the access mode (read-only or the + default of read-write) can also be specified. The size is + interpreted (when no unit is given) in mebibytes. You can + also use one of the suffixes <literal>m</literal>, <literal>g</literal> or <literal>t</literal> to specificy the exact the units used; these suffixes map to mebibytes, gibibytes and tebibytes. </para> + <para> + When using the <option>adopt</option> key in the disk + definition, Ganeti will reuse those volumes (instead of + creating new ones) as the instance's disks. Ganeti will + rename these volumes to the standard format, and (without + installing the OS) will use them as-is for the + instance. This allows migrating instances from non-managed + mode (e.q. plain KVM with LVM) to being managed via + Ganeti. Note that this works only for the `plain' disk + template (see below for template details). + </para> + <para> Alternatively, a single-disk instance can be created via the <option>-s</option> option which takes a single argument, -- GitLab