CentOS 7.x clone kvm VM using virt-manager

From Notes_Wiki

Home > CentOS > CentOS 7.x > Virtualization > CentOS 7.x kvm > CentOS 7.x clone kvm VM using virt-manager

To clone CentOS 7.x KVM VM using virt-manager use:

  1. Start virt-manager as root
  2. Right-click the VM to be cloned and choose clone
  3. 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.
  4. In the clone dialog box write appropriate name for clone
  5. 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.
  6. 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.
  7. Start cloning.

Note: This cloning from at least CentOS 7.4 onwards deals with dynamic disks (Balooning / sparse files) and qcow2 files properly.



Home > CentOS > CentOS 7.x > Virtualization > CentOS 7.x kvm > CentOS 7.x clone kvm VM using virt-manager