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

  • Super easy way of getting ESXi installation date in vSphere 6.5
  • VM Storage Policy APIs aka Storage Profile APIs will be available in vSphere 5.5
  • Why is my VSAN Component maximum showing less than 3000?
  • Exploring VSAN APIs Part 8 – Maintenance Mode
  • How to Persist Configuration Changes in ESXi 4.x/5.x Part 1

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

Leave a Reply to ArunabhCancel 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, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC) across Private, Hybrid and Public Cloud

Connect

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

Recent

  • ESXi on Lenovo ThinkStation P3 Ultra 09/29/2023
  • Quick Tip - vSphere 7.0 Update 3o also supports disabling/enabling vSphere Cluster Services (vCLS) in vSphere UI 09/29/2023
  • Heads Up - New image identifier required by VM Service in vSphere 8.0 Update 2 09/27/2023
  • How to setup private GitLab on a Synology for Project Keswick? 09/26/2023
  • ESXi on SimplyNUC Moonstone 09/25/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...