How to restore DVPortgroups that HCX depends on for target L2E network stretch
search cancel

How to restore DVPortgroups that HCX depends on for target L2E network stretch

book

Article ID: 316648

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

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.

Cause

This issue is caused by either intentionally or unintentionally removing or deleting the vSphere DVPortgroup which serves as the underlay networking for HCX created logical-switches/ segments.

Resolution

From the NSX-V Logical-Switches menu, identify which LS correlates to the HCX L2E stretch and confirm if it is "Out of sync".  Note the LS virtualwire ID.

Use the following NSX REST API to resolve the LS backing issues:

POST /api/2.0/vdn/virtualwires/{virtualWireID}/backing?action=remediate

This should trigger NSX-V to post communication to vSphere to create a DVPortgroup to serve as backing for the LS.  

Additional Information

Impact/Risks:
The specific circumstances that lead to this error and issue will block all subsequent L2E re-stretching of the same source L2 segment via HCX.