.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "VIRT-CLONE 1" .TH VIRT-CLONE 1 "2019-01-19" "2.0.0" "Virtual Machine Manager" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" virt\-clone \- clone existing virtual machine images .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBvirt-clone\fR [\s-1OPTION\s0]... .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBvirt-clone\fR is a command line tool for cloning existing virtual machine images using the \f(CW\*(C`libvirt\*(C'\fR hypervisor management library. It will copy the disk images of any existing virtual machine, and define a new guest with an identical virtual hardware configuration. Elements which require uniqueness will be updated to avoid a clash between old and new guests. .PP By default, virt-clone will show an error if the necessary information to clone the guest is not provided. The \-\-auto\-clone option will generate all needed input, aside from the source guest to clone. .PP Please note, virt-clone does not change anything _inside_ the guest \s-1OS,\s0 it only duplicates disks and does host side changes. So things like changing passwords, changing static \s-1IP\s0 address, etc are outside the scope of this tool. For these types of changes, please see \fBvirt-sysprep\fR. .SH "GENERAL OPTIONS" .IX Header "GENERAL OPTIONS" Most options are not required. Minimum requirements are \-\-original or \&\-\-original\-xml (to specify the guest to clone), \-\-name, and appropriate storage options via \-file. .IP "\fB\-\-connect\fR \s-1URI\s0" 4 .IX Item "--connect URI" Connect to a non-default hypervisor. See \fBvirt\-install\fR\|(1) for details .IP "\fB\-o\fR \s-1ORIGINAL_GUEST\s0" 4 .IX Item "-o ORIGINAL_GUEST" .PD 0 .IP "\fB\-\-original\fR \s-1ORIGINAL_GUEST\s0" 4 .IX Item "--original ORIGINAL_GUEST" .PD Name of the original guest to be cloned. This guest must be shut off or paused since it is not possible to safely clone active guests at this time. .IP "\fB\-\-original\-xml\fR \s-1ORIGINAL_XML\s0" 4 .IX Item "--original-xml ORIGINAL_XML" Libvirt guest xml file to use as the original guest. The guest does not need to be defined on the libvirt connection. This takes the place of the \&\f(CW\*(C`\-\-original\*(C'\fR parameter. .IP "\fB\-\-auto\-clone\fR" 4 .IX Item "--auto-clone" Generate a new guest name, and paths for new storage. .Sp An example or possible generated output: .Sp .Vb 2 \& Original name : MyVM \& Generated clone name : MyVM\-clone \& \& Original disk path : /home/user/foobar.img \& Generated disk path : /home/user/foobar\-clone.img .Ve .Sp If generated names collide with existing VMs or storage, a number is appended, such as foobar\-clone\-1.img, or MyVM\-clone\-3. .IP "\fB\-n\fR \s-1NAME\s0" 4 .IX Item "-n NAME" .PD 0 .IP "\fB\-\-name\fR \s-1NAME\s0" 4 .IX Item "--name NAME" .PD Name of the new guest virtual machine instance. This must be unique amongst all guests known to the hypervisor connection, including those not currently active. .IP "\fB\-u\fR \s-1UUID\s0" 4 .IX Item "-u UUID" .PD 0 .IP "\fB\-\-uuid\fR \s-1UUID\s0" 4 .IX Item "--uuid UUID" .PD \&\s-1UUID\s0 for the guest; if none is given a random \s-1UUID\s0 will be generated. If you specify \s-1UUID,\s0 you should use a 32\-digit hexadecimal number. \s-1UUID\s0 are intended to be unique across the entire data center, and indeed world. Bear this in mind if manually specifying a \s-1UUID\s0 .IP "\fB\-f\fR \s-1DISKFILE\s0" 4 .IX Item "-f DISKFILE" .PD 0 .IP "\fB\-\-file\fR \s-1DISKFILE\s0" 4 .IX Item "--file DISKFILE" .PD Path to the file, disk partition, or logical volume to use as the backing store for the new guest's virtual disk. If the original guest has multiple disks, this parameter must be repeated multiple times, once per disk in the original virtual machine. .IP "\fB\-\-nvram\fR \s-1NVRAMFILE\s0" 4 .IX Item "--nvram NVRAMFILE" Optional path to the new nvram \s-1VARS\s0 file, if no path is specified and the guest has nvram the new nvram path will be auto-generated. If the guest doesn't have nvram this option will be ignored. .IP "\fB\-\-force\-copy\fR \s-1TARGET\s0" 4 .IX Item "--force-copy TARGET" Force cloning the passed disk target ('hdc', 'sda', etc.). By default, \&\f(CW\*(C`virt\-clone\*(C'\fR will skip certain disks, such as those marked 'readonly' or \&'shareable'. .IP "\fB\-\-nonsparse\fR" 4 .IX Item "--nonsparse" Fully allocate the new storage if the path being cloned is a sparse file. See \fBvirt\-install\fR\|(1) for more details on sparse vs. nonsparse. .IP "\fB\-\-preserve\-data\fR" 4 .IX Item "--preserve-data" No storage is cloned: disk images specific by \-\-file are preserved as is, and referenced in the new clone \s-1XML.\s0 This is useful if you want to clone a \s-1VM XML\s0 template, but not the storage contents. .IP "\fB\-\-reflink\fR" 4 .IX Item "--reflink" When \-\-reflink is specified, perform a lightweight copy. This is much faster if source images and destination images are all on the same btrfs filesystem. If \s-1COW\s0 copy is not possible, then virt-clone fails. .IP "\fB\-m\fR \s-1MAC\s0" 4 .IX Item "-m MAC" .PD 0 .IP "\fB\-\-mac\fR \s-1MAC\s0" 4 .IX Item "--mac MAC" .PD Fixed \s-1MAC\s0 address for the guest; If this parameter is omitted, or the value \&\f(CW\*(C`RANDOM\*(C'\fR is specified a suitable address will be randomly generated. Addresses are applied sequentially to the networks as they are listed in the original guest \s-1XML.\s0 .IP "\fB\-\-print\-xml\fR" 4 .IX Item "--print-xml" Print the generated clone \s-1XML\s0 and exit without cloning. .IP "\fB\-\-replace\fR" 4 .IX Item "--replace" Shutdown and remove any existing guest with the passed \f(CW\*(C`\-\-name\*(C'\fR before cloning the original guest. .IP "\fB\-h\fR" 4 .IX Item "-h" .PD 0 .IP "\fB\-\-help\fR" 4 .IX Item "--help" .PD Show the help message and exit .IP "\fB\-\-version\fR" 4 .IX Item "--version" Show program's version number and exit .IP "\fB\-\-check\fR" 4 .IX Item "--check" Enable or disable some validation checks. See \fBvirt\-install\fR\|(1) for more details. .IP "\fB\-q\fR" 4 .IX Item "-q" .PD 0 .IP "\fB\-\-quiet\fR" 4 .IX Item "--quiet" .PD Suppress non-error output. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 .IP "\fB\-\-debug\fR" 4 .IX Item "--debug" .PD Print debugging information to the terminal when running the install process. The debugging information is also stored in \&\f(CW\*(C`~/.cache/virt\-manager/virt\-clone.log\*(C'\fR even if this parameter is omitted. .SH "EXAMPLES" .IX Header "EXAMPLES" Clone the guest called \f(CW\*(C`demo\*(C'\fR on the default connection, auto generating a new name and disk clone path. .PP .Vb 3 \& # virt\-clone \e \& \-\-original demo \e \& \-\-auto\-clone .Ve .PP Clone the guest called \f(CW\*(C`demo\*(C'\fR which has a single disk to copy .PP .Vb 4 \& # virt\-clone \e \& \-\-original demo \e \& \-\-name newdemo \e \& \-\-file /var/lib/xen/images/newdemo.img .Ve .PP Clone a \s-1QEMU\s0 guest with multiple disks .PP .Vb 6 \& # virt\-clone \e \& \-\-connect qemu:///system \e \& \-\-original demo \e \& \-\-name newdemo \e \& \-\-file /var/lib/xen/images/newdemo.img \e \& \-\-file /var/lib/xen/images/newdata.img .Ve .PP Clone a guest to a physical device which is at least as big as the original guests disks. If the destination device is bigger, the new guest can do a filesystem resize when it boots. .PP .Vb 6 \& # virt\-clone \e \& \-\-connect qemu:///system \e \& \-\-original demo \e \& \-\-name newdemo \e \& \-\-file /dev/HostVG/DemoVM \e \& \-\-mac 52:54:00:34:11:54 .Ve .SH "BUGS" .IX Header "BUGS" Please see https://virt\-manager.org/page/BugReporting .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) Fujitsu Limited, Copyright (C) Red Hat, Inc, and various contributors. This is free software. You may redistribute copies of it under the terms of the \s-1GNU\s0 General Public License \f(CW\*(C`https://www.gnu.org/licenses/gpl.html\*(C'\fR. There is \s-1NO WARRANTY,\s0 to the extent permitted by law. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\f(CW\*(C`virt\-sysprep(1)\*(C'\fR, \f(CWvirsh(1)\fR, \f(CW\*(C`virt\-install(1)\*(C'\fR, \f(CW\*(C`virt\-manager(1)\*(C'\fR, the project website \f(CW\*(C`https://virt\-manager.org\*(C'\fR