VMware vSAN 6.7 Update 1 was presented during VMware VMworld 2018 and became available for download recently. It is still talked over in the IT community as the update brought many new features to the platform. TRIM/UNMAP, the process for guest OS disk space reclamation, is one of those new features. To make the long story short, it enables to use the storage resources smarter once you create thin provisioned virtual disks. In this article, I discuss how to enable TRIM/UNMAP and why actually you need this feature.

What is the TRIM/UNMAP process?

Automatic disk space reclamation has been introduced back in VMware vSphere 6.5. In that version, the feature works automatically in asynchronous mode and administrator can set the priority for block reclamation:

And, that’s absolutely true that you could find this feature in vSAN before, but it was not working at all. Now, after the U1, it finally works.

Why you need it? Everyone knows that modern operating systems write data into the empty blocks but not in ones that are just marked as deleted. This mechanism helps you to easily restore data that marked as deleted. For space-saving concerns, vSAN allows creating thin provisioned disks that grow gradually as they are filled with data. However, there’s a big challenge with these disks: allocated space always grows even if the guest file system is not increasing its actual usage.

Well, that’s how you lose space, and, obviously, you want to get it back! That’s actually what TRIM and UNMAP processes are for. After U1, vSAN 6.7 proceeds all SCSI/ATA TRIM/UNMAP commands and automatically reclaims the storage space. It should be noted that these commands reach the physical storage device level directly bypassing the LUN and VMFS layers since vSAN does not involve any of those volumes in TRIM/UNMAP processes.

In addition to gaining some extra space, disk blocks reclamation has at least other three benefits:

  • You do not need to waste resources for replicating between hosts the blocks that are not the part of vSAN storage.
  • Backup software won’t proceed those blocks during backups.
  • Clearing read cache. As a result, there are fewer blocks copied between flash cache and capacity tier.

VMware says that TRIM/UNMAP processes do not alter performance. However, if there are too many UNMAP commands, you need to keep an eye on storage infrastructure performance.

How to enable TRIM/UNMAP

Here is the cmdlet for enabling the TRIM/UNMAP process:

For disabling the process, set the d parameter:

Windows Server 2012 and later OS versions allow automatic space reclamation. Execute the following command to check whether the feature is enabled:

If you still need to enable this feature on the guest OS level, run the following command:

Note that blocks reclamation occurs asynchronously. That’s why it takes a while to reclaim the space. To enable TRIM for the disk in Windows environment, run the following PowerShell cmdlet:

Here’s the output:

You also can TRIM with defragmentation utility. Just run it using the L flag:

Defrag C: D: /L

VSAN from StarWind is software-defined storage (SDS) solution created with restricted budgets and maximum output in mind. It pulls close to 100% of IOPS from existing hardware, ensures high uptime and fault tolerance starting with just two nodes. StarWind VSAN is hypervisor and hardware agnostic, allowing you to forget about hardware restrictions and crazy expensive physical shared storage.

Build your infrastructure with off-the-shelf hardware, scale however you like, increase return on investment (ROI) and enjoy Enterprise-grade virtualization features and benefits at SMB price today!


Where to monitor TRIM/UNMAP performance?

Now, let’s look at how TRIM/UNMAP processes impact performance. For that purpose, let’s compare the overall host performance with the feature enabled and without it. You can find performance metrics in the vSAN console by following path: Monitor->vSAN->Performance.

This plot represents two parameters:

  • UNMAP Throughput – how fast UNMAP commands reach the host disk groups.
  • Recovery UNMAP Throughput – how fast UNMAP commands that are parts of the object repair process are executed if the object is missing or damaged.


In today’s article I discussed why you need and how to enable TRIM/UNMAP process that was recently introduced in VMware vSAN with Update 1. It’s a cool feature that helps you to save some space when you use thin provisioned virtual disks.

Views All Time
Views Today
Back to blog
The following two tabs change content below.
Alex Samoylenko
Alex Samoylenko
Virtualization technology professional. 10 years ago he built #1 website on virtualization in Russia. Alex runs his own virtualization-focused company VMC. He is a CEO of a mobile game publisher Nova Games and a CEO of an international dating site