Using VMware vSphere 6.7 U2
Windows server 2019
VM is configured as 'thin'
when you try to run the built-in defrag which supposed to run the UNAMP (Trim) command, it comes with an error, it's not supported, works fine when the guest OS is windows server 2016
anyone has seen this issue??
Welcome to VMTN. 🙂
Is the windows 2016 VM settings and configuration (storage controller, HW version, VMTools etc.) in any way different than the windows 2019 VM ?
Please post the error screenshot from windows 2019 vm.
What error do you receive specifically? Have you tried running "Optimize-Volume -DriveLetter C: -ReTrim -Verbose" for the C: drive for example?
It should give you a more specific error as well.
IMHO Windows does exactly what it should do: prevent that a user tries to defragment a drive when this drive is thin provisioned.
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