I am migrating VMs to new hosts using the move-vm cmdlet. The one-liner I am using (courtesy of http://www.simple-talk.com/sysadmin/virtualization/10-steps-to-kick-start-your-vmware-automation-wit...) is:
Get-VMHost esx05 | Get-VM | Move-VM -Destination (Get-VMHost esx06)
What I see right now is that the VMs move one at a time. Is tehre a way to get it to move more than one VM at a time?
Thanks,
Jeff
Yes, use the RunAsync parameter on the Move-VM cmdlet.
Get-VMHost esx05 | Get-VM | Move-VM -Destination (Get-VMHost esx06) -RunAsync
There will still be only a limited number of migrations that runs concurrently, but that is a limitation of your vSphere environment.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, use the RunAsync parameter on the Move-VM cmdlet.
Get-VMHost esx05 | Get-VM | Move-VM -Destination (Get-VMHost esx06) -RunAsync
There will still be only a limited number of migrations that runs concurrently, but that is a limitation of your vSphere environment.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks. I saw that in the get-help for move-vm, but I wasn't exactly sure what it meant.
Jeff
-runasync didn't exactly accomplish what I was expecting, but I found out it was because of a limitation. I am moving VMs to a new cluster. This KB article indicates that a resource pool can only have one vmotion at a time when moving between resource pools:
Jeff
LucD
Hello again. My objective is to use the Move-VM from one datastore to another one at a time. My script is doing the equivalent to -RunAsync.
C:\> $VMsToRelocate = (Get-Content "C:\Users\username\Desktop\O6297-storage_vm\O6297_SVM.csv")
$Datastore = Get-Datastore -Name "st815zz_vcd_ds8"
foreach ($VM in $VMsToRelocate)
{
Write-Host "Relocating VM:" $VM "to" $Datastore
Get-VM -Name $VM | Move-VM -datastore $Datastore > $null
}
Write-Host "Completed!"
My file is a list of VM names:
VM1
VM2
VM3
It works but all at once. I want one at a time. What am I missing?
Do you see the svMotions (Relocate Virtual Machine) running at the same time in the Web Client?have any
Do you have any default parameters set?Check what is in $PSDefaultParameterValues
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
$PSDefaultParameterValues is empty.
I see them running concurrently in web client.
I thought I remembered a simiar thread, and this is th eone Re: Move VMs serially
There are a couple of possible solutions in that thread
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks as always.