I keep seeing this comment everywhere researching this issue and shake my head, Not defrag - Unmap.
They are not the same thing - Silly Microsoft for putting completely different functions in same app. Defrag and "optimize"
TRIM / Unmap. Automatic in guest unmap. My vmdk white space should take care of itself. I should need white 0s to white space, power off VM, and do a punch Zero. Works perfect in 2016 - not in 2019. Windows is not doing what it suppose to do. Although it is a dance between Vmware + Microsoft to take guest unmap commands and shrink the vmdk. Not sure where issue lies - Vmware or Microsoft.
These commands have nothing to do with defrag and everything to do with TRIM / Unmap being enabled.
fsutil behavior set disabledeletenotify NTFS 0
fsutil behavior set disabledeletenotify ReFS 0
These commands + 2019 + VMFS6 + VMware Tools should enable unmap. Doesn't work. A punch Zero I did on a 2019 vmdk that shrunk ~600GB confirms this. Or if Automatic unmap doesn't work then this command should shrink vmdk. Also doesn't work. Something up with 2019.
Optimize-Volume -DriveLetter H -ReTrim -Verbose
https://communities.vmware.com/message/2989510#2989510