Use this when virtual disks allocate space only when written.
Thin Provisioning · Storage Virtualization
Thin provisioning for virtual disks allocates space only as the guest writes data. It saves capacity, but the datastore can fill up if many thin disks grow at once, pausing VMs.
1. Thin provisioning in virtual storage allocates on write.
2. Stack thin on thin carefully — watch every layer.
3. Enable UNMAP/discard through layers.
4. Alert at pool level.
5. Track overcommit.
guest write → virtual disk → thin pool
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
- Provisioned vs physical per pool/datastore.
- Alert at 80/90 %.
- TRIM/UNMAP working (
fstrim -av,Optimize-Volume -ReTrim).
Step 2 Common mistakes Narrow the fault
- Thin on thin without monitoring at each layer.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Saves capacity.
- Datastore can fill unexpectedly.
- Monitor overcommit.
lvs -o +data_percent— thin poolsGet-VirtualDisk | ft FriendlyName,ProvisioningType,FootprintOnPool— Storage Spacesesxcli storage core device vaai status get— UNMAP/thin support
ReferenceHow it works1 section · depth on demand
How it works
Thin provisioning gives a VM or volume its full logical size up front but allocates physical space only when data is written. It can be done at the virtual disk, the datastore/pool and the array, and each layer can be overcommitted. Space freed inside a guest returns only if unmap/TRIM is passed through every layer.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Thin virtual disks grow as the guest writes
A thin-provisioned virtual disk starts small and allocates space only when the guest writes data. Many VMs can share a datastore that is smaller than the sum of their virtual disk sizes.
With qemu-img
The qemu-img documentation explains that qemu-img info shows the virtual size (the guest's disk) and the disk size (space actually used on the host). qemu-img convert -S sets how many consecutive zero bytes produce a sparse region in the target (default 4k; 0 disables sparse output). qemu-img check verifies image consistency, and exit code 3 means leaked clusters without corruption.
$ qemu-img create -f qcow2 vm03.qcow2 500G
$ qemu-img info vm03.qcow2 | grep -E 'virtual size|disk size'
virtual size: 500 GiB (536870912000 bytes)
disk size: 196 KiB
$ qemu-img convert -O qcow2 -S 4k vm03-old.qcow2 vm03.qcow2 # re-sparsify while copying
$ qemu-img check vm03.qcow2
No errors were found on the image.
Getting space back
Deleted files inside the guest do not shrink the image unless discards reach it:
| Layer | Setting |
|---|---|
| Guest | fstrim -av (or a weekly fstrim.timer); Windows "Optimize Drives" |
| Virtual disk controller | discard='unmap' on virtio-scsi or virtio-blk in libvirt |
| Image format | qcow2 and raw on file systems that support hole punching |
| Datastore or array | Thin LUN with UNMAP support |
Risks
| Risk | Mitigation |
|---|---|
| Datastore fills because guests grow | Alert on datastore usage; track the over-commit ratio |
| Full datastore pauses or crashes VMs | Keep headroom; know which VMs to move first |
| Full-disk operations (zeroing, some defrag or backup tools) | They allocate the whole virtual size |
| Snapshots on top of thin disks | Extra growth from delta files |
Thin provisioning moves the capacity risk from creation time to run time, so monitoring is mandatory.
Documented example, not captured output.
Reference
| Layer | Thin option |
|---|---|
| VM disk | Thin VMDK, dynamic VHDX, sparse QCOW2 |
| Datastore/pool | LVM-thin, ZFS sparse zvol |
| Array | Thin LUN |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Storage Virtualization → Thin Provisioning. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/8-0/vsphere-storage-8-0.html · confidence 94%