Remove unique constraint from L2VPN identifier #6819

Closed
opened 2025-12-29 19:45:45 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Aug 16, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3-beta2

Feature type

Change to existing functionality

Proposed functionality

Remove the unique constraint from the "Identifier" field in the L2VPN data model.

Use case

When building pseudowires, I need to record the pseudowire id (pw-id), and ideally I would use the L2VPN "identifier" attribute for this. However in our network these are not globally unique: using a pw-id of 1000 between devices A and B, I could also use pw-id of 1000 for a different pseudowire between devices A and C, or C and D.

Even in some orgs which choose to keep them unique within a particular scope (site or tenant, say) they may re-use them in another scope.

Netbox already requires that every L2VPN have a unique "name", so there is no scope for confusion between two L2VPNs with the same identifier.

Workaround: add a custom field for pw-id.

Database changes

Removal of constraint

External dependencies

None

Originally created by @candlerb on GitHub (Aug 16, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3-beta2 ### Feature type Change to existing functionality ### Proposed functionality Remove the unique constraint from the "Identifier" field in the L2VPN data model. ### Use case When building pseudowires, I need to record the pseudowire id (pw-id), and ideally I would use the L2VPN "identifier" attribute for this. However in our network these are not globally unique: using a pw-id of 1000 between devices A and B, I could also use pw-id of 1000 for a different pseudowire between devices A and C, or C and D. Even in some orgs which choose to keep them unique within a particular scope (site or tenant, say) they may re-use them in another scope. Netbox already requires that every L2VPN have a unique "name", so there is no scope for confusion between two L2VPNs with the same identifier. Workaround: add a custom field for pw-id. ### Database changes Removal of constraint ### External dependencies None
adam added the status: acceptedtype: featurebeta labels 2025-12-29 19:45:45 +01:00
adam closed this issue 2025-12-29 19:45:45 +01:00
Author
Owner

@candlerb commented on GitHub (Aug 16, 2022):

Ref discussion: https://github.com/netbox-community/netbox/discussions/9727#discussioncomment-3409332

@candlerb commented on GitHub (Aug 16, 2022): Ref discussion: https://github.com/netbox-community/netbox/discussions/9727#discussioncomment-3409332
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6819