diff options
Diffstat (limited to 'man/machinectl.xml')
-rw-r--r-- | man/machinectl.xml | 190 |
1 files changed, 165 insertions, 25 deletions
diff --git a/man/machinectl.xml b/man/machinectl.xml index 9b07af4226..18ef6a5780 100644 --- a/man/machinectl.xml +++ b/man/machinectl.xml @@ -1,6 +1,9 @@ <?xml version='1.0'?> <!--*-nxml-*--> <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ +<!ENTITY % entities SYSTEM "custom-entities.ent" > +%entities; +]> <!-- This file is part of systemd. @@ -214,6 +217,18 @@ URL.</para></listitem> </varlistentry> + <varlistentry> + <term><option>--format=</option></term> + + <listitem><para>When used with the <option>export-tar</option> + or <option>export-raw</option> commands specifies the + compression format to use for the resulting file. Takes one of + <literal>uncompressed</literal>, <literal>xz</literal>, + <literal>gzip</literal>, <literal>bzip2</literal>. By default + the format is determined automatically from the image file + name passed.</para></listitem> + </varlistentry> + <xi:include href="user-system-options.xml" xpointer="host" /> <xi:include href="user-system-options.xml" xpointer="machine" /> @@ -469,19 +484,25 @@ <varlistentry> <term><command>clone</command> <replaceable>NAME</replaceable> <replaceable>NAME</replaceable></term> - <listitem><para>Clones a container or disk image. The + <listitem><para>Clones a container or VM image. The arguments specify the name of the image to clone and the name of the newly cloned image. Note that plain directory container images are cloned into subvolume images with this command. Note that cloning a container or VM image is optimized for btrfs file systems, and might not be efficient on others, due - to file system limitations.</para></listitem> + to file system limitations.</para> + + <para>Note that this command leaves host name, machine ID and + all other settings that could identify the instance + unmodified. The original image and the cloned copy will hence + share these credentials, and it might be necessary to manually + change them in the copy.</para></listitem> </varlistentry> <varlistentry> <term><command>rename</command> <replaceable>NAME</replaceable> <replaceable>NAME</replaceable></term> - <listitem><para>Renames a container or disk image. The + <listitem><para>Renames a container or VM image. The arguments specify the name of the image to rename and the new name of the image.</para></listitem> </varlistentry> @@ -489,22 +510,53 @@ <varlistentry> <term><command>read-only</command> <replaceable>NAME</replaceable> [<replaceable>BOOL</replaceable>]</term> - <listitem><para>Marks or (unmarks) a container or disk image + <listitem><para>Marks or (unmarks) a container or VM image read-only. Takes a VM or container image name, followed by a boolean as arguments. If the boolean is omitted, positive is implied, i.e. the image is marked read-only.</para></listitem> </varlistentry> - <varlistentry> <term><command>remove</command> <replaceable>NAME</replaceable>...</term> - <listitem><para>Removes one or more container or disk images. + <listitem><para>Removes one or more container or VM images. The special image <literal>.host</literal>, which refers to the host's own directory tree may not be removed.</para></listitem> </varlistentry> + <varlistentry> + <term><command>set-limit</command> [<replaceable>NAME</replaceable>] <replaceable>BYTES</replaceable></term> + + <listitem><para>Sets the maximum size in bytes a specific + container or VM image, or all images may grow up to on disk + (disk quota). Takes either one or two parameters. The first, + optional parameter refers to a container or VM image name. If + specified the size limit of the specified image is changed. If + omitted the overall size limit of the sum of all images stored + locally is changed. The final argument specifies the size + limit in bytes, possibly suffixed by the usual K, M, G, T + units. If the size limit shall be disabled, specify + <literal>-</literal> as size.</para> + + <para>Note that per-container size limits are only supported + on btrfs file systems. Also note that if + <command>set-limit</command> is invoked without image + parameter, and <filename>/var/lib/machines</filename> is + empty, and the directory is not located on btrfs, a btrfs + loopback file is implicitly created as + <filename>/var/lib/machines.raw</filename> with the given + size, and mounted to + <filename>/var/lib/machines</filename>. The size of the + loopback may later be readjusted with + <command>set-limit</command>, as well. If such a + loopback-mounted <filename>/var/lib/machines</filename> + directory is used <command>set-limit</command> without image + name alters both the quota setting within the file system as + well as the loopback file and file system size + itself.</para></listitem> + </varlistentry> + </variablelist></refsect2> <refsect2><title>Image Transfer Commands</title><variablelist> @@ -519,7 +571,7 @@ <literal>https://</literal>, and must refer to a <filename>.tar</filename>, <filename>.tar.gz</filename>, <filename>.tar.xz</filename> or <filename>.tar.bz2</filename> - archive file. If the local machine name is omitted the name it + archive file. If the local machine name is omitted it is automatically derived from the last component of the URL, with its suffix removed.</para> @@ -536,8 +588,8 @@ first verified with detached GPG signature file <filename>SHA256SUMS.gpg</filename>. The public key for this verification step needs to be available in - <filename>/usr/lib/systemd/import-pubring.gpg</filename> or - <filename>/etc/systemd/import-pubring.gpg</filename>.</para> + <filename>&rootlibexecdir;/import-pubring.gpg</filename> or + <filename>&pkgsysconfdir;/import-pubring.gpg</filename>.</para> <para>The container image will be downloaded and stored in a read-only subvolume in @@ -551,7 +603,7 @@ specify <literal>-</literal> as local machine name.</para> <para>Note that the read-only subvolume is prefixed with - <filename>.tar-</filename>, and is thus now shown by + <filename>.tar-</filename>, and is thus not shown by <command>list-images</command>, unless <option>--all</option> is passed.</para> @@ -572,7 +624,7 @@ be a <filename>.qcow2</filename> or raw disk image, optionally compressed as <filename>.gz</filename>, <filename>.xz</filename>, or <filename>.bz2</filename>. If the - local machine name is omitted the name it is automatically + local machine name is omitted it is automatically derived from the last component of the URL, with its suffix removed.</para> @@ -580,7 +632,7 @@ (see above).</para> <para>If the the downloaded image is in - <filename>.qcow2</filename> format it es converted into a raw + <filename>.qcow2</filename> format it is converted into a raw image file before it is made available.</para> <para>Downloaded images of this type will be placed as @@ -592,7 +644,7 @@ <para>Similar to the behaviour of <command>pull-tar</command>, the read-only image is prefixed with - <filename>.raw-</filename>, and thus now shown by + <filename>.raw-</filename>, and thus not shown by <command>list-images</command>, unless <option>--all</option> is passed.</para> @@ -624,7 +676,7 @@ <literal>-</literal> as local machine name.</para> <para>The read-only layer subvolumes are prefixed with - <filename>.dkr-</filename>, and thus now shown by + <filename>.dkr-</filename>, and thus not shown by <command>list-images</command>, unless <option>--all</option> is passed.</para> @@ -639,18 +691,77 @@ </varlistentry> <varlistentry> + <term><command>import-tar</command> <replaceable>FILE</replaceable> [<replaceable>NAME</replaceable>]</term> + <term><command>import-raw</command> <replaceable>FILE</replaceable> [<replaceable>NAME</replaceable>]</term> + <listitem><para>Imports a TAR or RAW container or VM image, + and places it under the specified name in + <filename>/var/lib/machines/</filename>. When + <command>import-tar</command> is used the file specified as + first argument should be a tar archive, possibly compressed + with xz, gzip or bzip2. It will then be unpacked into its own + subvolume in <filename>/var/lib/machines</filename>. When + <command>import-raw</command> is used the file should be a + qcow2 or raw disk image, possibly compressed with xz, gzip or + bzip2. If the second argument (the resulting image name) is + not specified it is automatically derived from the file + name. If the file name is passed as <literal>-</literal> the + image is read from standard input, in which case the second + argument is mandatory.</para> + + <para>Similar as with <command>pull-tar</command>, + <command>pull-raw</command> the file system + <filename>/var/lib/machines.raw</filename> is increased in + size of necessary and appropriate. Optionally the + <option>--read-only</option> switch may be used to create a + read-only container or VM image. No cryptographic validation + is done when importing the images.</para> + + <para>Much like image downloads, ongoing imports may be listed + with <command>list-transfers</command> and aborted with + <command>cancel-transfer</command>.</para></listitem> + </varlistentry> + + <varlistentry> + <term><command>export-tar</command> <replaceable>NAME</replaceable> [<replaceable>FILE</replaceable>]</term> + <term><command>export-raw</command> <replaceable>NAME</replaceable> [<replaceable>FILE</replaceable>]</term> + <listitem><para>Exports a TAR or RAW container or VM image and + stores it in the specified file. The first parameter should be + a VM or container image name. The second parameter should be a + file path the TAR or RAW image is written to. If the path ends + in <literal>.gz</literal> the file is compressed with gzip, if + it ends in <literal>.xz</literal> with xz, and if it ends in + <literal>.bz2</literal> with bzip2. If the path ends in + neither the file is left uncompressed. If the second argument + is missing the image is written to standard output. The + compression may also be explicitly selected with the + <option>--format=</option> switch. This is in particular + useful if the second parameter is left unspecified.</para> + + <para>Much like image downloads and imports, ongoing exports + may be listed with <command>list-transfers</command> and + aborted with + <command>cancel-transfer</command>.</para> + + <para>Note that currently only directory and subvolume images + may be exported as TAR images, and only raw disk images as RAW + images.</para></listitem> + </varlistentry> + + <varlistentry> <term><command>list-transfers</command></term> <listitem><para>Shows a list of container or VM image - downloads that are currently in progress.</para></listitem> + downloads, imports and exports that are currently in + progress.</para></listitem> </varlistentry> <varlistentry> <term><command>cancel-transfers</command> <replaceable>ID</replaceable>...</term> - <listitem><para>Aborts download of the container or VM image - with the specified ID. To list ongoing transfers and their - IDs, use <command>list-transfers</command>. </para></listitem> + <listitem><para>Aborts a download, import or export of the + container or VM image with the specified ID. To list ongoing + transfers and their IDs, use + <command>list-transfers</command>. </para></listitem> </varlistentry> </variablelist></refsect2> @@ -671,6 +782,19 @@ <filename>/var/lib/machines/</filename> to make them available for control with <command>machinectl</command>.</para> + <para>Note that many image operations are only supported, + efficient or atomic on btrfs file systems. Due to this, if the + <command>pull-tar</command>, <command>pull-raw</command>, + <command>pull-dkr</command>, <command>import-tar</command>, + <command>import-raw</command> and <command>set-limit</command> + commands notice that <filename>/var/lib/machines</filename> is + empty and not located on btrfs, they will implicitly set up a + loopback file <filename>/var/lib/machines.raw</filename> + containing a btrfs file system that is mounted to + <filename>/var/lib/machines</filename>. The size of this loopback + file may be controlled dynamically with + <command>set-limit</command>.</para> + <para>Disk images are understood by <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry> and <command>machinectl</command> in three formats:</para> @@ -715,11 +839,12 @@ <title>Download a Fedora image, set a root password in it, start it as service</title> - <programlisting># machinectl pull-raw --verify=no - http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz - # systemd-nspawn -M Fedora-Cloud-Base-20141203-21 # passwd # - exit # machinectl start Fedora-Cloud-Base-20141203-21 # - machinectl login Fedora-Cloud-Base-20141203-21</programlisting> + <programlisting># machinectl pull-raw --verify=no http://ftp.halifax.rwth-aachen.de/fedora/linux/releases/21/Cloud/Images/x86_64/Fedora-Cloud-Base-20141203-21.x86_64.raw.xz +# systemd-nspawn -M Fedora-Cloud-Base-20141203-21 +# passwd +# exit +# machinectl start Fedora-Cloud-Base-20141203-21 +# machinectl login Fedora-Cloud-Base-20141203-21</programlisting> <para>This downloads the specified <filename>.raw</filename> image with verification disabled. Then a shell is opened in it @@ -739,6 +864,17 @@ index server to be specified with the <literal>--dkr-index-url=</literal>.</para> </example> + + <example> + <title>Exports a container image as tar file</title> + + <programlisting># machinectl export-tar fedora myfedora.tar.xz</programlisting> + + <para>Exports the container <literal>fedora</literal> in an + xz-compress tar file <filename>myfedora.tar.xz</filename> in the + current directory.</para> + </example> + </refsect1> <refsect1> @@ -755,7 +891,11 @@ <para> <citerefentry><refentrytitle>systemd-machined.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>, - <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry> + <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, + <citerefentry project='die-net'><refentrytitle>tar</refentrytitle><manvolnum>1</manvolnum></citerefentry>, + <citerefentry project='die-net'><refentrytitle>xz</refentrytitle><manvolnum>1</manvolnum></citerefentry>, + <citerefentry project='die-net'><refentrytitle>gzip</refentrytitle><manvolnum>1</manvolnum></citerefentry>, + <citerefentry project='die-net'><refentrytitle>bzip2</refentrytitle><manvolnum>1</manvolnum></citerefentry> </para> </refsect1> |