WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Using PowerCLI & vSAN Management API to list VMs w/Thick VM swap

Using PowerCLI & vSAN Management API to list VMs w/Thick VM swap

11.17.2017 by William Lam // 2 Comments

Earlier this year, I had put together a Python script using the vSAN Management API to help customers easily identify Virtual Machines which have Thick VM swap while running on vSAN. You can find the full details in Duncan's blog post here. The reason I had chosen Python over something like PowerCLI, which I frequently use now, is that I had found a bug within the Storage PowerCLI module which prevented me from accessing the required vSAN Management API.

With the release of PowerCLI 6.5.4 today, this issue has now been resolved and I have created the equivalent PowerCLI script called VSANVMThickSwap.ps1 which includes a function called Get-VSANVMThickSwap to retrieve the exact same information as the Python script.

To use the function, you simply pass in the name of a vSAN Cluster as shown in the screenshot below and the script will return all powered on VMs that have been configured with Thick VM Swap.

More from my site

  • This blog has been hacked (not really) by vS0ciety
  • Quick Tip - How to tell if a VMFS datastore is local or not using new vSphere 5.5 API?
  • vSphere Event-Driven Automation using Tanzu Application Platform (TAP) on Tanzu Community Edition
  • There's a CloudPhysics Card for that
  • Configuring Github Actions self-hosted runners on PhotonOS 

Categories // Automation, PowerCLI, VSAN

Comments

  1. *protectedjonesy777 says

    11/17/2017 at 11:06 am

    If I change the SPBM to 0% reservation I would still have to do a storage migration to get the benefits of the space reclamation correct? So if I have 100GB with mirroring I am using 200GB if my SPBM is set to 100%. Then I change SPBM to 0% and the actual space used is 50GB and with mirroring should be 100GB, I am guessing it would be required to do a storage migration to get back my 100GB.

    Reply
  2. *protectedArunabh says

    06/04/2019 at 2:03 am

    Hi William, can you help me with a single liner for powercli (I'm using 11.2.0 build 12483598) to get the list of VMs (with their cluster names) along with the disks which have thick provisioned or any policy assigned with Object space reservation set to 100%?

    Reply

Thanks for the comment!Cancel reply

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

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...