September 07, 2015
in Blog.
Lately I've been working with a large amount of virtual machines in the KVM instance. I have a base template file that I then clone to spin up a new instance. None of the tools I am using seem to want to take advantage of the thin provisioning built into the qcow2 file format. I have been manually going in and creating disk images with the qemu-img command.
This command creates a new disk image that only records the changes written to the disk and reads from base.qcow2 otherwise. This is a huge space savings when using a large amount of VMs. I haven't gotten a chance to record performance yet.
qemu-img create -f qcow2 -o backing_file=base.qcow2 image.qcow2