<arg choice="opt">-p, --newpath <replaceable>newpath</replaceable></arg>
<arg choice="opt">-B, --backingstorage <replaceable>backingstorage</replaceable></arg>
<arg choice="opt">-s, --snapshot</arg>
- <arg choice="opt">-K, --keepdata</arg>
+ <arg choice="opt">-a, --allowrunning</arg>
+ <arg choice="opt">-K, --keepname</arg>
+ <arg choice="opt">-D, --keepdata</arg>
<arg choice="opt">-M, --keepmac</arg>
<arg choice="opt">-L, --fssize <replaceable>size [unit]</replaceable></arg>
+ <arg choice="opt">-- hook arguments</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>lxc-copy</command>
<arg choice="req">-e, --ephemeral</arg>
<arg choice="opt">-B, --backingstorage <replaceable>backingstorage</replaceable></arg>
<arg choice="opt">-s, --snapshot</arg>
- <arg choice="opt">-K, --keepdata</arg>
+ <arg choice="opt">-a, --allowrunning</arg>
+ <arg choice="opt">-K, --keepname</arg>
+ <arg choice="opt">-D, --keepdata</arg>
<arg choice="opt">-M, --keepmac</arg>
<arg choice="opt">-L, --fssize <replaceable>size [unit]</replaceable></arg>
+ <arg choice="opt">-- hook arguments</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <command>lxc-copy</command>
+ <arg choice="req">-n, --name <replaceable>name</replaceable></arg>
+ <arg choice="opt">-P, --lxcpath <replaceable>path</replaceable></arg>
+ <arg choice="opt">-N, --newname <replaceable>newname</replaceable></arg>
+ <arg choice="opt">-p, --newpath <replaceable>newpath</replaceable></arg>
+ <arg choice="req">-e, --ephemeral</arg>
+ <arg choice="opt">-B, --backingstorage <replaceable>backingstorage</replaceable></arg>
+ <arg choice="opt">-s, --snapshot</arg>
+ <arg choice="opt">-t, --tmpfs</arg>
+ <arg choice="opt">-K, --keepname</arg>
+ <arg choice="opt">-M, --keepmac</arg>
+ <arg choice="opt">-- hook arguments</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>lxc-copy</command>
<para>
<command>lxc-copy</command> creates and optionally starts (ephemeral or
- non-ephemeral) copies of existing containers. It replaces
- <command>lxc-clone</command> and <command>lxc-start-ephemeral</command>.
+ non-ephemeral) copies of existing containers.
</para>
<para>
<command>lxc-copy</command> creates copies of existing containers. Copies
root filesystem of the container is simply copied to the new container. Or
they can be snapshots, i.e. small copy-on-write copies of the original
container. In this case the specified backing storage for the copy must
- support snapshots. This currently includes aufs, btrfs, lvm (lvm devices
+ support snapshots. This currently includes btrfs, lvm (lvm devices
do not support snapshots of snapshots.), overlay, and zfs.
</para>
<para>
The copy's backing storage will be of the same type as the original
- container. aufs or overlayfs snapshots of directory backed containers are
+ container. overlay snapshots of directory backed containers are
exempted from this rule.
</para>
config file and will be destroyed on shutdown. When
<replaceable>-e</replaceable> is used in combination with
<replaceable>-D</replaceable> a non-ephemeral snapshot of the original
- container is created and started.</para>
+ container is created and started.
+ Ephemeral containers can also be placed on a tmpfs with <replaceable>-t</replaceable>
+ flag. NOTE: If an ephemeral container that is placed on a tmpfs is rebooted
+ all changes made to it will currently be lost!
+ </para>
<para>
When <replaceable>-e</replaceable> is specified and no newname is given via
<para>
Containers created and started with <replaceable>-e</replaceable> can have
custom mounts. These are specified with the <replaceable>-m</replaceable>
- flag. Currently three types of mounts are supported:
- <replaceable>aufs</replaceable>, <replaceable>bind</replaceable>, and
+ flag. Currently two types of mounts are supported:
+ <replaceable>bind</replaceable>, and
<replaceable>overlay</replaceable>. Mount types are specified as suboptions
to the <replaceable>-m</replaceable> flag and can be specified multiple
- times separated by commas. <replaceable>aufs</replaceable> and
- <replaceable>overlay</replaceable> mounts are currently specified in the
- format <replaceable>-m overlay=/src:/dest</replaceable>. When no
- destination <replaceable>dest</replaceable> is specified
+ times separated by commas. <replaceable>overlay</replaceable> mounts are
+ currently specified in the format <replaceable>-m
+ overlay=/src:/dest</replaceable>. When no destination
+ <replaceable>dest</replaceable> is specified
<replaceable>dest</replaceable> will be identical to
<replaceable>src</replaceable>. Read-only <replaceable>bind</replaceable>
mounts are specified <replaceable>-m bind=/src:/dest:ro</replaceable> and
read-write <replaceable>bind</replaceable> mounts <replaceable>-m
- bind=/src:/dest:rw</replaceable>. Read-write <replaceable>bind</replaceable>
- mounts are the default and <replaceable>rw</replaceable> can be missing when
- a read-write mount is wanted. When <replaceable>dest</replaceable> is
- missing <replaceable>dest</replaceable> will be identical to
+ bind=/src:/dest:rw</replaceable>. Read-write
+ <replaceable>bind</replaceable> mounts are the default and
+ <replaceable>rw</replaceable> can be missing when a read-write mount is
+ wanted. When <replaceable>dest</replaceable> is missing
+ <replaceable>dest</replaceable> will be identical to
<replaceable>src</replaceable>. An example for multiple mounts would be
<replaceable>-m
bind=/src1:/dest1:ro,bind=/src2:ro,overlay=/src3:/dest3</replaceable>.
<varlistentry>
<term> <option>-s,--snapshot </option> </term>
<listitem>
- <para> Create a snapshot of the orginal container. The backing
+ <para> Create a snapshot of the original container. The backing
storage for the copy must support snapshots. This currently includes
- aufs, btrfs, lvm, overlay, and zfs. </para>
+ btrfs, lvm, overlay, and zfs. </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term> <option>-a,--allowrunning </option> </term>
+ <listitem>
+ <para> Allow the creation of a Snapshot of an already running container.
+ This may cause data corruption or data loss depending on the used
+ filesystem and applications. Use with care. </para>
</listitem>
</varlistentry>
<listitem>
<para> Specify a mount for a snapshot The
<replaceable>opts</replaceable> argument for the mount type can by
- of type {aufs, bind, overlay}. For example <option>-m
+ of type {bind, overlay}. For example <option>-m
bind=/src:/dest:ro,overlay=/src:/dest</option> (This option can
currently only be specified in conjunction with
<replaceable>-e</replaceable>.).</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term> <option>-t, --tmpfs </option></term>
+ <listitem>
+ <para> When this option is specified the ephemeral container will be
+ placed on a tmpfs. NOTE: Rebooting an ephemeral container that is
+ located on a tmpfs will currently cause all changes made to it to be
+ lost. This flag will only work for ephemeral containers created with
+ the <replaceable>-e</replaceable> flag. The original container, from
+ which the ephemeral snapshot is created, must be stored as a simple
+ directory.
+ </para> </listitem>
+ </varlistentry>
+
<varlistentry>
<term> <option>-B, --backingstorage <replaceable>backingstorage</replaceable></option></term>
<listitem>
<para>Specify the backing storage type to be used for the copy
- where 'backingstorage' is of type 'aufs', 'btrfs', 'dir', 'lvm', 'loop',
+ where 'backingstorage' is of type 'btrfs', 'dir', 'lvm', 'loop',
'overlay', or 'zfs'. </para>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
- <term> <option>-D, --keepdata </option></term>
+ <term> <option>-K, --keepname </option></term>
<listitem>
- <para>When this option is specified with
- <replaceable>-e</replaceable> a non-ephemeral container is created
- and started. </para> </listitem>
+ <para> When this option is specified the hostname of the original
+ container will be kept for the copy.</para> </listitem>
</varlistentry>
<varlistentry>
- <term> <option>-K, --keepname </option></term>
+ <term> <option>-D, --keepdata </option></term>
<listitem>
- <para> When this option is specified the hostname of the original
- container will be kept for the copy.</para> </listitem>
+ <para>When this option is specified with
+ <replaceable>-e</replaceable> a non-ephemeral container is created
+ and started. </para> </listitem>
</varlistentry>
<varlistentry>
</refsect1>
+ <refsect1>
+ <title>Copy hook</title>
+ <para>
+ If the container being copied has one or more
+ <filename>lxc.hook.clone</filename> specified, then the specified hooks
+ will be called for the new container. The first 3 arguments passed to the
+ clone hook will be the container name, a section ('lxc'), and the hook
+ type ('clone'). Extra arguments passed to <command>lxc-copy</command> will
+ be passed to the hook program starting at argument 4. The
+ <filename>LXC_ROOTFS_MOUNT</filename> environment variable gives
+ the path under which the container's root filesystem is mounted. The
+ configuration file pathname is stored in
+ <filename>LXC_CONFIG_FILE</filename>, the new container name in
+ <filename>LXC_NAME</filename>, the old container name in
+ <filename>LXC_SRC_NAME</filename>, and the path or device on which the
+ rootfs is located is in <filename>LXC_ROOTFS_PATH</filename>.
+ </para>
+ </refsect1>
+
&commonoptions;
&seealso;