Since its first introduction in vSphere 5.5, VMFS UNMAP also know as Space Reclamation for a VMFS based datastore has been a pretty popular Storage capability in vSphere. A commonly asked question from customers is when will the "automatic" capability return? Well, it looks like it is now back in the upcoming vSphere 6.5 release as blogged about here by Duncan Epping. Below is a screenshot of where you can find the setting. VMFS UNMAP is now enabled by default and you will need to have a VMFS 6 datastore to take advantage of this new feature.
For customers who wish to automate the configuration of the VMFS UNAMP capability whether that is to check the current settings or to enable/disable it, there are some new vSphere 6.5 APIs that have been introduced which differ from the previous implementations. To change the VMFS UNMAP setting, there is a new vSphere API called UpdateVmfsUnmapPriority() which accepts the UUID of a VMFS 6 datastore as well as an unmapPriority property which can either be "low" which means it is enabled or "none" which means it is disabled. To view the current VMFS UNMAP settings, there is a new property under the Datastore->Info->Vmfs object called UnmapPriority.
To demonstrate this new vSphere API, I have created two small PowerCLI functions called Get-VMFSUnmap and Set-VMFSUnmap which can be downloaded from here.
Here is an example of retrieving the current VMFS UNMAP settings:
Get-Datastore "mini-local-datastore-hdd" | Get-VMFSUnmap
Here is an example of enabling automatic VMFS UNMAP setting:
Get-Datastore "mini-local-datastore-hdd" | Set-VMFSUnmap -Enabled $true
Alexey Stromilov says
Great news! Thank you.
wolruf says
Can there be collision between guest OS unmap and vSphere's ? http://cormachogan.com/2015/05/07/vsphere-6-0-storage-features-part-8-vaai-unmap-changes/ ?
Similarly, do you need the storage to be VAAI or VAAI-NAS enabled ?
Stephane says
Thank you for this information.
What is exactly "low" ?
Is it time between execution, task's priority, I/O load, or something else ?
Thank you in advance.
Josh Beard says
What event or criteria triggers the automatic unmaps? Normally we run umaps manually throughout out environment a couple times a year. Trying to understand if the automatic unmaps will accomplish this.
Ilias says
Www w
christoffer zettermark says
I noticed that the script collects all hosts connected to a datastore (into $vmhostview). Is it necessery to do this? Is the auto-unmap-setting accutally a per host setting? Or just per datastore?