Determining if KVM VM is Thin Provisioned

kvm-virtualizationlibvirtlvmqemuthin-provisioning

I was reading another post here Use Thin LVM Volume for KVM VM trying to understand whether or not KVM is capable of creating thin provisioned VMs. The post from about 8 months ago has both the OP and responder mentioning not supported to thin provision with KVM. Doing more research on the internet there are a lot of older posts from 5-6 years ago(2015 or so) indicating the same. However, looking at one of my own images I would say it is thin provisioned. Is it? Do I misunderstand the terminology here? Basically, before I start down the path of using KVM/libvirt I want to make sure I'll have enough disk space and thin provisioning is the key.

[root@xeon33 images]# ls -lh  vm1.qcow2 
-rw-------. 1 qemu qemu 241G Nov  2 14:53 vm1.qcow2

[root@xeon33 images]# du -h vm1.qcow2 
1.4G    vm1.qcow2

Thank-you.

Best Answer

Yes, that image is thin provisioned. It's qcow2, which only supports thin provisioning.

You can tell, because the file claims to be 241G, yet only has 1.4G allocated. This file has a maximum capacity of 241G.