diff --git a/doc/admin.rst b/doc/admin.rst index 61f572b951fc41d41cf4041a4bbbde4301a6a19d..89941c0b4c78bb653c8c9a5eaf428fb410bc5b07 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 c898cb50439cb62aab2ecdc1410e0d2ed2fc187e..1436bcc965d08035f210deed14a16449fa5ba102 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,