Posted in: VMware, vSAN


Automated UNMAP/TRIM feature is available in VSAN 6.7U1 onwards. However it is disabled by default, and has to be enabled.

This feature is supported only on VMs with Hardware version 11 or later (Windows) and Hardware version 13 (Linux VMs). Virtual Machines needs to be Power cycled after enabling TRIM/UNMAP.

Enabling TRIM/UNMAP on cluster is not sufficient to reclaim the space automatically. You also need to run trimming inside the Guest OS of VMs based on the type of Operating system you have, like Windows, Linux etc.

You can enable TRIM/unmap from vCenter Ruby console.

  1. Connect to rvc :
    # rvc [email protected]@localhost
  2. Browse through the vSAN cluster you have :

rvc [email protected]@localhost> cd 1
/localhost> ls
0 VSAN-DC (datacenter)
/localhost> cd 0
/localhost/VSAN-Cluster> ls
0 storage/
1 computers [host]/
2 networks [network]/
3 datastores [datastore]/
4 vms [vm]/
/localhost/ VSAN-Cluster> cd 1
/localhost/ VSAN-Cluster/computers> ls
0 VSAN-Cluster (cluster): cpu 120 GHz, memory 500 GB

3. enable unmap support :

/localhost/ VSAN-Cluster/computers> vsan.unmap_support VSAN-Cluster -e
Unmap support is already disabled
VSAN-Cluster: success

VMs need to be power cycled to apply the unmap setting
/localhost/ VSAN-Cluster /computers>

To check if TRIM/UNMAP is working, you may use below command on Host :-

# vsish -e get /vmkModules/vsan/dom/compmgrStatsForPerfSvc | grep -i unmap

Total number of unmapped writes:0
Total bytes unmapped for write:0
Sum of all unmapped write latencies:0
Sum of all unmapped write latency squares:0
Max of all unmapped write latencies:0
Sum of unmapped write congestion values:0
Total number of unmaps:12669064
Total number of unmaps on leaf owner:0
Total unmap bytes:4248176964544
Sum of all unmap latencies:1589710950