PowerCLI

 View Only
Expand all | Collapse all

Check if datastore is mounted to all hosts in a cluster

  • 1.  Check if datastore is mounted to all hosts in a cluster

    Posted May 30, 2017 02:23 PM

    I have a datastore that needs to be mounted by all ESXi hosts in a 5.5 cluster.  How can I do this with powerCLI?

    THanks!



  • 2.  RE: Check if datastore is mounted to all hosts in a cluster
    Best Answer

    Posted May 30, 2017 04:03 PM

    You mean something like this?

    $datastoreName = 'DS1'

    Get-Cluster | Get-VMHost | %{

        if(Get-Datastore -Name $datastoreName -RelatedObject $_){

           Write-Host "$($datastoreName) available on $($_.Name)"

        }

    }



  • 3.  RE: Check if datastore is mounted to all hosts in a cluster

    Posted May 31, 2017 04:08 PM

    OK thanks again!