GridVids
Sign in with YouTube

KVM | Cloning a Guest VM

Mark watched
Don't Miss
Hide
Open in popup Open on YouTube

Yogesh Mehta 8 years ago

When working in enterprise setups its not advisable to create the VMs from scratch and configure every time as it will make the build lengthy and chance of mistakes. Instead build engineers create a VM , perform the SOE configuration and save it as SOE. For any future build , they just clone from the SOE VM.

In this exercise we will create a VM from template or in other works : we are going to clone a VM.

Shutdown the Source VM , if running # virsh shutdown source_vm

Clone the VM ( Create a new VM from source vm) # virt-clone --original source_vm --name target_vm -f /var/lib/libvirt/images/target_vm.qcow2

With the aforementioned command , a new VM will be created with all settings. disk size and compute similar to source VM. Later you can perform the resource/disk size upgrade as per the requirements.

Power on on and Test the Target VM # virsh start target_vm

Watch the video for details :