HCXMigration Category | Vmware PowerCLI Reference

HCX Migration Category

Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations

Step 1: Retrieve a object by running a Get command

You can READ objects by using Get-HCXMigration cmdlet. See example below:

# Retrieves 10 HCX migrations where username is abc, state is failed, migration type is bulk, and entityId is vm-101.

Get-HCXMigration -NumberOfMigration 10 -Username abc -State MIGRATE_FAILED -MigrationType Bulk -EntityId vm-101

Step 2 : Run commands from the CRUD group

You can CREATE objects by using New-HCXMigration cmdlet. See example below:

# Creates a vMotion migration request object.

New-HCXMigration -SourceSite $source -DestinationSite $destination -NetworkMapping $myNetworkMapping -TargetDatastore $datastore -TargetComputeContainer $container -VM $vm -MigrationType vMotion
You can UPDATE objects by using Set-HCXMigration cmdlet. See example below:

# Modifies the schedule start time and schedule end time for the given migration. You can use the cmdlet in case of bulk migration.

Set-HCXMigration -ScheduleStartTime '01/18/2019 3:57 PM' -ScheduleEndTime '01/18/2019 4:57 PM' -Migration $migration

Step 3: Explore More Related Commands:


Start-HCXMigration This cmdlet starts the HCX migrations.
Test-HCXMigration This cmdlet validates an HCX migration request.