VMware Cloud Community
DavidMack
Contributor
Contributor

How to Get-Datastore usage within same cluster view?

I would like to use one PowerCLI command line to show the datastore usage. However, when I use Get-Datastore on different VM host, it shows a little bit different result of same SAN store.

For example,

Run Get-Datastore on VM01, it shows:

Name     FreespaceGB     CapacityGB

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

OS01     872.666               1599.750

Then, I run Get-Datastore on VM02, it shows different:

Name     FreespaceGB     CapacityGB

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

OS01     936.152               1599.750

The FreespaceGB is different even both VM01 and VM02 are in same cluster to connect single SAN.

May I know how to use one PowerCLI command line to get the datastore usage by cluster view?

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

What are VM01 and VM02?

Virtual machines or ESXi nodes?

And what kind of connection are you using?

To the vCenter, or to an ESXi node?


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

Reply
0 Kudos
DavidMack
Contributor
Contributor

VM01 and VM02 are ESXi hosts and I am using the connection to ESXi nodes through PowerCLI command prompt, thanks.

Reply
0 Kudos
LucD
Leadership
Leadership

Can I assume that you did not test this through a vCenter connection?

That free space indication is calculated and refreshed on an interval.

See the comment on the Datastore object.

freespace.png

Do you see the discrepancy all the time?


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

Reply
0 Kudos
DavidMack
Contributor
Contributor

I think I know what is the reason I see the diferent result within same cluster on single SAN.

When I try to connect to vCenter to use Get-Datastore commandlet, it shows the correct result same as I see in the vCenter webconsole.

Many thanks, LucD!!

Reply
0 Kudos