I want to run a powershell script on a vmware cluster to list all the VM's which are on vmfs datastores. We have a vmware cluster which has a mix of vmfs and nfs datastores, and want to move all the VM's off the vmfs datastores onto the nfs datastores, but first we need a list of the VM's which are on the vmfs datastore in a specific cluster.
Is this possible to run in a vmware powershell script.
Thanks
Try like this
$clusterName = 'MyCLuster'
Get-Cluster -Name $clusterName | Get-Datastore |
where{$_.Type -eq 'VMFS'} | Get-VM
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I tried that but it errors with that the get-datastore cannot have the pipeline values. I dont think there are any cluster switches with the get-datastore command. anymore ideas on this.
Thanks
Which PowerCLI version are you using ?
Do a Get-PowerCLIVersion.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for thr reply.
I am using vmware vsphere powercli 5.5 release 1.
Hop this helps
Yes, can you upgrade your PowerCLI ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference