Jump to content

Creating linked clones


planetwilson

Recommended Posts

Does anyone know how to create linked clones through the UI or through webvirtmgr (I have that installed in a Docker instance)

 

It should be possible to create a new VM which has a qcow2 disk based off a backing disk, i.e. the new disk only contains changes to the filesystem in the backing disk which remains "read only"

 

In VMWare world, this would be known as a linked clone and according to this chap is perfectly possible in KVM.

 

http://www.greenhills.co.uk/2013/03/24/cloning-vms-with-kvm.html

 

Just wondering if I need to jump  into the terminal to achieve this, seems maybe I just do that to get the image file created and then create the VM and point to that image through the GUI?

 

 

Link to comment

Okay it was pretty easy in the end. Set up a Windows VM, get it how I want it. Sysprep it with OOTB and shutdown. Then drop into SSH, make the image file read only, and run the following command:-

 

sudo qemu-img create -f qcow2 -b /var/lib/libvirt/images/myreadonlyimage.qcow2 /var/lib/libvirt/images/mynewvm.qcow2

 

then create a new VM XML pointing at the new file (I tend to use webvirtmgr in a docker for this)

 

Link to comment
  • 4 months later...
  • 5 months later...

Sorry I missed this and it is probably too late now but it is primarily to conserve space. I can have all the base Windows files installed in the base image file. The differences are then stored in the main VM file which points back to the base image file.

 

So you save on storage for the base Windows install. For a lot of my Windows Server VMs this works quite well, especially once they are up and running. There will be a slight performance hit but for server stuff it doesn't matter too much especially if I am running them off an NVMe drive.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...