'\" -*- coding: us-ascii -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH lxc-copy 1 2017-03-15 "" "" .SH NAME lxc-copy \- copy an existing container. .SH SYNOPSIS 'nh .fi .ad l \fBlxc-copy\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu {-n, --name \fIname\fR} [-P, --lxcpath \fIpath\fR] {-N, --newname \fInewname\fR} [-p, --newpath \fInewpath\fR] [-B, --backingstorage \fIbackingstorage\fR] [-s, --snapshot] [-K, --keepdata] [-M, --keepmac] [-L, --fssize \fIsize [unit]\fR] [-- hook arguments] 'in \n(.iu-\nxu .ad b 'hy 'nh .fi .ad l \fBlxc-copy\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu {-n, --name \fIname\fR} [-P, --lxcpath \fIpath\fR] [-N, --newname \fInewname\fR] [-p, --newpath \fInewpath\fR] {-e, --ephemeral} [-B, --backingstorage \fIbackingstorage\fR] [-s, --snapshot] [-K, --keepdata] [-M, --keepmac] [-L, --fssize \fIsize [unit]\fR] [-- hook arguments] 'in \n(.iu-\nxu .ad b 'hy 'nh .fi .ad l \fBlxc-copy\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu {-n, --name \fIname\fR} [-P, --lxcpath \fIpath\fR] {-N, --newname \fInewname\fR} [-p, --newpath \fInewpath\fR] {-R, --rename} 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBlxc-copy\fR creates and optionally starts (ephemeral or non-ephemeral) copies of existing containers. It replaces \fBlxc-clone\fR and \fBlxc-start-ephemeral\fR. .PP \fBlxc-copy\fR creates copies of existing containers. Copies can be complete clones of the original container. In this case the whole 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 do not support snapshots of snapshots.), overlay, and zfs. .PP The copy's backing storage will be of the same type as the original container. aufs or overlayfs snapshots of directory backed containers are exempted from this rule. .PP When the \fI-e\fR flag is specified an ephemeral snapshot of the original container is created and started. Ephemeral containers will have \fBlxc.ephemeral = 1\fR set in their config file and will be destroyed on shutdown. When \fI-e\fR is used in combination with \fI-D\fR a non-ephemeral snapshot of the original container is created and started. .PP When \fI-e\fR is specified and no newname is given via \fI-N\fR a random name for the snapshot will be chosen. .PP Containers created and started with \fI-e\fR can have custom mounts. These are specified with the \fI-m\fR flag. Currently three types of mounts are supported: \fIaufs\fR, \fIbind\fR, and \fIoverlay\fR. Mount types are specified as suboptions to the \fI-m\fR flag and can be specified multiple times separated by commas. \fIaufs\fR and \fIoverlay\fR mounts are currently specified in the format \fI-m overlay=/src:/dest\fR. When no destination \fIdest\fR is specified \fIdest\fR will be identical to \fIsrc\fR. Read-only \fIbind\fR mounts are specified \fI-m bind=/src:/dest:ro\fR and read-write \fIbind\fR mounts \fI-m bind=/src:/dest:rw\fR. Read-write \fIbind\fR mounts are the default and \fIrw\fR can be missing when a read-write mount is wanted. When \fIdest\fR is missing \fIdest\fR will be identical to \fIsrc\fR. An example for multiple mounts would be \fI-m bind=/src1:/dest1:ro,bind=/src2:ro,overlay=/src3:/dest3\fR. .PP The mounts, their options, and formats supported via the \fI-m\fR flag are subject to change. .SH OPTIONS .TP \*(T<\fB\-N,\-\-newname \fR\*(T>\fInewname\fR The name for the copy. .TP \*(T<\fB\-p,\-\-newpath \fR\*(T>\fInewpath\fR The path for the copy. .TP \*(T<\fB\-R,\-\-rename \fR\*(T> Rename the original container. .TP \*(T<\fB\-s,\-\-snapshot \fR\*(T> 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. .TP \*(T<\fB\-F,\-\-foreground\fR\*(T> Run the snapshot in the foreground. The snapshots console will be attached to the current tty. (This option can only be specified in conjunction with \fI-e\fR.) .TP \*(T<\fB\-d, \-\-daemon\fR\*(T> Run the snapshot as a daemon (This is the default mode for ephemeral containers.). As the container has no more tty, if an error occurs nothing will be displayed, the log file can be used to check the error. (This option can only be specified in conjunction with \fI-e\fR.) .TP \*(T<\fB\-m, \-\-mount \fR\*(T>\fImounttype\fR Specify a mount for a snapshot The \fIopts\fR argument for the mount type can by of type {aufs, bind, overlay}. For example \*(T<\fB\-m bind=/src:/dest:ro,overlay=/src:/dest\fR\*(T> (This option can currently only be specified in conjunction with \fI-e\fR.). .TP \*(T<\fB\-B, \-\-backingstorage \fR\*(T>\fIbackingstorage\fR Specify the backing storage type to be used for the copy where 'backingstorage' is of type 'aufs', 'btrfs', 'dir', 'lvm', 'loop', \&'overlay', or 'zfs'. .TP \*(T<\fB\-L, \-\-fssize \fR\*(T>\fIsize [unit]\fR Specify the size for an 'lvm' filesystem. .TP \*(T<\fB\-D, \-\-keepdata \fR\*(T> When this option is specified with \fI-e\fR a non-ephemeral container is created and started. .TP \*(T<\fB\-K, \-\-keepname \fR\*(T> When this option is specified the hostname of the original container will be kept for the copy. .TP \*(T<\fB\-M, \-\-keepmac \fR\*(T> When this option is specified the MAC address of the original container will be kept for the copy. .SH "COPY HOOK" If the container being copied has one or more \*(T<\fIlxc.hook.clone\fR\*(T> 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 \fBlxc-copy\fR will be passed to the hook program starting at argument 4. The \*(T<\fILXC_ROOTFS_MOUNT\fR\*(T> environment variable gives the path under which the container's root filesystem is mounted. The configuration file pathname is stored in \*(T<\fILXC_CONFIG_FILE\fR\*(T>, the new container name in \*(T<\fILXC_NAME\fR\*(T>, the old container name in \*(T<\fILXC_SRC_NAME\fR\*(T>, and the path or device on which the rootfs is located is in \*(T<\fILXC_ROOTFS_PATH\fR\*(T>. .SH "COMMON OPTIONS" These options are common to most of lxc commands. .TP \*(T<\fB\-?, \-h, \-\-help\fR\*(T> Print a longer usage message than normal. .TP \*(T<\fB\-\-usage\fR\*(T> Give the usage message .TP \*(T<\fB\-q, \-\-quiet\fR\*(T> mute on .TP \*(T<\fB\-P, \-\-lxcpath=\fR\*(T>\fIPATH\fR Use an alternate container path. The default is /var/lib/lxc. .TP \*(T<\fB\-o, \-\-logfile=\fR\*(T>\fIFILE\fR Output to an alternate log \fIFILE\fR. The default is no log. .TP \*(T<\fB\-l, \-\-logpriority=\fR\*(T>\fILEVEL\fR Set log priority to \fILEVEL\fR. The default log priority is \*(T. Possible values are : \*(T, \*(T, \*(T, \*(T, \*(T, \*(T, \*(T. Note that this option is setting the priority of the events log in the alternate log file. It do not have effect on the ERROR events log on stderr. .TP \*(T<\fB\-n, \-\-name=\fR\*(T>\fINAME\fR Use container identifier \fINAME\fR. The container identifier format is an alphanumeric string. .TP \*(T<\fB\-\-rcfile=\fR\*(T>\fIFILE\fR Specify the configuration file to configure the virtualization and isolation functionalities for the container. This configuration file if present will be used even if there is already a configuration file present in the previously created container (via lxc-create). .TP \*(T<\fB\-\-version\fR\*(T> Show the version number. .SH "SEE ALSO" \fBlxc\fR(7), \fBlxc-create\fR(1), \fBlxc-copy\fR(1), \fBlxc-destroy\fR(1), \fBlxc-start\fR(1), \fBlxc-stop\fR(1), \fBlxc-execute\fR(1), \fBlxc-console\fR(1), \fBlxc-monitor\fR(1), \fBlxc-wait\fR(1), \fBlxc-cgroup\fR(1), \fBlxc-ls\fR(1), \fBlxc-info\fR(1), \fBlxc-freeze\fR(1), \fBlxc-unfreeze\fR(1), \fBlxc-attach\fR(1), \fBlxc.conf\fR(5) .SH AUTHOR Christian Brauner <\*(T>