VMware Cloud Community
asif-khalil
Contributor
Contributor

To test new datastore must be able to VMotion to and from all hosts

How I check, VMs using the new datastore must be able to VMotion to and from all hosts.

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

If that datastore is known on all the ESXi nodes, it should be possible to vMotion a VM between those ESXi nodes.
If you have the list of ESXi nodes and the name of the datastore, you could do something like this

$tgtVMHost = 'esx1','esx2','esx3'
$dsName = 'DS1'

Get-VMHost -Name $tgtVMHost -PipelineVariable esx |
ForEach-Object -Process {
    New-Object -TypeName PSObject -Property ([ordered]@{
      Datastore = $dsName
      VMHost = $esx.Name
      Status = if(Get-Datastore -Name $dsName -RelatedObject $_){'ok'}else{'nok'}
    })
  }


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