Create one or more VM groups and add VM instance UUIDs to each group. By creating VM groups, you can do your workload migration in batches involving a set of VMs.
You must create VM Groups only when the DFW rules in your NSX-V environment use Security Groups with dynamic memberships based on Security Tags or use static memberships. When only IP-based DFW rules are used in your NSX-V environment, VM Groups are not required before migrating the workload VMs to NSX.
Note: Steps 2, 3, and 4 below require that you have NSX 3.2.2 or later installed.
- Make the following API call:
POST https://{nsxt-mgr-ip}/api/v1/migration/vmgroup?action=pre_migrate
This API creates a logical segment port (VIF) corresponding to the VM instance UUID of each NSX-V workload VM in the VM group that you will be migrating through the Layer 2 bridge to the NSX overlay segment. For an example request body of this API, see the Lift and Shift Migration Process section of the NSX Tech Zone article.
- Call the API
GetVmGroupExecutionDetails
to get the result of the pre-migrate API call with the same group_id (and federation_site_id for cross-VC migration). The result includes a "logical_switch_id_to_vm_instance_id_and_vnics_map" list and an optional "failedVmInstanceIds" list, which includes the UUIDs of VMs that are not found in the source VC. For example:GET /api/v1/migration/vmgroup/actions/get_vm_group_execution_details?group_id=<group-id>&federation_site_id=<site_id> Response: { "logical_switch_id_to_vm_instance_id_and_vnics_map":[ { "ls_id":"36885723-7581-4696-a195-ef83851dc35f", "vm_and_vnics_mapping":[ { "vm_instance_id":"52199e21-6aab-26e4-8c82-069a17d67667", "vnics":[ "4001" ] }, { "vm_instance_id":"52630e5d-ce6f-fac0-424c-4aa4bdf6bd56", "vnics":[ "4001" ] } ] } ], "failedVmInstanceIds":[ "501557f6-2197-1fe8-14e5-89898cee5fec" ] }
- Construct a map of
vmInstanceUuid to (vnic, ls_id)
fromlogical_switch_id_to_vm_instance_id_and_vnics_map
. - Use the map to populate the relocate spec of each VM and migrate the VMs.
You can obtain the VM instance UUIDs from the VMware vCenter Managed Object Browser (MOB) at http://{vCenter-IP-Address}/mob, or run API requests to vSphere.
See the example in this topic to understand the steps for finding the VM instance UUIDs from the VMware vCenter MOB.
Example: Obtain VM Instance UUID from the vCenter MOB
- In a web browser, enter the vCenter Managed Object Browser at http//{vCenter-IP-Address}/mob.
- Click content.
- Find rootFolder in the Name column, and click the corresponding link in the Value column. For example, group-d1.
- Find childEntity in the Name column, and click the corresponding link in the Value column. For example, datacenter-21.
- Find hostFolder in the Name column, and click the corresponding link in the Value column. For example, group-h23.
- Find childEntity in the Name column. The corresponding Value column contains links to host clusters. Click the appropriate host cluster link. For example, domain-c33.
- Find host in the Name column. The corresponding Value column lists the hosts in that cluster by vCenter MOID and hostname. Click the appropriate host link, For example, host-32.
- Find vm in the Name column. The corresponding Value column lists the virtual machines by vCenter MOID and hostname. For example, vm-216 (web-01a). Click the VM that you are interested in.
- Find config in the Name column. Click config in the Value column.
- Find instanceUuid in the Name column. The corresponding Value column lists the VM instance UUID. For example, 502e71fa-1a00-759b-e40f-ce778e915f16.