Move-VM

Move-VM

Moves a virtual machine to a new Hyper-V host.

Syntax

Parameter Set: Name
Move-VM [-Name] <String> [-DestinationHost] <String> [-AsJob] [-ComputerName <String[]> ] [-DestinationStoragePath <String> ] [-IncludeStorage] [-Passthru] [-ResourcePoolName <String> ] [-RetainVhdCopiesOnSource] [-SmartPagingFilePath <String> ] [-SnapshotFilePath <String> ] [-Vhds <Hashtable[]> ] [-VirtualMachinePath <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: CompatibilityReport
Move-VM [-CompatibilityReport] <VMCompatibilityReport> [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VM
Move-VM [-VM] <VirtualMachine> [-DestinationHost] <String> [-AsJob] [-DestinationStoragePath <String> ] [-IncludeStorage] [-Passthru] [-ResourcePoolName <String> ] [-RetainVhdCopiesOnSource] [-SmartPagingFilePath <String> ] [-SnapshotFilePath <String> ] [-Vhds <Hashtable[]> ] [-VirtualMachinePath <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The Move-VM cmdlet moves a virtual machine to a new Hyper-V host.

Parameter

-AsJob

Specifies that the cmdlet is to be run as a background job.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-CompatibilityReport<VMCompatibilityReport>

Specifies a compatibility report which includes any adjustments required for the move.

Aliasse

Keiner

Erforderlich?

true

Position?

1

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts from which the virtual machine is to be removed. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer — use “localhost” or a dot (“.”) to specify the local computer explicitly.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

.

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-DestinationHost<String>

Specifies the virtual machine host to which the virtual machine is to be moved.

Aliasse

Keiner

Erforderlich?

true

Position?

2

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-DestinationStoragePath<String>

Specifies a destination storage path to which all virtual machine storage is to be moved.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-IncludeStorage

Specifies that both the virtual machine and its storage are to be moved.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Name<String>

Specifies the friendly name of the virtual machine to be moved.

Aliasse

Keiner

Erforderlich?

true

Position?

1

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-Passthru

Specifies that an object is to be passed through to be pipeline representing the moved virtual machine.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-VM<VirtualMachine>

Specifies the virtual machine to be moved.

Aliasse

Keiner

Erforderlich?

true

Position?

1

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-ResourcePoolName<String>

Specifies the name of the storage resource pool to use after the move operation is complete.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-RetainVhdCopiesOnSource

Specify $true to keep any parent virtual hard disks on the source computer. If not specified, all virtual hard disks will be removed from the source computer once the virtual machine is successfully moved.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-SmartPagingFilePath<String>

Specifies the new path to use for a smart paging file, if one is needed.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-SnapshotFilePath<String>

Specifies the new path for any snapshot files associated with the virtual machine.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Vhds<Hashtable[]>

An array of hashtables that specifies a location for each individual virtual hard disk that needs to be moved. Each hashtable has two entries. The first entry specifies the current location of the virtual hard disk to move, and has a key of SourceFilePath. The second entry specifies the new location for the virtual hard disk, and has a key of DestinationFilePath. The virtual hard disk names must be identical in both entries.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-VirtualMachinePath<String>

Specifies the path for the virtual machine configuration file and associated memory files.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Confirm

Sie werden vor dem Ausführen des Cmdlets zur Bestätigung aufgefordert.

Erforderlich?

false

Position?

named

Standardwert

falsch

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

falsch

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • None, by default. Microsoft.HyperV.PowerShell.VirtualMachine if the migration succeeds and -PassThru is specified. Microsoft.HyperV.PowerShell.CompatibilityReport if the migration fails because of an incompatibility.

Beispiele

Example 1

Moves a virtual machine test VM to a remote computer remoteServer when the virtual machine is stored on an SMB share.

PS C:\> Move-VM "Test VM" remoteServer

Example 2

Moves virtual machine test VM to remote computer remoteServer, and moves all files associated with the virtual machine to D:\TestVM on the remote computer.

PS C:\> Move-VM "Test VM" remoteServer –IncludeStorage –DestinationStoragePath D:\TestVM

Example 3

Moves a virtual machine Test VM to a remote computer remoteServer and places the files associated with the virtual machine in the specified locations under D:\TestVM on the remote computer.

PS C:\> Move-VM "Test VM" remoteServer –VirtualMachinePath D:\TestVM\Config –SnapshotFilePath D:\TestVM\Snapshots –SmartPagingFilePath D:\TestVM\SmartPaging –IncludeStorage –VHDs @(@{"SourceFilePath" = "C:\TestVM\Disk1.VHDX"; "DestinationFilePath" = "D:\TestVM\Disks\Disk1.VHDX"}, @{"SourceFilePath" = "C:\TestVM\Disk2.VHDX"; "DestinationFilePath" = "D:\TestVM\Disks\Disk2.VHDX"})