The below has been performed yet TRIM/UNMAP does not work on vSAN datastore:
TRIM/UNMAP is enabled on the vSAN cluster.
Verified each host to see if UNMAP is enabled. The following command can be run in SSH of ESXi, in the output, the parameter "current value" of 1 indicates that it is enabled:
To check if TRIM/UNMAP is enabled on the cluster level - vsish -e get /config/VSAN/intOpts/Unmap
To check if TRIM/UNMAP was enabled for GuestOS - vsish -e get /config/VSAN/intOpts/GuestUnmap
The VMs have been power cycled. (NOT Restart)
fstrim command was used.Optimize-Volume command was used.VMware vSAN (All versions)
The UNMAP/TRIM command (fstrim/Optimize-Volume) for the GuestOS was not run using a user with sufficient permissions.
To resolve this issue, run the TRIM/UNMAP command using the highest privilege within the respective GuestOS:
For the Linux VMs, the command - sudo fstrim --all -verbose
Can be run within the GuestOS to send UNMAP/TRIM command immediately to vSAN, to reclaim the unused space.
For Windows VMs the command - Optimize-Volume -DriveLetter <DriverLetter> -ReTrim –Verbose
Can be run within the GuestOS in a PowerShell/Command prompt which was opened as "Run as administrator".