VMware Cloud Community
COS
Expert
Expert

Find empty datastores

We have about 200+ datastores.

Most are used, some are not. Departments pay for them.

How can I get a list of the empty datastores?

I figure if it's not being used, the departments should know so they don't have to pay for them.

0 Kudos
3 Replies
LucD
Leadership
Leadership

A datastore is seldom empty.
What would you consider as being used by the user?
Only VM related files?

Also orphaned VM related files?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
COS
Expert
Expert

Only VM related files.

Orphaned VM related files can be disregarded.

Thanks

0 Kudos
LucD
Leadership
Leadership

In that case the following should give you the names of the datastores that are not used.

Get-Datastore | where{(Get-VM -Datastore $_).COunt -eq 0} |

Select Name


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos