Merge branch 'master' into next
[ganeti-local] / man / gnt-backup.sgml
index ed93f26..d432b6e 100644 (file)
@@ -2,7 +2,7 @@
 
   <!-- Fill in your name for FIRSTNAME and SURNAME. -->
   <!-- Please adjust the date whenever revising the manpage. -->
-  <!ENTITY dhdate      "<date>Jul 6, 2007</date>">
+  <!ENTITY dhdate      "<date>February 11, 2009</date>">
   <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
        allowed: see man(7), man(1). -->
   <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
@@ -19,6 +19,8 @@
   <refentryinfo>
     <copyright>
       <year>2007</year>
+      <year>2008</year>
+      <year>2009</year>
       <holder>Google Inc.</holder>
     </copyright>
     &dhdate;
@@ -27,7 +29,7 @@
     &dhucpackage;
 
     &dhsection;
-    <refmiscinfo>ganeti 1.2</refmiscinfo>
+    <refmiscinfo>ganeti 2.0</refmiscinfo>
   </refmeta>
   <refnamediv>
     <refname>&dhpackage;</refname>
       </cmdsynopsis>
 
       <para>
-        Exports an instance to the target node. All the instance
-        data and its configuration will be exported under the
-        /srv/ganeti/exports/instance directory on the target node.
+        Exports an instance to the target node. All the instance data
+        and its configuration will be exported under the
+        /srv/ganeti/export/<replaceable>instance</replaceable>
+        directory on the target node.
       </para>
 
       <para>
       <title>IMPORT</title>
       <cmdsynopsis>
         <command>import</command>
-        <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
-        <arg>-s <replaceable>disksize</replaceable></arg>
-        <arg>-o <replaceable>os-type</replaceable></arg>
-        <arg>-m <replaceable>memsize</replaceable></arg>
-        <arg>-b <replaceable>bridge</replaceable></arg>
         <sbr>
+        <group choice="req">
+          <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg> <arg>--iallocator
+          <replaceable>name</replaceable></arg>
+        </group>
+        <sbr>
+
+        <arg rep="repeat">--disk <replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
+        <sbr>
+        <group>
+          <arg rep="repeat">--net <replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
+          <arg>--no-nics</arg>
+        </group>
+        <sbr>
+        <arg>-B <replaceable>BEPARAMS</replaceable></arg>
+        <sbr>
+        <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
+        <sbr>
+        <arg>--src-node=<replaceable>source-node</replaceable></arg>
+        <arg>--src-dir=<replaceable>source-dir</replaceable></arg>
+        <sbr>
+
         <arg choice="req">-t<group>
             <arg>diskless</arg>
             <arg>plain</arg>
-            <arg>local_raid1</arg>
-            <arg>remote_raid1</arg>
-          </group>
-        </arg>
-        <arg choice="req">--src-node=<replaceable>source-node</replaceable></arg>
-        <arg choice="req">--src-dir=<replaceable>source-dir</replaceable></arg>
+            <arg>drbd</arg>
+            <arg>file</arg>
+          </group></arg>
+        <sbr>
+
         <arg choice="req"><replaceable>instance</replaceable></arg>
       </cmdsynopsis>
       <para>
         Imports a new instance from an export residing on
         <replaceable>source-node</replaceable> in
         <replaceable>source-dir</replaceable>.
-        <replaceable>instance</replaceable> must be in DNS and
-        resolve to a IP in the same network as the nodes in the
-        cluster.
+        <replaceable>instance</replaceable> must be in DNS and resolve
+        to a IP in the same network as the nodes in the cluster. If
+        the source node and directory are not passed, the last backup
+        in the cluster is used, as visible with the
+        <command>list</command> command.
+      </para>
+
+      <para>
+        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
+        <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>
-        The <option>-s</option> option specifies the disk size for
-        the instance, in gigibytes (defaults to 20 GiB).
+        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
+        version (but will only create one disk).
       </para>
 
       <para>
-        The <option>-o</option> options specifies the operating
-        system to be installed. The available operating systems can
-        be listed with <command>gnt-os list</command>.
+        The minimum disk specification is therefore
+        <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
+          20G</userinput> when using the <option>-s</option> option),
+        and a three-disk instance can be specified as
+        <userinput>--disk 0:size=20G --disk 1:size=4G --disk
+          2:size=100G</userinput>.
       </para>
 
       <para>
-        The <option>-m</option> option specifies the memory size for
-        the instance, in megibytes (defaults to 128 MiB).
+        The NICs of the instances can be specified via the
+        <option>--net</option> option. By default, one NIC is created
+        for the instance, with the MAC set to the original MAC of the
+        instance (as it was at export time). Each NIC can take up to
+        three parameters (all optional):
+        <variablelist>
+          <varlistentry>
+            <term>mac</term>
+            <listitem>
+              <simpara>either a value or <constant>GENERATE</constant>
+              to generate a new unique MAC, or
+              <constant>AUTO</constant> to reuse the old MAC</simpara>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term>ip</term>
+            <listitem>
+              <simpara>specifies the IP address assigned to the
+              instance from the Ganeti side (this is not necessarily
+              what the instance will use, but what the node expects
+              the instance to use)</simpara>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term>bridge</term>
+            <listitem>
+              <simpara>specifies the bridge to attach this NIC
+              to</simpara>
+            </listitem>
+          </varlistentry>
+        </variablelist>
       </para>
 
       <para>
-        The <option>-b</option> option specifies the bridge to which the
-        instance will be connected. (defaults to the cluster-wide default
-        bridge specified at cluster intialization time).
+        Alternatively, if no network is desired for the instance, you
+        can prevent the default of one NIC with the
+        <option>--no-nics</option> option.
+      </para>
+
+      <para>
+        The <option>-B</option> option specifies the backend
+        parameters for the instance. If no such parameters are
+        specified, the values are inherited from the cluster. Possible
+        parameters are:
+        <variablelist>
+          <varlistentry>
+            <term>memory</term>
+            <listitem>
+              <simpara>the memory size of the instance; as usual,
+              suffixes can be used to denote the unit, otherwise the
+              value is taken in mebibites</simpara>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term>vcpus</term>
+            <listitem>
+              <simpara>the number of VCPUs to assign to the instance
+              (if this value makes sense for the hypervisor)</simpara>
+            </listitem>
+          </varlistentry>
+          <varlistentry>
+            <term>auto_balance</term>
+            <listitem>
+              <simpara>whether the instance is considered in the N+1
+              cluster checks (enough redundancy in the cluster to
+              survive a node failure)</simpara>
+            </listitem>
+          </varlistentry>
+        </variablelist>
       </para>
 
       <para>
             </listitem>
           </varlistentry>
           <varlistentry>
-            <term>local_raid1</term>
+            <term>drbd</term>
             <listitem>
               <para>
-                Disk devices will be md raid1 arrays over two local
-                logical volumes.
+                Disk devices will be drbd (version 8.x) on top of lvm
+                volumes.
               </para>
             </listitem>
           </varlistentry>
           <varlistentry>
-            <term>remote_raid1</term>
+            <term>file</term>
             <listitem>
-              <para>
-                Disk devices will be md raid1 arrays with one component (so
-                it's not actually raid1): a drbd device between the instance's
-                primary node and the node given by the second value of the
-                <option>--node</option> option.
-              </para>
+              <para>Disk devices will be backed up by files, under the
+              <filename
+              class="directory">@RPL_FILE_STORAGE_DIR@</filename>. By
+              default, each instance will get a directory (as its own
+              name) under this path, and each disk is stored as
+              individual files in this (instance-specific)
+              directory.</para>
             </listitem>
           </varlistentry>
         </variablelist>
       </para>
 
       <para>
+        The <option>--iallocator</option> option specifies the instance
+        allocator plugin to use. If you pass in this option the allocator will
+        select nodes for this instance automatically, so you don't need to pass
+        them with the <option>-n</option> option. For more information please
+        refer to the instance allocator documentation.
+      </para>
+
+      <para>
+        The optional second value of the <option>--node</option> is used for
+        the drbd template and specifies the remote node.
+      </para>
+
+      <para>
         If you do not want gnt-backup to wait for the disk mirror
         to be synced, use the <option>--no-wait-for-sync</option>
         option.
       <para>
         Example:
         <screen>
-# gnt-backup import -t plain -s 30 -m 512 -n node1.example.com \
-> --src-node=node2.example.com \
-> --src-dir=/srv/ganeti/exports/instance3.example.com \
+# gnt-backup import -t plain --disk 0:size=1G -B memory=512 \
+> -n node1.example.com \
 > instance3.example.com
         </screen>
       </para>
 
       <cmdsynopsis>
         <command>list</command>
-        <arg>--nodes=<replaceable>NODE-LIST</replaceable></arg>
+        <arg>--node=<replaceable>NODE</replaceable></arg>
+      </cmdsynopsis>
+
+      <para>
+        Lists the exports currently available in the default directory
+        in all the nodes of the current cluster, or optionally only a
+        subset of them specified using the <option>--node</option>
+        option (which can be used multiple times)
+      </para>
+
+      <para>
+      Example:
+<screen>
+# gnt-backup list --nodes node1 --nodes node2
+</screen>
+      </para>
+    </refsect2>
+
+    <refsect2>
+      <title>REMOVE</title>
+      <cmdsynopsis>
+        <command>remove</command>
+        <arg choice="req">instance_name</arg>
       </cmdsynopsis>
 
       <para>
-        Lists the exports currently available in the default directory in all
-        the nodes of the current cluster, or optionally only a subset of them
-        specified by the <option>--nodes</option> option.
+        Removes the backup for the given instance name, if any. If the
+        backup was for a deleted instances, it is needed to pass the
+        <acronym>FQDN</acronym> of the instance, and not only the
+        short hostname.
       </para>
 
     </refsect2>