Share on Facebook0Share on Google+0Share on LinkedIn0Share on Reddit18Tweet about this on Twitter0

Introduction

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:

https://www.vmgu.ru/content_images/vmware-vsphere-65-storage-2.jpg

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.

https://vmgu.ru/content_images/vmware-vsphere-vsan-67-update-1-9.png

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:

https://vmgu.ru/content_images/vmware-vsan-trim-unmap.jpg

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

Defrag C: D: /L

StarWind Virtual SAN eliminates any need for physical shared storage just by mirroring internal flash and storage resources between hypervisor servers. Furthermore, the solution can be run on the off-the-shelf hardware. Such design allows StarWind Virtual SAN to not only achieve high performance and efficient hardware utilization but also reduce operational and capital expenses.

Learn more about ➡ StarWind Virtual SAN

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.

https://vmgu.ru/content_images/vmware-vsan-trim-unmap-2.jpg

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.

Conclusion

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
1
Views Today
7
Appreciate how useful this article was to you?
1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5
5 out of 5, based on 1 review
Loading...
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