Skip to content
Snippets Groups Projects
gnt-backup.sgml 8.47 KiB
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [

  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
  <!-- Please adjust the date whenever revising the manpage. -->
  <!ENTITY dhdate      "<date>Jul 6, 2007</date>">
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
       allowed: see man(7), man(1). -->
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
  <!ENTITY dhucpackage "<refentrytitle>gnt-backup</refentrytitle>">
  <!ENTITY dhpackage   "gnt-backup">

  <!ENTITY debian      "<productname>Debian</productname>">
  <!ENTITY gnu         "<acronym>GNU</acronym>">
  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
  <!ENTITY footer SYSTEM "footer.sgml">
]>

<refentry>
  <refentryinfo>
    <copyright>
      <year>2007</year>
      <holder>Google Inc.</holder>
    </copyright>
    &dhdate;
  </refentryinfo>
  <refmeta>
    &dhucpackage;

    &dhsection;
    <refmiscinfo>ganeti 1.2</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>&dhpackage;</refname>

    <refpurpose>ganeti instance import/export</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&dhpackage; </command>

      <arg choice="req">command</arg>
      <arg>arguments...</arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para>
      The <command>&dhpackage;</command> is used for importing and exporting
      instances and their configuration from a ganeti system. It is useful for
      backing instances up and also to migrate them between clusters.
    </para>

  </refsect1>
  <refsect1>
    <title>COMMANDS</title>

    <refsect2>
      <title>EXPORT</title>

      <cmdsynopsis>
        <command>export</command>
        <arg choice="req">-n <replaceable>node</replaceable></arg>
        <arg>--noshutdown</arg>
        <arg choice="req"><replaceable>instance</replaceable></arg>
      </cmdsynopsis>

      <para>
        Exports an instance to the target node. All the instance data
        and its configuration will be exported under the
        /srv/ganeti/exports/<replaceable>instance</replaceable>
        directory on the target node.
      </para>

      <para>
        The <option>--noshutdown</option> option will create a
        snapshot disk of the instance without shutting it down first.
        While this is faster and involves no downtime, it cannot be
        guaranteed that the instance data will be in a consistent state
        in the exported dump.
      </para>

      <para>
        Example:
        <screen>
# gnt-backup export -n node1.example.com instance3.example.com
        </screen>
      </para>
    </refsect2>

    <refsect2>
      <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>--swap-size <replaceable>disksize</replaceable></arg>
        <arg>-m <replaceable>memsize</replaceable></arg>
        <arg>-b <replaceable>bridge</replaceable></arg>
        <sbr>
        <arg choice="req">-t<group>
            <arg>diskless</arg>
            <arg>plain</arg>
            <arg>local_raid1</arg>
            <arg>remote_raid1</arg>
            <arg>drbd</arg>
          </group>
        </arg>
        <sbr>
        <arg choice="req">--src-node=<replaceable>source-node</replaceable></arg>
        <arg choice="req">--src-dir=<replaceable>source-dir</replaceable></arg>
        <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.
      </para>

      <para>
        The <option>-s</option> option specifies the disk size for
        the instance, in mebibytes (defaults to
        <constant>20480MiB</constant> =
        <constant>20GiB</constant>). 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>--swap-size</option> option specifies the swap
        disk size (in mebibytes) for the instance (the one presented
        as <filename class="devicefile">/dev/sdb</filename>). The
        default is <constant>4096MiB</constant>. As for the disk
        size, you can specify other suffixes.
      </para>
      <para>
        The <option>-m</option> option specifies the memory size for
        the instance, in mebibytes (defaults to 128 MiB). Again, you
        can use other suffixes (e.g. <userinput>2g</userinput>).
      </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).
      </para>

      <para>
        The <option>-t</option> options specifies the disk layout type for
        the instance. The available choices are:
        <variablelist>
          <varlistentry>
            <term>diskless</term>
            <listitem>
              <para>
                This creates an instance with no disks. Its useful for
                testing only (or other special cases).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>plain</term>
            <listitem>
              <para>Disk devices will be logical volumes.</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>local_raid1</term>
            <listitem>
              <para>
                Disk devices will be md raid1 arrays over two local
                logical volumes.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>remote_raid1</term>
            <listitem>
              <para>
                Disk devices will be md raid1 arrays with one
                component (so it's not actually raid1): a drbd (0.7.x)
                device between the instance's primary node and the
                node given by the second value of the
                <option>--node</option> option.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>drbd</term>
            <listitem>
              <para>
                Disk devices will be drbd (version 8.x) on top of lvm
                volumes. They are equivalent in functionality to
                <replaceable>remote_raid1</replaceable>, but are
                recommended for new instances (if you have drbd 8.x
                installed).
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </para>

      <para>
        The optional second value of the <option>--node</option> is used for
        the remote raid template type 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>

      <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 \
> instance3.example.com
        </screen>
      </para>

    </refsect2>

    <refsect2>
      <title>LIST</title>

      <cmdsynopsis>
        <command>list</command>
        <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>
    </refsect2>

  </refsect1>

  &footer;

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->