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

Leave a Reply

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