Error while saving NSX cloud configuration in Avi: "Unique constraints 'tier1_lr_id' has duplicated value"
search cancel

Error while saving NSX cloud configuration in Avi: "Unique constraints 'tier1_lr_id' has duplicated value"

book

Article ID: 403532

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

When saving the NSX-T cloud configuration in the Avi load balancer, you may encounter an error indicating a duplicate value for a Tier-1 logical router.

The error message will appear similar to this:

Error in updating cloud nsxt-t: {'nsxt_configuration': ... 'tier1_lrs': FieldValueError("Field check for tier1_lrs failed : Unique constraints 'tier1_lr_id' has duplicated value: ('/infra/tier-1s/your-t1-router',)")}

This error prevents the NSX-T cloud configuration from being saved successfully.

Environment

VMware NSX-T

Cause

This issue is caused by attempting to configure more than one data network segment for a single Tier-1 logical router within the NSX-T cloud connector in Avi.

The system enforces a constraint that allows only one data segment to be explicitly defined per Tier-1 router in this section.

Reference KB: https://techdocs.broadcom.com/us/en/vmware-security-load-balancing/avi-load-balancer/avi-load-balancer/30-2/vmware-avi-load-balancer-installation-guide/installing-nsx-alb-in-vmware-nsx-t-environments/nsx-t-design-guide-for-avi-vantage.html 

Resolution

Resolution:

To resolve this error, you must correct the data network configuration: Navigate to the Data Networks section of your NSX-T cloud configuration in the Avi UI. Identify the Tier-1 logical router that is duplicated and delete the extra entry, ensuring only one data segment is assigned to that specific Tier-1 router.

Workaround:

  • If your goal is to place a Virtual Service VIP on a different data segment (which is also connected to the same Tier-1 router), you do not need to define it in the NSX cloud connector's 'Data Networks' section.
  • Instead, when creating the Virtual Service, simply assign it a static IP address from the desired subnet.
  • This network subnet/segment should be connected to the same Tier 1 that is configured in the cloud connector.
  • Avi will automatically program a static route for this VIP on the NSX Tier-1 router.
  • This ensures the necessary reachability for the Virtual Service to function correctly without violating the configuration constraints.