VMware Cloud Community
kwharrisit
Contributor
Contributor

VM disk usage and datastore report

I am trying to figure out the best method to get the following:

Name of VM

Size of 😧 Drive (both preallocated and actually used)

cluster or resource pool the VM belongs to

Datastore where VM resides.

I have been messing with various storage reports that give me VM to datastore mapping, but I need something that will look at the used space within the VM and report that as well. This is all to go into an excel spreadsheet to begin a capacity planning presentation.

HELP! Smiley Happy

Tags (1)
3 Replies
cchesley
Enthusiast
Enthusiast

Our Inventory solution will do exactly that. It is part of our Optimization Pack and will give you lots of information about your environment including the name of the vm, the allocated and used space on the first 3 vmdks and which datastore the vm is on. You can download a free trial at: VKernel Give it a try.

Chris

http://www.vkernel.com

http://www.vkernel.com
kwharrisit
Contributor
Contributor

Hey Chris,

Thanks for the tip. I would still like to know if this can be done via powershell, but I just downloaded the trial to check out this program as well since there are two teams that need this type of data to work with.

0 Kudos
kwharrisit
Contributor
Contributor

OK so here is what I think works so far:

Connect-VIServer vc

Get-Cluster 'cluster'| Get-VM | Where { $_.PowerState -eq "PoweredOn" } | Get-VMGuest | Select VmName -ExpandProperty Disks | Export-Csv c:\reports\storreport.csv

So how can I round the answer for capacity and free space to where capacity = "x"GB and free space can display "X.XX" GBs?

Also can I show what percentage of the disk is being used and the VMFS datastore?

0 Kudos