Outline the procedure to restore vSphere DVPortgroups which NSX and HCX rely on for HCX L2E extension on the target side of the network stretch.
Symptoms:
With VMware HCX when an L2 network stretch is configured and then later un-stretched, the NSX-V/NSX-T logical-switch/ segment remains on the target side of the network stretch by default as does the vSphere DVPortgroup which supports this L2 domain.
When attempting to re-stretch the same source L2 network to the same target site, sometimes the following error message can be seen in the HCX UI:
"The object 'vim.dvs.DistributedVirtualPortroup:dvportgroup-XXX' has already been deleted or has not been completely created."
From the HCX Connector app.log file, you will see the same error along with the following:
"Received a Failed Job, jobType: NetworkStretchJobs workflow type: prepareCloudNetwork"
From the HCX Cloud app.log file, you will see the following message:
"WARN c.v.v.h.n.i.AbstractJobInt- PrepareVCNetworkJobInt failed in state PROCESS_RESOLVE_NETWORK_BACKING_RESULT. Error: The object 'vim.dvs.DistributedVirtualPortgroup:dvportgroup-XXX' has already been deleted or has not been completely created."
When NSX-V is installed on the target side of the HCX Network Extension, you may notice that NSX logical-switches will have status alerts "Out of sync" for the LS that supports the HCX Network Extension.