PowerCLI to find all VMs with thick provisioned VMDK

In my environment at work we have a policy that we thin provision all new VMs. We had an issue with a datastore that was running out of space, so I starting looking into it and found that several of the VMs on this datastore were set with thick provisioning on the hard drives.

Get-Datastore | Get-VM | Get-HardDisk | Where {$_.storageformat -eq "Thick" } | Select Parent, Name, CapacityGB, storageformat | FT -AutoSize

This outputs a list of VMs with the storageformat that is set to thick. This enables us to use this list to be able to get a maintenance window to fix these systems.

PowerCLI to find all VMs with thick provisioned VMDK
PowerCLI to find all VMs with thick provisioned VMDK

The biggest problem with this route is having to keep a close eye on the free space on the datastores, as you can easily fill one up without thinking.

-Stuart

3 thoughts on “PowerCLI to find all VMs with thick provisioned VMDK”

    1. If you want to use guest un-map in vSphere 6.5 the disks have to be thin. It’s a best practice in Pure Storage vSphere 6.5 documentation.

  1. Thanks for this usefull one liner.

    Note that storageformat property name is now “EagerZeroedThick” :

    {$_.storageformat -eq “EagerZeroedThick” }

Leave a Reply

Your email address will not be published. Required fields are marked *

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