How can I audit VMware datastore usage?


I had a recent request for “virtual machine disk usage, per datastore”.  While there are a number of simpler ways to get this information, most of the solutions I’ve seen do not account for VMs that a re split across different datastores, and other solutions that didn’t take into account used vs provisioned sizes.

This script solves that problem, detailing each .vmdk, its used/provisioned size, as well as the datastore it’s located on.  You can then use Excel to manipulate the data further.

Use PowerCLI, change the name of the vCenter server you’re connecting to, and the rest takes care of itself.


The resulting CSV should look like this (sizes listed in GB):




Leave a Reply

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