WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Quick Tip - How to check if vSAN TRIM/UNMAP is enabled in VMware Cloud on AWS Cluster?

01.04.2023 by William Lam // 2 Comments

While the original question was for checking whether a specific VMware Cloud on AWS (VMC-A) cluster has the vSAN TRIIM/UNMAP feature enabled, the solutions below is applicable to any recent vSAN 7.x or 8.x deployment. There are two ways you check, either using the vSphere UI by selecting the cluster and navigating to Configure->vSAN->Services and expanding the Advanced Options tile or simply leveraging PowerCLI and the vSAN API to retrieve the exact same information.

vSphere UI

vSAN API using PowerCLI

$clusterName = "Cluster-1"
$vsanConfigSystem = Get-VsanView -Id VsanVcClusterConfigSystem-vsan-cluster-config-system
$clusterMoRef = (Get-Cluster $clusterName).ExtensionData.MoRef
$vsanConfigSystem.VsanClusterGetConfig($clusterMoRef).unmapConfig

 

Categories // Automation, PowerCLI, VMware Cloud on AWS, VSAN Tags // unmap, VMware Cloud on AWS, VSAN

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

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

Using latest PowerActions 1.5.0 to issue VMFS UNMAP API in vSphere 6.0 Web Client

06.22.2015 by William Lam // 4 Comments

Last week, the popular PowerActions Fling was updated to version 1.5.0 which now finally adds support for vSphere 6.0. PowerActions is a vSphere Web Client Plugin that allows administrators to easily execute PowerCLI scripts against inventory objects within the vSphere Web Client. This is a very powerful capability that PowerActions is providing and allows users to easily extend new and custom operations that may not be available within the vSphere Web Client. One such example is being able to easily issue a VMFS UNAMP which in vSphere 5.5 was only available through the use of ESXCLI, I actually demonstrated how easy it is to provide this capability using PowerActions which you can read more about here.

With the release of vSphere 6.0, we now have the ability to issue a VMFS UNMAP using the vSphere API which I have blogged about here among other new vSphere 6.0 APIs. Given that PowerActions now supports vSphere 6.0, I figured this would be a good opportunity to take advantage of the new vSphere 6.0 API using the updated version of PowerActions. I have created a new PowerCLI script called Issue UNMAP 2.0 on Datastore.ps1 which now uses the new UnmapVmfsVolumeEx_Task vSphere API to perform the VMFS UNMAP. I have also submitted a new pull request for this example to Alan Renouf's PowerActions Github repository.

Here is a screenshot of my running the new VMFS UNMAP PowerActions operation against one of my vSphere Datastores and you can that it successfully completed in the Recent Tasks bar.

poweractions-vmfs-unmap
In addition to the new VMFS UNAMP operation that can be added as a PowerAction, here are just a few other examples of new vSphere 6.0 capabilities that you can easily extend into a PowerAction:

  • Perform XvC-vMotion (Migrating a VM between two different vCenter Servers which are NOT part of the same SSO Domain)
  • Configure per-VMDK IOPS reservations
  • Send an NMI request to a VM using the new vSphere 6.0 API described here

I am personally excited for the future and potential of PowerActions and I hope to see the PowerActions framework extend beyond just PowerCLI and support other scripting languages. I think this will be a very powerful capability that the vSphere Web Client can offer to our administrators, operators and developers.

Categories // Automation, vSphere 6.0, vSphere Web Client Tags // PowerCLI, unmap, vSphere 6.0, vSphere API, vsphere web client

  • 1
  • 2
  • 3
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

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 © 2025

 

Loading Comments...