HCX - Error during Update to Existing Network Extension Segments
search cancel

HCX - Error during Update to Existing Network Extension Segments

book

Article ID: 321597

calendar_today

Updated On:

Products

VMware HCX

Issue/Introduction

This document has been created as a reference to HCX Network Extension Duplicate Key error and how to recover that.


For HCX Network Extension (NE) services, attempt to extend an existing extended segment to another site/cloud post modification in the extended segment name using NSX-T manager may led to the Duplicate Key error.
As a result, The old extended segment name will remain visible in the HCX Network Extension UI without any change.

Below logs can be seen in the HCX system:

App-engine logs:

HCX Manager : /common/logs/admin/app.log

2023-02-08 10:49:40.430 UTC [NSXService_SvcThread-1364, Ent: HybridityAdmin, , TxId: ########-####-####-####-########9f1b] ERROR c.v.v.h.a.postgresdb.PostgresAdapter- Error Updating query {"collection":"NsxtLogicalSwitch","keys":["id","nsxUuid"],"rows":[{"switch_type":"DEFAULT","transport_zone_id":"########-####-####-####-########44ab",
<snip>
,"resource_type":"LogicalSwitch","id":"########-####-####-####-########c81a","display_name":"NdvS_DMZ_PRE_EPRES_VIRT_GDC_65632","tags":[{"scope":"2081","tag":"VLAN"},{"scope":"policyPath","tag":"\/infra\/segments\/NdvS_GDC_PRE_OK_over2081"},{"scope":"subnet-cidr","tag":"172.25.172.128\/25"}],"_create_user":"nsx_policy","_create_time":1585815935162,"_last_modified_user":"nsx_policy","_last_modified_time":1673353347274,"_system_owned":false,"_protection":"REQUIRE_OVERRIDE","_revision":9,"_schema":"\/v1\/schema\/
<snip>


PostgresDB log:

HCX Manager : /common/logs/postgres/postgresql<date>.log

2023-02-08 08:39:57.394 GMT [8551] STATEMENT:  INSERT INTO "NsxtSegment"(val) VALUES (to_jsonb($1::jsonb))
2023-02-08 08:39:57.414 GMT [8551] ERROR:  duplicate key value violates unique constraint "NsxtSegment_path_1"
2023-02-08 08:39:57.414 GMT [8551] DETAIL:  Key ((val ->> 'path'::text))=(/infra/segments/NdvS_GDC_PRE_OK_over2081) already exists.



Cause

HCX Manager maintains the UUID for active NSX-T Manager running in 3-Node Cluster.
If active NSX-T manager go offline due to some reason, another NSX-T manager within the cluster will take over the active role. As a result, HCX Manager also updates the UUID for the newly active NSX-T manager in its record.

When a subsequent change is made via NSX-T manager to an extended segment that was already created using previous NSX UUID in the HCX record, NSXService error related to Duplicate Key may be experienced.

Resolution

None.

Workaround:
As a potential WA, the suggestion is to delete segment from NSX-T manager and then recreate it.
In case that doesn't help, Please open Service Request with VMware support team for further assistance.

Additional Information

Impact/Risks:
  • Modifications in the extended segment name via NSX-T manager won't be reflected.
  • Existing Network Extension should continue to operate normally.
  • New Network Extension should be serviced.
  • Migration services won't be affected.