planetwilson Posted July 23, 2016 Share Posted July 23, 2016 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
planetwilson Posted July 24, 2016 Author Share Posted July 24, 2016 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
saarg Posted July 24, 2016 Share Posted July 24, 2016 You do know that the files you make in /var/lib/libvirt/images is made in RAM and will be destroyed on next boot (And also fill up your RAM)? Link to comment
planetwilson Posted December 14, 2016 Author Share Posted December 14, 2016 Aah no I didn't actually! That is the example I copied from somewhere, my actual images reside on /mnt/cache/VM Link to comment
DoeBoye Posted December 14, 2016 Share Posted December 14, 2016 This sounds really cool. Do you mind sharing your use-case for this functionality? I'm new to the whole vm world and I'm fascinated by the potential . Are you using the clones as a sandbox for testing software/apps etc. or for something else? Link to comment
planetwilson Posted June 3, 2017 Author Share Posted June 3, 2017 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.