List All Disks (VMDKs) In A Virtual Machine (ESXi)

Using VMware PowerCLI, PowerShell, there’s a nifty way to get a list of all VMDKs associated with a virtual machine(s).

Here’s the command:

Get-Vm | Get-Harddisk | Select Parent, StorageFormat, Filename, CapacityGB, Name | Export-Csv -Path C:\SomeFolder\SomeOutputFile.csv –NoTypeInformation
This command lists all VMDKs for all virtual machines in your VMware cluster.

For this sample, I chose to output the following fields:
Parent, StorageFormat, Filename, CapacityGB and Name

This sample code will provide you something like this:



  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: