A discrepancy exists between the storage usage reported by the vSphere UI and the actual usage within a Windows Guest OS. The vSphere summary tab may indicate the datastore is near capacity while the Guest OS reports significant free space.
VMware vSphere ESXi 8.x,9.x
When files are deleted within the Windows Guest OS, the file system (NTFS) marks the underlying storage blocks as "free" for future use; however, it does not inherently communicate this status change to the underlying ESXi hypervisor. Consequently, the .vmdk file on the datastore does not shrink, as the host is unaware that the blocks are no longer in use. To synchronize the file system state with the hypervisor storage layer, the Guest OS must issue SCSI UNMAP commands.
To reclaim unused space, use the native Windows Optimize-Volume PowerShell cmdlet to force the issuance of SCSI UNMAP commands to the ESXi host.
Optimize-Volume -DriveLetter C -ReTrim -Verbose Note: The -ReTrim flag forces the operating system to send UNMAP commands to the hypervisor for all unallocated blocks.On VMFS-6 datastores, space reclamation is processed asynchronously. The reduction in datastore usage will not be instantaneous; the hypervisor reclaims space at a low priority to maintain system performance.