NSX-T Data Center REST API
Associated URIs:
API Description | API Path |
---|---|
Perform steps required before migrating a VM group.For each VM group, the following three high level steps are performed in sequence. 1. Call pre VM group migrate API. 2. Migrate (by vmotion,in place, etc.,) VMs in the VM group. This step will be done by user independent of MC. 3. Call post VM group migrate API with the same VM group id used in the pre VM group migrate API. This API specifically deals with pre VM group migrate API. When pre VM group migrate API is invoked for a VM group id, MC performs following actions. - Checks segmentation realization state. - Creates segment ports. - Creates temporary security groups. |
POST /api/v1/migration/vmgroup?action=pre_migrate
|
Perform steps required after migrating a VM group.For each VM group, the following three high level steps are performed in sequence. 1. Call pre VM group migrate API. 2. Migrate (by vmotion,in place, etc.,) VMs in the VM group. This step will be done by user independent of MC. 3. Call post VM group migrate API with the same VM group id used in the pre VM group migrate API. This API specifically deals with post VM group migrate API. When post VM group migrate API is invoked for a VM group id, MC performs following actions. - Add security tags on the VMs migrated. For the VMs mentioned in the failed VM instance uuids, this operation is skipped. |
POST /api/v1/migration/vmgroup?action=post_migrate
|
Retreives the VM Group Execution DetailsThe 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. Construct a map of vmInstanceUuid to (vnic, ls_id) from the "logical_switch_id_to_vm_instance_id_and_vnics_map", then use the map to populate the relocate spec of each VM and migrate the VM as below: The VM object can be found in source VC by the vmInstanceUuid using VC API serviceinstance.content.searchIndex.FindByUuid(uuid=vmInstanceUuid, vmSearch=True, instanceUuid=True) For each VM vNIC, if the device key "vnic" is not found in the map of vmInstanceUuid to (vnic, ls_id), then skip the vNIC. Otherwise form a VIF-id for the vNIC by vmInstanceUuid + ':' + str(vnic), e.g. "52630e5d-ce6f-fac0-424c-4aa4bdf6bd56:4001", and use it to setup the vNIC's network backing. For VDS6.x migration, opaque-network backing in NVDS will be used; setup the vNIC device as below: - vdevice.backing = vim.vm.device.VirtualEthernetCard.OpaqueNetworkBackingInfo() - vdevice.backing.opaqueNetworkId = ls_id - vdevice.backing.opaqueNetworkType = 'nsx.LogicalSwitch' - vdevice.externalId = VIF-id For VDS 7.0 and later versions, "nsx" LogicalSwitch backing in VDS will be used. Go through all VDS DVPGs in the target VC to find each DVPG whose config.backingType is "nsx" and config.logicalSwitchUuid is not blank, build a map of dvpg.config.logicalSwitchUuid to [dvpg.key, dvpg.config.distributedVirtualSwitch.uuid] once. For each vNIC device, get the dvpg value from the map by the ls_id and then set it up as below: - vdsPgConn = vim.dvs.PortConnection() - vdsPgConn.portgroupKey = dvpg.key - vdsPgConn.switchUuid = dvpg.config.distributedVirtualSwitch.uuid - vdevice.backing = vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo() - vdevice.backing.port = vdsPgConn - vdevice.externalId = VIF-id |
GET /api/v1/migration/vmgroup/actions/get_vm_group_execution_details
|