I'm having a hard time tracking down the disk usage discrepancies I see when I compare disk usage on my Linux VM vs the disk usage of the relevant datastore on my ESXi 6.0 server. The datastore is a LUN provided by a Dell Compellent SC8000, which, as I understand it, is also thin-provisioned.
I have a datastore named amanda-vtapes. I have 1 Linux VM that uses this datastore for 1 thin-provisioned disk of size 748G with max size of 949G.
Disk usage as reported by Linux VM:
# du -hs /var/amanda/vtapes/
143G /var/amanda/vtapes/
Disk usage as reported by ESXi 6:
# du -h /vmfs/volumes/amanda_vtapes/
1.0M /vmfs/volumes/amanda_vtapes/.sdd.sf
8.0K /vmfs/volumes/amanda_vtapes/.naa.6000d3100087e2000000000000000010
547.6G /vmfs/volumes/amanda_vtapes/alcor
548.4G /vmfs/volumes/amanda_vtapes/
df -h on ESXi shows this:
Filesystem Size Used Available Use% Mounted on
VMFS-5 749.8G 548.6G 201.2G 73% /vmfs/volumes/amanda_vtapes
Here you can see the actual size of the disk:
# ls -lh /vmfs/volumes/amanda_vtapes/alcor/alcor-flat.vmdk
-rw------- 1 root root 748.0G May 6 08:43 /vmfs/volumes/amanda_vtapes/alcor/alcor-flat.vmdk
What would cause this discrepancy? I would expect to see disk usage on ESXi to be closer to the ~145G as reported on the Linux VM.
Note: I have used unmap to try to reclaim unused space with no obvious change or resuls.
# esxcli storage vmfs unmap -l amanda_vtapes
It's not clear to me whether the unmap should cause me to see change in disk usage on ESXi.
Is there any way to resolve this?
Thank you in advance.
Thin provisioned disks start small and then grow as you use them. They do not automatically shrink back. That's why you see 748GB disk on the datastore, even though you use only 143GB within the VM.
Similarly you can have thin-provisioned datastores. Which grow the same way as you add more VMs or as your thin-provisioned VMDKs grow within this datastore.
VMFS Unmap lets you reclaim VMFS-level space, say when you delete a VM from a datastore and want to shrink the datastore. It won't let you shrink OS disks.
To shrink a VMDK you will have to first use OS-level tools to shrink the disk partition on VMDK and then shrink the actual VMDK.