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.

One thought on “Using PowerCLI & vSAN Management API to list VMs w/Thick VM swap

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

Thanks for the comment!