Automation

 View Only
  • 1.  Virtual machines on VMFS datastores.

    Posted Jun 14, 2016 04:06 PM

    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



  • 2.  RE: Virtual machines on VMFS datastores.

    Posted Jun 14, 2016 04:11 PM

    Try like this

    $clusterName = 'MyCLuster'

    Get-Cluster -Name $clusterName | Get-Datastore |

    where{$_.Type -eq 'VMFS'} | Get-VM



  • 3.  RE: Virtual machines on VMFS datastores.

    Posted Jun 15, 2016 09:13 AM

    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



  • 4.  RE: Virtual machines on VMFS datastores.

    Posted Jun 15, 2016 09:34 AM

    Which PowerCLI version are you using ?

    Do a Get-PowerCLIVersion.



  • 5.  RE: Virtual machines on VMFS datastores.

    Posted Jun 15, 2016 09:40 AM

    Thanks for thr reply.

    I am using vmware vsphere powercli 5.5 release 1.

    Hop this helps



  • 6.  RE: Virtual machines on VMFS datastores.

    Posted Jun 15, 2016 09:51 AM

    Yes, can you upgrade your PowerCLI ?