New-HCXMigration Command | Vmware PowerCLI Reference

New-HCXMigration

This cmdlet creates an HCX migration request that you can use to test or start a migration.

Syntax

New-HCXMigration
-DestinationSite < HCXSite >
-MigrationType < MigrationType >
-NetworkMapping < HCXNetworkMapping[] >
-SourceSite < HCXSite >
-TargetDatastore < HCXDatastore >
-VM < HCXVM >
[-DiskProvisionType < DiskProvisionType > ]
[-EnableSeedCheckpoint < Boolean > ]
[-Folder < HCXFolderContainer > ]
[-ForcePowerOffVm < Boolean > ]
[-GuestOSCustomization < HCXGuestOSCustomization > ]
[-MigrateCustomAttributes < Boolean > ]
[-ProgressAction < ActionPreference > ]
[-RemoveISOs < Boolean > ]
[-RemoveSnapshots < Boolean > ]
[-ReplicateSecurityTags < Boolean > ]
[-RetainMac < Boolean > ]
[-ScheduleEndTime < DateTime > ]
[-ScheduleStartTime < DateTime > ]
[-Server < HcxServer[] > ]
[-TargetComputeContainer < HCXComputeContainer > ]
[-TargetStorageProfile < HCXStorageProfile > ]
[-UpgradeHardware < Boolean > ]
[-UpgradeVMTools < Boolean > ]
[-memory < Int32 > ]
[-vcpus < Int32 > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
DestinationSite HCXSite named
  • pipeline
Specifies the site to which you want to migrate the virtual machine. If you want to retrieve a destination site, run "Get-HCXSite -Destination".
required
MigrationType MigrationType named
Specifies the type of migration that you want to perform.
required
NetworkMapping HCXNetworkMapping[] named
Specifies the source and destination networks you want to use.
required
SourceSite HCXSite named
  • pipeline
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.
required
TargetDatastore HCXDatastore named
  • pipeline
Specifies the datastore on the destination site. If you want to retrieve the datastore, run Get-HCXDatastore -Site $DestinationSite -Name "datastore name".
required
VM HCXVM named
  • pipeline
Specifies the virtual machine on the source site. If you want to retrieve the virtual machine, use Get-HCXVM -Site $SourceSite -Name "vm name".
optional DiskProvisionType DiskProvisionType named
Specifies the type of the disk provisioning that you want to use.
optional EnableSeedCheckpoint Boolean named
The Seed Checkpoint option captures migration progress when a failure is encountered. On a subsequent attempt, the migration will resume based on Seed Checkpoint data when it's available. Without Seed Checkpoint, migration progress is discarded when a failure is encountered. This option is available only for RAV and Bulk migration profiles.
optional Folder HCXFolderContainer named
  • pipeline
Specifies the folder on the destination site. If you want to retrieve the folder, run Get-HCXContainer -Type Folder -Site $DestinationSite -Name "Folder name".
optional ForcePowerOffVm Boolean named
Specifies whether you want the virtual machine to be in a powered off state after the migration.
optional GuestOSCustomization HCXGuestOSCustomization named
  • pipeline
Creates a HCX migration with Guest OS customization options. This enables a user to select certain customization options while migrating a VM or a bunch of VMs based on their use case. This option is available only for Bulk migration profile.
optional MigrateCustomAttributes Boolean named
Specifies whether you want to migrate the custom attributes of the virtual machine undergoing migration
optional ProgressAction ActionPreference named
optional RemoveISOs Boolean named
Specifies whether you want to remove the ISO files after the migration.
optional RemoveSnapshots Boolean named
Specifies whether you want to remove the snapshots after the migration.
optional ReplicateSecurityTags Boolean named
Specifies whether you want to replicate the security tags after the migration.
optional RetainMac Boolean named
Specifies whether you want to retain the MAC address after the migration.
optional ScheduleEndTime DateTime named
Specifies the end time of the schedule window in case of bulk migration.
optional ScheduleStartTime DateTime named
Specifies the start time of the schedule window in case of bulk migration.
optional Server HcxServer[] named
Specifies the HCX Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-HCXServer cmdlet.
optional TargetComputeContainer HCXComputeContainer named
  • pipeline
Specifies the container on the destination site. If you want to retrieve the container, run Get-HCXContainer -Type ComputeContainer -Site $DestinationSite -Name "Container name".
optional TargetStorageProfile HCXStorageProfile named
  • pipeline
Specifies the storage profile at the destination site that you want to use.
optional UpgradeHardware Boolean named
Specifies whether you want to upgrade the hardware after the migration.
optional UpgradeVMTools Boolean named
Specifies whether you want to upgrade the VM tools after the migration.
optional memory Int32 named
Specifies that you should use OSAM to override the memory setting of the migrated virtual machine. The unit is MB.
optional vcpus Int32 named
Specifies that you should use OSAM to override the vCPU setting of the migrated virtual machine.
New-HCXMigration
-DestinationSite < HCXSite >
-MobilityGroupMigration
-SourceSite < HCXSite >
-VM < HCXVM >
[-DiskProvisionType < DiskProvisionType > ]
[-EnableSeedCheckpoint < Boolean > ]
[-Folder < HCXFolderContainer > ]
[-ForcePowerOffVm < Boolean > ]
[-GuestOSCustomization < HCXGuestOSCustomization > ]
[-MigrateCustomAttributes < Boolean > ]
[-MigrationType < MigrationType > ]
[-NetworkMapping < HCXNetworkMapping[] > ]
[-ProgressAction < ActionPreference > ]
[-RemoveISOs < Boolean > ]
[-RemoveSnapshots < Boolean > ]
[-ReplicateSecurityTags < Boolean > ]
[-RetainMac < Boolean > ]
[-ScheduleEndTime < DateTime > ]
[-ScheduleStartTime < DateTime > ]
[-Server < HcxServer[] > ]
[-TargetComputeContainer < HCXComputeContainer > ]
[-TargetDatastore < HCXDatastore > ]
[-TargetStorageProfile < HCXStorageProfile > ]
[-UpgradeHardware < Boolean > ]
[-UpgradeVMTools < Boolean > ]
[-memory < Int32 > ]
[-vcpus < Int32 > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
DestinationSite HCXSite named
  • pipeline
Specifies the site to which you want to migrate the virtual machine. If you want to retrieve a destination site, run "Get-HCXSite -Destination".
required
MobilityGroupMigration SwitchParameter named
This creates a mobility group and adds the migration object to that group.
required
SourceSite HCXSite named
  • pipeline
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.
required
VM HCXVM named
  • pipeline
Specifies the virtual machine on the source site. If you want to retrieve the virtual machine, use Get-HCXVM -Site $SourceSite -Name "vm name".
optional DiskProvisionType DiskProvisionType named
Specifies the type of the disk provisioning that you want to use.
optional EnableSeedCheckpoint Boolean named
The Seed Checkpoint option captures migration progress when a failure is encountered. On a subsequent attempt, the migration will resume based on Seed Checkpoint data when it's available. Without Seed Checkpoint, migration progress is discarded when a failure is encountered. This option is available only for RAV and Bulk migration profiles.
optional Folder HCXFolderContainer named
  • pipeline
Specifies the folder on the destination site. If you want to retrieve the folder, run Get-HCXContainer -Type Folder -Site $DestinationSite -Name "Folder name".
optional ForcePowerOffVm Boolean named
Specifies whether you want the virtual machine to be in a powered off state after the migration.
optional GuestOSCustomization HCXGuestOSCustomization named
  • pipeline
Creates a HCX migration with Guest OS customization options. This enables a user to select certain customization options while migrating a VM or a bunch of VMs based on their use case. This option is available only for Bulk migration profile.
optional MigrateCustomAttributes Boolean named
Specifies whether you want to migrate the custom attributes of the virtual machine undergoing migration
optional MigrationType MigrationType named
Specifies the type of migration that you want to perform.
optional NetworkMapping HCXNetworkMapping[] named
Specifies the source and destination networks you want to use.
optional ProgressAction ActionPreference named
optional RemoveISOs Boolean named
Specifies whether you want to remove the ISO files after the migration.
optional RemoveSnapshots Boolean named
Specifies whether you want to remove the snapshots after the migration.
optional ReplicateSecurityTags Boolean named
Specifies whether you want to replicate the security tags after the migration.
optional RetainMac Boolean named
Specifies whether you want to retain the MAC address after the migration.
optional ScheduleEndTime DateTime named
Specifies the end time of the schedule window in case of bulk migration.
optional ScheduleStartTime DateTime named
Specifies the start time of the schedule window in case of bulk migration.
optional Server HcxServer[] named
Specifies the HCX Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-HCXServer cmdlet.
optional TargetComputeContainer HCXComputeContainer named
  • pipeline
Specifies the container on the destination site. If you want to retrieve the container, run Get-HCXContainer -Type ComputeContainer -Site $DestinationSite -Name "Container name".
optional TargetDatastore HCXDatastore named
  • pipeline
Specifies the datastore on the destination site. If you want to retrieve the datastore, run Get-HCXDatastore -Site $DestinationSite -Name "datastore name".
optional TargetStorageProfile HCXStorageProfile named
  • pipeline
Specifies the storage profile at the destination site that you want to use.
optional UpgradeHardware Boolean named
Specifies whether you want to upgrade the hardware after the migration.
optional UpgradeVMTools Boolean named
Specifies whether you want to upgrade the VM tools after the migration.
optional memory Int32 named
Specifies that you should use OSAM to override the memory setting of the migrated virtual machine. The unit is MB.
optional vcpus Int32 named
Specifies that you should use OSAM to override the vCPU setting of the migrated virtual machine.

Output

VMware.VimAutomation.Hcx.Types.V1.HCXMigration

Examples

Example 1

New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType vMotion

Creates a vMotion migration request object.

Example 2

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

New-HCXMigration -SourceSite $source -DestinationSite $dest -VM $vm -NetworkMapping $myNetworkMapping -TargetDatastore $Storage -TargetComputeContainer $Container  -MigrationType Cold

Creates a cold migration request object.

Example 4

$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.

Example 5

New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType RAV

Creates a RAV migration request object.

Example 6

New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType OsAssistedMigration

Creates an OSAssisted migration request object.

Example 7

New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType Bulk -GuestOSCustomization HCXGuestOSCustomization

Creates a bulk migration request object with GuestOS customization object.

Related Commands

HCXMigration

This cmdlet retrieves the list of HCX migrations.

This cmdlet creates an HCX migration request.

This cmdlet modifies the HCX migrations.

This cmdlet starts the HCX migrations.

This cmdlet validates an HCX migration request.