Automation

 View Only
  • 1.  How to Get-Datastore usage within same cluster view?

    Posted Aug 21, 2018 08:12 AM

    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?



  • 2.  RE: How to Get-Datastore usage within same cluster view?

    Posted Aug 21, 2018 08:16 AM

    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?



  • 3.  RE: How to Get-Datastore usage within same cluster view?

    Posted Aug 21, 2018 08:20 AM

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



  • 4.  RE: How to Get-Datastore usage within same cluster view?

    Posted Aug 21, 2018 08:25 AM

    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.

    Do you see the discrepancy all the time?



  • 5.  RE: How to Get-Datastore usage within same cluster view?

    Posted Aug 21, 2018 08:48 AM

    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!!