Syntax
New-HCXMigration [-Confirm] -DestinationSite <HCXSite> [-DiskProvisionType {SameAsSource | Thick | Thin}] [-Folder <HCXFolderContainer>] [-ForcePowerOffVm <Boolean>] -MigrationType {vMotion | Bulk | Cold} [-RemoveISOs <Boolean>] [-RemoveSnapshots <Boolean>] [-RetainMac <Boolean>] [-ScheduleEndTime <DateTime>] [-ScheduleStartTime <DateTime>] [-Server <HcxServer[]>] -SourceSite <HCXSite> [-TargetComputeContainer <HCXComputeContainer>] -TargetDatastore <HCXDatastore> [-UpgradeHardware <Boolean>] [-UpgradeVMTools <Boolean>] -VM <HCXVM> [-WhatIf] -NetworkMapping <HCXNetworkMapping[]> [-TargetStorageProfile <HCXStorageProfile>] [<CommonParameters>]Related Commands
Detailed Description
This cmdlet creates an HCX migration request that can be used to test or start a migration.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Confirm | SwitchParameter | 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. | false | False | |
DestinationSite | HCXSite | Specifies the site to which you want to migrate the virtual machine. If you want to retrieve a destination site, run "Get-HCXSite -Destination". | true | True (ByValue) | |
DiskProvisionType | DiskProvisionType | Specifies the type of the disk provisioning that you want to use. | false | False | |
Folder | HCXFolderContainer | Specifies the folder on the destination site. If you want to retrieve the folder, run Get-HCXContainer -Type Folder -Site $DestinationSite -Name "Folder name". | false | True (ByValue) | |
ForcePowerOffVm | Boolean | Specifies whether you want the virtual machine to be in a powered off state after the migration. | false | False | |
MigrationType | MigrationType | Specifies the type of migration that you want to perform. | true | False | |
NetworkMapping | HCXNetworkMapping[] | Specifies the source and destination networks you want to use. | true | False | |
RemoveISOs | Boolean | Specifies whether you want to remove the ISO files after the migration. | false | False | |
RemoveSnapshots | Boolean | Specifies whether you want to remove the snapshots after the migration. | false | False | |
RetainMac | Boolean | Specifies whether you want to retain the MAC address after the migration. | false | False | |
ScheduleEndTime | DateTime | Specifies the end time of the schedule window in case of bulk migration. | false | False | |
ScheduleStartTime | DateTime | Specifies the start time of the schedule window in case of bulk migration. | false | False | |
Server | HcxServer[] | Specifies the HCX Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-HCXServer cmdlet. | false | False | |
SourceSite | HCXSite | Specifies the site from which you want to migrate the virtual machine. If you want to retrieve a source site, use the Get-HCXSite cmdlet. | true | True (ByValue) | |
TargetComputeContainer | HCXComputeContainer | Specifies the container on the destination site. If you want to retrieve the container, run Get-HCXContainer -Type ComputeContainer -Site $DestinationSite -Name "Container name". | false | True (ByValue) | |
TargetDatastore | HCXDatastore | Specifies the datastore on the destination site. If you want to retrieve the datastore, run Get-HCXDatastore -Site $DestinationSite -Name "datastore name". | true | True (ByValue) | |
TargetStorageProfile | HCXStorageProfile | Specifies the storage profile at the destination site that you want to use. | false | True (ByValue) | |
UpgradeHardware | Boolean | Specifies whether you want to upgrade the hardware after the migration. | false | False | |
UpgradeVMTools | Boolean | Specifies whether you want to upgrade the VM tools after the migration. | false | False | |
VM | HCXVM | Specifies the virtual machine on the source site. If you want to retrieve the virtual machine, use Get-HCXVM -Site $SourceSite -Name "vm name". | true | True (ByValue) | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.The cmdlet is not run. | false | False |
Return Type
VMware.VimAutomation.Hcx.Types.V1.HCXMigrationNotes
Examples
-------------------------- Example 1 --------------------------
PS C:\> New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType vMotion
Creates a vMotion migration request object.
-------------------------- Example 2 --------------------------
PS C:\> New-HCXMigration -SourceSite $source -DestinationSite $dest -VM $vm -NetworkMapping $myNetworkMapping -TargetDatastore $Storage -TargetComputeContainer $Container -ScheduleStartTime '01/02/2019 7:50:40 PM' -ScheduleEndTime '01/02/2019 8:50:40 PM' -MigrationType Bulk
Creates a bulk migration request object.
-------------------------- Example 3 --------------------------
PS C:\> New-HCXMigration -SourceSite $source -DestinationSite $dest -VM $vm -NetworkMapping $myNetworkMapping -TargetDatastore $Storage -TargetComputeContainer $Container -MigrationType Cold
Creates a cold migration request object.
-------------------------- Example 4 --------------------------
PS C:\> $myDestination = Get-HCXSite -Destination -Name "myDestinationName" $myStorageProfile = Get-HCXStorageProfile -Site $myDestination -Name "myStorageProfileName" New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType vMotion -StorageProfile $myStorageProfile
Creates a vMotion migration request object with a storage profile.