Importing an instance is similar to creating a new one, but additionally
one must specify the location of the snapshot. The command is::
- gnt-backup import -n TARGET_NODE -t DISK_TEMPLATE \
+ gnt-backup import -n TARGET_NODE \
--src-node=NODE --src-dir=DIR INSTANCE_NAME
-Most of the options available for the command :command:`gnt-instance
-add` are supported here too.
+By default, parameters will be read from the export information, but you
+can of course pass them in via the command line - 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
--------------------
Note that this will fail if the disks already exists.
+Conversion of an instance's disk type
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+It is possible to convert between a non-redundant instance of type
+``plain`` (LVM storage) and redundant ``drbd`` via the ``gnt-instance
+modify`` command::
+
+ # start with a non-redundant instance
+ gnt-instance add -t plain ... INSTANCE
+
+ # later convert it to redundant
+ gnt-instance stop INSTANCE
+ gnt-instance modify -t drbd INSTANCE
+ gnt-instance start INSTANCE
+
+ # and convert it back
+ gnt-instance stop INSTANCE
+ gnt-instance modify -t plain INSTANCE
+ gnt-instance start INSTANCE
+
+The conversion must be done while the instance is stopped, and
+converting from plain to drbd template presents a small risk, especially
+if the instance has multiple disks and/or if one node fails during the
+conversion procedure). As such, it's recommended (as always) to make
+sure that downtime for manual recovery is acceptable and that the
+instance has up-to-date backups.
+
Debugging instances
+++++++++++++++++++
.. note:: this command only stores a local flag file, and if you
failover the master, it will not have effect on the new master.
+Node auto-maintenance
++++++++++++++++++++++
+
+If the cluster parameter ``maintain_node_health`` is enabled (see the
+manpage for :command:`gnt-cluster`, the init and modify subcommands),
+then the following will happen automatically:
+
+- the watcher will shutdown any instances running on offline nodes
+- the watcher will deactivate any DRBD devices on offline nodes
+
+In the future, more actions are planned, so only enable this parameter
+if the nodes are completely dedicated to Ganeti; otherwise it might be
+possible to lose data due to auto-maintenance actions.
+
Removing a cluster entirely
+++++++++++++++++++++++++++
More information about the upgrade procedure is listed on the wiki at
http://code.google.com/p/ganeti/wiki/UpgradeNotes.
+There is also a script designed to upgrade from Ganeti 1.2 to 2.0,
+called ``cfgupgrade12``.
+
cfgshell
++++++++
instance OS definitions are executing properly the rename, import and
export operations.
+sanitize-config
++++++++++++++++
+
+This tool takes the Ganeti configuration and outputs a "sanitized"
+version, by randomizing or clearing:
+
+- DRBD secrets and cluster public key (always)
+- host names (optional)
+- IPs (optional)
+- OS names (optional)
+- LV names (optional, only useful for very old clusters which still have
+ instances whose LVs are based on the instance name)
+
+By default, all optional items are activated except the LV name
+randomization. When passing ``--no-randomization``, which disables the
+optional items (i.e. just the DRBD secrets and cluster public keys are
+randomized), the resulting file can be used as a safety copy of the
+cluster config - while not trivial, the layout of the cluster can be
+recreated from it and if the instance disks have not been lost it
+permits recovery from the loss of all master candidates.
+
+
Other Ganeti projects
---------------------