CentOS 7.x clone kvm VM using virt-manager
From Notes_Wiki
<yambe:breadcrumb>CentOS_7.x_kvm|CentOS 7.x kvm</yambe:breadcrumb>
CentOS 7.x clone kvm VM using virt-manager
To clone CentOS 7.x KVM VM using virt-manager use:
- Start virt-manager as root
- Right-click the VM to be cloned and choose clone
- Create folder and appropriate disk file(s) for the destination VM. Such as
- cd /mnt/data1/vms
- mkdir ctdb2
- cd ctdb2
- qemu-img create -f qcow2 ctdb2.qcow2 100G
- Here it would be good if size of the image (100G) matches size of the source VM.
- In the clone dialog box write appropriate name for clone
- For disk to be cloned click on drop down and go to details. In details browse and select new image file create (ctdb2.qcow2). Ignore the warning related to existing data being overwritten.
- rm ctdb2.qcow2
- Unless we delete cloning wont work, if the source VM has snapshots. Note that any way the new clone will not have any snapshots. It would be running with currently running disk copy.
- Start cloning.
Note: This cloning from at least CentOS 7.4 onwards deals with dynamic disks (Balooning / sparse files) and qcow2 files properly.