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

  • Script: Updated ghettoVCB and ghettoVCBg2 to Support vSphere 4.1
  • Packer reference for building PhotonOS Virtual Appliance using OVF properties 
  • Quick Tip - Handy ovftool 4.0 advanced options
  • Changing the default behavior of the NSX-T Distributed Firewall (DFW) in VMC to Deny All
  • A trip down memory lane with the vSphere C# Client and ESXi 6.7 & 7.0
Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

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)

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

Connect

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

Support

Recent

  • A first look at the new vSphere+ & vSAN+ Cloud Service 07/01/2022
  • Quick Tip - Prepare VMware Photon OS for use with vSphere Guest OS Customization and cloud-init 06/29/2022
  • Using the new vSphere Guest OS Customization with cloud-init in vSphere 7.0 Update 3 06/27/2022
  • How to forcefully disconnect a vSphere VM Console session? 06/24/2022
  • Quick Tip - Using ESXi Scripted Installation (kickstart) to configure IPv6 networking 06/21/2022

Advertisment

Copyright WilliamLam.com © 2022

 

Loading Comments...