VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Check if datastore is mounted to all hosts in a cluster

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!

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You mean something like this?

$datastoreName = 'DS1'

Get-Cluster | Get-VMHost | %{

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

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

    }

}


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

You mean something like this?

$datastoreName = 'DS1'

Get-Cluster | Get-VMHost | %{

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

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

    }

}


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

0 Kudos
TheVMinator
Expert
Expert
Jump to solution

OK thanks again!

0 Kudos