WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Configure new automatic Space Reclamation (VMFS UNMAP) using vSphere 6.5 APIs

Configure new automatic Space Reclamation (VMFS UNMAP) using vSphere 6.5 APIs

10.31.2016 by William Lam // 6 Comments

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.

vmfs-unmap-vsphere-65-api-0
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

vmfs-unmap-vsphere-65-api-1
Here is an example of enabling automatic VMFS UNMAP setting:

Get-Datastore "mini-local-datastore-hdd" | Set-VMFSUnmap -Enabled $true

vmfs-unmap-vsphere-65-api-2

More from my site

  • When to use Move-VM cmdlet vs xMove.ps1 script for performing Cross vCenter vMotions?
  • PowerCLI module for Proactive HA (including simulation)
  • New vSphere 6.5 APIs worth checking out
  • Super easy way of getting ESXi installation date in vSphere 6.5
  • Using latest PowerActions 1.5.0 to issue VMFS UNMAP API in vSphere 6.0 Web Client

Categories // Automation, vSphere 6.5 Tags // PowerCLI, unmap, vmfs, vSphere 6.5, vSphere API

Comments

  1. Alexey Stromilov says

    10/31/2016 at 8:30 am

    Great news! Thank you.

    Reply
  2. wolruf says

    10/31/2016 at 9:36 am

    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 ?

    Reply
  3. Stephane says

    11/18/2016 at 3:47 am

    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.

    Reply
  4. Josh Beard says

    08/15/2017 at 12:53 pm

    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.

    Reply
  5. Ilias says

    07/12/2018 at 9:14 am

    Www w

    Reply
  6. christoffer zettermark says

    02/12/2021 at 7:16 am

    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?

    Reply

Thanks for the comment! Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...