Relax naming uniqueness requirements for components on different modules #6310

Closed
opened 2025-12-29 19:39:13 +01:00 by adam · 4 comments
Owner

Originally created by @DanSheps on GitHub (Apr 7, 2022).

NetBox version

3.2.0

Feature type

Change to existing functionality

Proposed functionality

Currently, we have a constraint on (device, name) for a Interface model.

The proposal would be to change this to a more complex constraint where if the name is the same on the same module, or there is no module and the name is the same on the device, then it should error.

Use case

There are certain circumstances where it might be desireable to allow a component to share the same name (management interface in a SSO deployment).

In this case, you have two physical ports to connect, one logical port with the same name in the config.

Database changes

Database constraint change to support a constraint against the module as well as the device, if appropriate.

External dependencies

No response

Originally created by @DanSheps on GitHub (Apr 7, 2022). ### NetBox version 3.2.0 ### Feature type Change to existing functionality ### Proposed functionality Currently, we have a constraint on (device, name) for a Interface model. The proposal would be to change this to a more complex constraint where if the name is the same on the same module, or there is no module and the name is the same on the device, then it should error. ### Use case There are certain circumstances where it might be desireable to allow a component to share the same name (management interface in a SSO deployment). In this case, you have two physical ports to connect, one logical port with the same name in the config. ### Database changes Database constraint change to support a constraint against the module as well as the device, if appropriate. ### External dependencies _No response_
adam added the type: featurepending closure labels 2025-12-29 19:39:13 +01:00
adam closed this issue 2025-12-29 19:39:14 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 8, 2022):

IMO all components of the same type on a device should have unique names regardless of module assignment. They still share a common management plane within the device and need to be addressable uniquely.

@jeremystretch commented on GitHub (Apr 8, 2022): IMO all components of the same type on a device should have unique names regardless of module assignment. They still share a common management plane within the device and need to be addressable uniquely.
Author
Owner

@DanSheps commented on GitHub (Apr 8, 2022):

Not all of them need to be addressable uniquely.

Take for example a Nexus 7700 series chassis, throw in 2 SUP2E's and a M3 blade. The ports on the M3 blade absolutely should be uniquely named, however the MGMT port (MGMT on the physical part, mgmt0 on the sup) is always mgmt0 in the config, no matter which SUP is active and which is standby. However you also have two discrete physical interfaces that need to be cabled separately.

We would also need to look at this in relation to with #7854 as well as mgmt0 is passed through to all VDC's with the same name.

The same can be said with console ports, where you will have 2 console ports between the 2 sups, but you will only ever have con0 in the config.

If you name it mgmt{module} then you get drift on your config from your expected. I suppose you could name it mgmt{module} and then have a mgmt0 parent virtual interface, but that still leaves you with 2 modules that shouldn't be there.

We do do something similar to this with virtual chassis where you only see the 1 interface if it is ticked off with "management only" and has the same name as another interface.

This is a tricky one, which is kind of why I thought relaxing the constraints might be the best way to go and then let the end user decide exactly how they want it modelled in their environment.

@DanSheps commented on GitHub (Apr 8, 2022): Not all of them need to be addressable uniquely. Take for example a Nexus 7700 series chassis, throw in 2 SUP2E's and a M3 blade. The ports on the M3 blade absolutely should be uniquely named, however the MGMT port (MGMT on the physical part, mgmt0 on the sup) is always mgmt0 in the config, no matter which SUP is active and which is standby. However you also have two discrete physical interfaces that need to be cabled separately. We would also need to look at this in relation to with #7854 as well as mgmt0 is passed through to **all** VDC's with the same name. The same can be said with console ports, where you will have 2 console ports between the 2 sups, but you will only ever have con0 in the config. If you name it mgmt{module} then you get drift on your config from your expected. I suppose you could name it mgmt{module} and then have a mgmt0 parent virtual interface, but that still leaves you with 2 modules that shouldn't be there. We do do something similar to this with virtual chassis where you only see the 1 interface if it is ticked off with "management only" and has the same name as another interface. This is a tricky one, which is kind of why I thought relaxing the constraints might be the best way to go and then let the end user decide exactly how they want it modelled in their environment.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 8, 2022):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Jun 8, 2022): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Jul 8, 2022):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Jul 8, 2022): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6310