VMFS UNMAP is one of those features that was introduced with vSphere 5.5, where one can reclaim unused storage blocks on a VMFS datastore for a thin-provisioned device.
Well, what does that exactly mean? (VMFS UNMAP)
Let’s break it down in simple terms. Let us assume that you have a thin-provisioned LUN that was carved from the storage array and presented to the ESXi hosts in your vSphere environment.
Now, in your vSphere environment, you have created a VMFS datastore out of this thin-provisioned LUN and have VMs running on them.
But the catch is that this will not work with every storage array. This will only work with thin provisioned LUNs that support the VAAI UNMAP primitive.
Okay. I get that! How do I check if my datastore supports VAAI UNMAP primitive?
Well, there is a command that you can use as seen below to check if the thin-provisioned LUN supports VAAI UNMAP primitives?
‘esxcli storage core device vaai status get -d <naa>’
In the example above, if you see the Delete Status, it is shown as Unsupported, which means my LUN is not capable of handling VAAI UNMAP primitives.
Let us assume that it did support as this is my lab environment and I use virtual storage, it was difficult to recreate the exact same requirements.
Up until now, one had to manually run a command from the esxcli namespace to reclaim the unused storage blocks.
That has changed with the new release of vSphere 6.5 and along with comes the new VMFS6 filesystem.
The manual steps would still work and below is the example of a command that you would have to use this if you are running on vSphere 6.0 and below.
esxcli storage vmfs unmap -l DatastoreName
So instead of this manually every time and you wouldn’t be sure as to how much space can be reclaimed, VMware has introduced this feature in VMFS6 where in this setting will be enabled by default and will keep running in the background.
And I know how useful it is because I deal with a lot of customers and this was definitely one of the features that were most commonly asked by them.
How would I know if VMFS UNMAP is enabled?
First of all, as I mentioned before to leverage this feature, you would have to have VMFS6 datastore as this isn’t going to work on the lower versions.
As mentioned before, every VMFS6 datastore will have this feature enabled by default and will be set to Low.
If you click on Edit, you will get the option to set it to None as well.
But there two more options called Medium and High that are not available from the GUI. This can only be set using the esxcli namespace.
To check the current configuration of the Automatic reclaim (VMFS UNMAP), use the below command (ISOs is the datastore name here).
<span class="s1">esxcli storage vmfs reclaim config get -l ISOs
To change the value to either High or Medium, use the below command.
esxcli storage vmfs reclaim config set -l ISOs -p high
But I would highly recommend not to change as it most cases, the Low value to take care of the reclamation of the unused blocks.
I hope this has been informative and thank you for reading!