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

  • Quick Tip - NSX-T 2.1 upgrade gotcha, use NSX Manager IP Address vs Hostname
  • New sponsor: Veeam
  • Quick Tip - Automating allowed and not allowed Datastores for use with vSphere Cluster Services (vCLS)
  • How to easily disable vMotion & Cross vCenter vMotion for a particular Virtual Machine?
  • PowerCLI Core is now available on Docker Hub!

Categories // Automation, PowerCLI, VSAN

Comments

  1. jonesy777 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. Arunabh 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

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