Back To Basics: vMotion, Storage vMotion, Cold Migration (PowerCLI)
In this part of Back To Basics, I’ll look at the popular cmdlets in PowerCLI for moving VMs around by vMotion, Storage vMotion and also cold migration. Next in the series will be content all about HA, DRS, DPM, and FT…
Moving a VM with vMotion
The general purpose Move-VM cmdlet can be used to move a VM physical around the vSphere infrastructure, as well as relocating the VM object around in the vCenter inventory. So Move-VM could be used to move VMs from one VM Folder to another, or from one physical vSphere host to another. Remember if you are using VMware Distributed Resource Schedule (DRS) and it is enabled for “Fully Automation” your manual moves may well be fruitless as the system moves VMs around to improve overall performance. To empty (evacuate) a vSphere hosts of all its VMs, it is perhaps more efficent to use “maintenance mode” instead.
The -RunAsync option can be used to trigger the command, and then release the prompt to allow you carry on working whilst that the PowerCLI job completes. Without it the cursor is locked until the entire process completes. This can take somet ime especially with large Storage vMotions.
Moving a Single VM:
Move-VM corphqdb01 -Destination esx01nyc.corp.com -RunAsync