Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: limit vMotion operations?

$
0
0

You can do something like this.

Run the vMotion in the background (RunAsync) and count if more than 2 running

 

$maxParallel=2

 

$vms=  get-vmhost'host1'|get-vm*

foreach($vmin$vms){

  Move-VM-VM (Get-VM-Name$vm.name) -destination'host2'-RunAsync

  do

  {

    sleep5

  } while((Get-Task-StatusRunning|where{$_.Name -eq'RelocateVM_Task'}).Count -gt$maxParallel)

}


Viewing all articles
Browse latest Browse all 219257

Trending Articles