Move-VMStorage
Move-VMStorage
Moves the storage of a virtual machine.
Syntax
Parameter Set: NameMultipleDestinations
Move-VMStorage [-Name] <System.String> [-AllowUnverifiedPaths] [-AsJob] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-RemoveSourceUnmanagedVhds] [-ResourcePoolName <String> ] [-RetainVhdCopiesOnSource] [-SmartPagingFilePath <String> ] [-SnapshotFilePath <String> ] [-Vhds <Hashtable[]> ] [-VirtualMachinePath <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: NameSingleDestination
Move-VMStorage [-Name] <System.String> [-DestinationStoragePath] <String> [-AllowUnverifiedPaths] [-AsJob] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-RemoveSourceUnmanagedVhds] [-ResourcePoolName <String> ] [-RetainVhdCopiesOnSource] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMMultipleDestinations
Move-VMStorage [-VM] <VirtualMachine> [-AllowUnverifiedPaths] [-AsJob] [-RemoveSourceUnmanagedVhds] [-ResourcePoolName <String> ] [-RetainVhdCopiesOnSource] [-SmartPagingFilePath <String> ] [-SnapshotFilePath <String> ] [-Vhds <Hashtable[]> ] [-VirtualMachinePath <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: VMSingleDestination
Move-VMStorage [-VM] <VirtualMachine> [-DestinationStoragePath] <String> [-AllowUnverifiedPaths] [-AsJob] [-RemoveSourceUnmanagedVhds] [-ResourcePoolName <String> ] [-RetainVhdCopiesOnSource] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detaillierte Beschreibung
The Move-VMStorage cmdlet moves the storage of a virtual machine.
Parameter
-AsJob
Runs the cmdlet as a background job.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-CimSession<Microsoft.Management.Infrastructure.CimSession[]>
Das Cmdlet wird in einer Remotesitzung oder auf einem Remotecomputer ausgeführt. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, wie z. B. die Ausgabe eines New-CimSession oder Get-CimSession-Cmdlets. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Credential<System.Management.Automation.PSCredential[]>
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Name<System.String>
Specifies a name.
Aliase |
VMName |
Erforderlich? |
true |
Position? |
1 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
true(ByValue) |
Platzhalterzeichen akzeptieren? |
false |
-RemoveSourceUnmanagedVhds
Indicates that Hyper-V deletes the parent virtual hard disk on the source after this cmdlet moves a differencing virtual hard disk, when the migration is finished.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ResourcePoolName<String>
Specifies the name of the storage resource pool to use after the move operation is complete.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-SnapshotFilePath<String>
Specifies the new path for any snapshot files associated with the virtual machine.
Aliase |
CheckpointFileLocation,SnapshotFileLocation |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-VM<VirtualMachine>
Specifies the virtual machine whose storage is to be moved.
Aliase |
none |
Erforderlich? |
true |
Position? |
1 |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
True (ByValue) |
Platzhalterzeichen akzeptieren? |
false |
-VirtualMachinePath<String>
Specifies the path to the virtual machine configuration file and associated memory files.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-AllowUnverifiedPaths
Allows the move operation to be attempted even if the paths specified for the destination computer cannot be verified prior to attempting the move operation.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-DestinationStoragePath<String>
Specifies a destination storage path to which all virtual machine storage is to be moved.
Aliase |
none |
Erforderlich? |
true |
Position? |
2 |
Standardwert |
none |
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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-SmartPagingFilePath<String>
Specifies the new path to use for a smart paging file, if one is needed.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Vhds<Hashtable[]>
Specifies an array of hashtables that contain locations for each individual virtual hard disk to be moved. Each hashtable should have 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 name must be identical in both entries.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ComputerName<String[]>
Specifies one or more virtual machine hosts on which the virtual machine storage is to be moved. 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.
Aliase |
none |
Erforderlich? |
false |
Position? |
named |
Standardwert |
none |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Confirm
Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.
Erforderlich? |
false |
Position? |
named |
Standardwert |
false |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-WhatIf
Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.
Erforderlich? |
false |
Position? |
named |
Standardwert |
false |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
<CommonParameters>
Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -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 Sie per Piping an das Cmdlet übergeben können.
Ausgaben
Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.
Beispiele
Example 1
Moves all files associated with a virtual machine test VM to D:\TestVM
PS C:\> Move-VMStorage "Test VM" –DestinationStoragePath D:\TestVM
Example 2
Moves all files associated with a virtual machine test VM to different locations under D:\TestVM.
PS C:\> Move-VMStorage "Test VM" –VirtualMachinePath D:\TestVM\Config –SnapshotFilePath D:\TestVM\Snapshots –SmartPagingFilePath D:\TestVM\SmartPaging –VHDs @(@{"SourceFilePath" = "C:\TestVM\Disk1.VHDX"; "DestinationFilePath" = "D:\TestVM\Disks\Disk1.VHDX"}, @{"SourceFilePath" = "C:\TestVM\Disk2.VHDX"; "DestinationFilePath" = "D:\TestVM\Disks\Disk2.VHDX"})