Update documentation for disk adoption
authorIustin Pop <iustin@google.com>
Sun, 14 Mar 2010 00:55:19 +0000 (01:55 +0100)
committerIustin Pop <iustin@google.com>
Mon, 15 Mar 2010 15:17:27 +0000 (16:17 +0100)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

doc/admin.rst
man/gnt-instance.sgml

index 61f572b..89941c0 100644 (file)
@@ -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
 --------------------
 
index c898cb5..1436bcc 100644 (file)
           <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>
           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,
           the size of the disk. This is similar to the Ganeti 1.2