VMware Cloud Community
BHagenSPI
Enthusiast
Enthusiast

How to report VM Storage Policies on all disks?

I'm running vCenter Server Appliance 6.0, esxi 6.0, vSan 6.2.

From the web client, I can of course edit the settings of a single VM and expand each hard drive and see what storage policy is being used. I don't really want to do that, individually, on 1000 VMs!

Is there a report I can run that gives this specific info for all VMs at once?

Thanks!

Reply
0 Kudos
4 Replies
Gidrakos
Hot Shot
Hot Shot

Is it possible for you to use PowerCLI? Because that's exactly what it's good at doing.

Provided that you've imported the Vmware.VimAutomation.Storage module on top of the Vmware.VimAutomation.Core, you can do the following:

Get-VM [filter] | Get-HardDisk | Get-SpbmEntityConfiguration

Which will result in something like this:

Entity                         Storage Policy                 Status          Time Of Check

------                         --------------                 ------          -------------

Hard disk 1                                                   none

Reply
0 Kudos
BHagenSPI
Enthusiast
Enthusiast

"I'm running vCenter Server Appliance 6.0"

Reply
0 Kudos
BHagenSPI
Enthusiast
Enthusiast

Any more thoughts on this?

Reply
0 Kudos
jrodsguitar
Enthusiast
Enthusiast

As Gidrakos already explained you could run that command and get the info you need.. Get yourself PowerCLI 6.5. Then you should be able to do this (psuedo code):

connect-VIserver -server NAME_OF_SERVER

Get-VM [filter] | Get-HardDisk | Get-SpbmEntityConfiguration

Blog: https://powershell.house/
Reply
0 Kudos