Operation fails when running Move-VM and passing two or more VMs by pipelinе
search cancel

Operation fails when running Move-VM and passing two or more VMs by pipelinе

book

Article ID: 324757

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
  • When running Move-VM to move virtual machines to a vApp and passing two (or more) virtual machines by pipelinе, the operation might fail.
  • You see error similar to:
9/14/2018 2:51:11 PM Move-VM The operation for the entity "test2" failed with the following message: "Operation cannot be performed while a vApp operation is in progress."


Cause

This issue occurs because the underlying vCenter Server operation for the first VM is not completed and the cmdlet tries to perform the operation for the next VM.

Resolution

To resolve this issue, use the following syntax:

@($vm1, $vm2) | %{
   $_ | Move-VM -Destination $destVApp
}