Hi,
I need help filtering all VMs in a given Cluster which are located on specific datastores. What I've go so far:
List all VMs in a given cluster:
Get-Cluster TEST-CLUSTER | Get-VM
List all VMs on given datastores:
Get-VM -Datastore "TEST-DATASTORE"
But when I try to combine these I still get all VMs (also from other clusters) on this datastore:
Get-Cluster TEST-CLUSTER | Get-VM -Datastore "TEST-DATASTORE"
I've also found this command:
Get-Cluster TEST-CLUSTER | Get-VM | % { @{$_.name=$_.datastoreidlist | %{(Get-View -Property Name -Id $_).Name}} }
This lists the datastores for all VMs in the given Cluster. Now I would need to filter this down to a specific datastore.
I need help with either way =)