Syntax
Move-VM [[-Destination] <VIContainer>] [-Datastore <Datastore>] [-RunAsync] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]Related Commands
Online versionDetailed Description
Moves a virtual machine to the location that is specified by the -Destination or the -Datastore parameters. The destination must be a folder, host, cluster, or a resource pool. Moving a virtual machine in a cluster is only possible if the virtual machine is in a resource pool in that cluster. If the virtual machine is outside the cluster, you need to specify a virtual machine host in that cluster as destination. When moving virtual machines that are powered on, VMotion is used. To specify a server different from the default one, use the -Server parameter.Parameters
Return Type
VirtualMachineNotes
Supported on VirtualCenter 2.5/ ESX 3.5 and newer.Examples
-------------- Example 1 --------------
Get-VM -Name VM | Move-VM -Destination 10.23.112.235
Moves the virtual machine named VM from its current location to the host on IP address 10.23.112.235.
-------------- Example 2 --------------
Move-VM -VM VM -Destination Folder
Moves the virtual machine to a folder called Folder. Note that you are able to move virtual machines only to folders containing virtual machines (the 'blue' folders in the vSphere Client).
-------------- Example 3 --------------
Move-VM -VM VM -Destination ResourcePool
Moves the virtual machine to the ResourcePool resourcepool. The ESX host does not change.