1VIRT-CLONE(1) Virtual Machine Install Tools VIRT-CLONE(1)
2
3
4
6 virt-clone - clone existing virtual machine images
7
9 virt-clone [OPTION]...
10
12 virt-clone is a command line tool for cloning existing virtual machine
13 images using the "libvirt" hypervisor management library. It will copy
14 the disk images of any existing virtual machine, and define a new guest
15 with an identical virtual hardware configuration. Elements which
16 require uniqueness will be updated to avoid a clash between old and new
17 guests.
18
19 By default, virt-clone will show an error if the necessary information
20 to clone the guest is not provided. The --auto-clone option will
21 generate all needed input, aside from the source guest to clone. An
22 interactive mode is available with the --prompt option, but this will
23 only ask for the minimum required options.
24
26 Most options are not required. Minimum requirements are --original or
27 --original-xml (to specify the guest to clone), --name, and appropriate
28 storage options via -file.
29
30 -h, --help
31 Show the help message and exit
32
33 --connect=CONNECT
34 Connect to a non-default hypervisor. See virt-install(1) for
35 details
36
37 General Options
38 General configuration parameters that apply to all guest clones.
39
40 -o ORIGINAL_GUEST, --original=ORIGINAL_GUEST
41 Name of the original guest to be cloned. This guest must be shut off
42 or paused since it is not possible to safely clone active guests at
43 this time.
44
45 --original-xml=ORIGINAL_XML
46 Libvirt guest xml file to use as the original guest. The guest does
47 not need to be defined on the libvirt connection. This takes the
48 place of the "--original" parameter.
49
50 --auto-clone
51 Generate a new guest name, and paths for new storage.
52
53 An example or possible generated output:
54
55 Original name : MyVM
56 Generated clone name : MyVM-clone
57
58 Original disk path : /home/user/foobar.img
59 Generated disk path : /home/user/foobar-clone.img
60
61 If generated names collide with existing VMs or storage, a number is
62 appended, such as foobar-clone-1.img, or MyVM-clone-3.
63
64 -n NAME, --name=NAME
65 Name of the new guest virtual machine instance. This must be unique
66 amongst all guests known to the hypervisor connection, including
67 those not currently active.
68
69 -u UUID, --uuid=UUID
70 UUID for the guest; if none is given a random UUID will be generated.
71 If you specify UUID, you should use a 32-digit hexadecimal number.
72 UUID are intended to be unique across the entire data center, and
73 indeed world. Bear this in mind if manually specifying a UUID
74
75 Storage Configuration
76 -f DISKFILE, --file=DISKFILE
77 Path to the file, disk partition, or logical volume to use as the
78 backing store for the new guest's virtual disk. If the original guest
79 has multiple disks, this parameter must be repeated multiple times,
80 once per disk in the original virtual machine.
81
82 --force-copy=TARGET
83 Force cloning the passed disk target ('hdc', 'sda', etc.). By
84 default, "virt-clone" will skip certain disks, such as those marked
85 'readonly' or 'shareable'.
86
87 --nonsparse
88 Fully allocate the new storage if the path being cloned is a sparse
89 file. See virt-install(1) for more details on sparse vs. nonsparse.
90
91 --preserve-data
92 No storage is cloned: disk images specific by --file are preserved as
93 is, and referenced in the new clone XML. This is useful if you want
94 to clone a VM XML template, but not the storage contents.
95
96 Networking Configuration
97 -m MAC, --mac=MAC
98 Fixed MAC address for the guest; If this parameter is omitted, or the
99 value "RANDOM" is specified a suitable address will be randomly
100 generated. Addresses are applied sequentially to the networks as they
101 are listed in the original guest XML.
102
103 Miscellaneous Options
104 --print-xml
105 Print the generated clone XML and exit without cloning.
106
107 --replace
108 Shutdown and remove any existing guest with the passed "--name"
109 before cloning the original guest.
110
111 -d, --debug
112 Print debugging information to the terminal when running the install
113 process. The debugging information is also stored in
114 "$HOME/.virtinst/virt-clone.log" even if this parameter is omitted.
115
116 --force
117 Prevent interactive prompts. If the intended prompt was a yes/no
118 prompt, always say yes. For any other prompts, the application will
119 exit.
120
121 --prompt
122 Specifically enable prompting for required information. Default
123 prompting is off.
124
126 Clone the guest called "demo" on the default connection, auto
127 generating a new name and disk clone path.
128
129 # virt-clone \
130 --original demo \
131 --auto-clone
132
133 Clone the guest called "demo" which has a single disk to copy
134
135 # virt-clone \
136 --original demo \
137 --name newdemo \
138 --file /var/lib/xen/images/newdemo.img
139
140 Clone a QEMU guest with multiple disks
141
142 # virt-clone \
143 --connect qemu:///system \
144 --original demo \
145 --name newdemo \
146 --file /var/lib/xen/images/newdemo.img \
147 --file /var/lib/xen/images/newdata.img
148
149 Clone a guest to a physical device which is at least as big as the
150 original guests disks. If the destination device is bigger, the new
151 guest can do a filesystem resize when it boots.
152
153 # virt-clone \
154 --connect qemu:///system \
155 --name demo \
156 --file /dev/HostVG/DemoVM \
157 --mac 52:54:00:34:11:54
158
160 Written by Kazuki Mizushima, and a team of many other contributors. See
161 the AUTHORS file in the source distribution for the complete list of
162 credits.
163
165 Please see http://virt-manager.org/page/BugReporting
166
168 Copyright (C) Fujitsu Limited 2007, and various contributors. This is
169 free software. You may redistribute copies of it under the terms of the
170 GNU General Public License "http://www.gnu.org/licenses/gpl.html".
171 There is NO WARRANTY, to the extent permitted by law.
172
174 virsh(1), "virt-install(1)", "virt-manager(1)", the project website
175 "http://virt-manager.org"
176
177
178
179 2011-07-13 VIRT-CLONE(1)