powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Move-VM



NAME
Move-VM

SYNOPSIS
Moves virtual machines to another location.

SYNTAX
Move-VM [[-Destination] ] [-Datastore ] [-DiskStorageFormat ] [-R
unAsync] [-VM] [-Server ] [-WhatIf] [-Confirm] []


DESCRIPTION
Moves a virtual machine to the location that is specified by the -Destination or the -Datastore parameters. The des
tination must be a folder, host, cluster, or a resource pool. Moving a virtual machine in a cluster is only possibl
e 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 powere
d on, VMotion is used. To specify a server different from the default one, use the -Server parameter.


PARAMETERS
-Destination
Specify a folder, host, cluster, or a resource pool where you want to move the virtual machines. If a datacente
r is specified for the -Destination parameter, the virtual machines are moved to the datacenter's "vmFolder" fo
lder. The "vmFolder" is a system folder and is guaranteed to exist.
Passing values to this parameter through a pipeline is deprecated and will be disabled in a future release.

Required? false
Position? 2
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Datastore
Specify the datastore where you want to move the virtual machines.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-DiskStorageFormat
Specify a new storage format for the hard disk of the virtual machine you want to move. This parameter is appli
cable only when moving a virtual machine to a different datastore, using the -Datastore parameter. The valid va
lues are Thin and Thick.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-RunAsync
Indicate that the command returns immediately without waiting for the task to complete. In this mode, the outpu
t of the cmdlet is a Task object. For more information about the -RunAsync parameter run " help About_RunAsync"
in the vSphere PowerCLI console.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-VM
Specify the virtual machines you want to move to another location.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-WhatIf
Indicate that the cmdlet is run only to display the changes that would be made and actually no objects are modi
fied.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm
If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,
the cmdlet runs without asking for user confirmation.

Required? false
Position? named
Default value $true
Accept pipeline input? false
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
VirtualMachine


NOTES


Supported on VirtualCenter 2.5/ ESX 3.5 and newer.

-------------- Example 1 --------------

C:\PS>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 --------------

C:\PS>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 folder
s containing virtual machines (the 'blue' folders in the vSphere Client).





-------------- Example 3 --------------

C:\PS>Move-VM -VM VM -Destination ResourcePool


Moves the virtual machine to the ResourcePool resourcepool. The ESX host does not change.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Move-VM.html
Get-VM
Remove-VM
New-VM
Set-VM
Start-VM
Stop-VM
Suspend-VM
Restart-VM