Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-unique site names #18098

Open
jakosp opened this issue Nov 25, 2024 · 3 comments
Open

Allow non-unique site names #18098

jakosp opened this issue Nov 25, 2024 · 3 comments
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement status: backlog Awaiting selection for work type: feature Introduction of new functionality to the application

Comments

@jakosp
Copy link

jakosp commented Nov 25, 2024

NetBox version

v.4.1.6

Feature type

Change to existing functionality

Triage priority

N/A

Proposed functionality

Remove the uniqueness constraint on Site and Location names, so that multiple objects can be created with the same name.

Use case

When managing numerous branches (within Netbox), it is common for these branches to lack distinct names and are often identified solely by their location. The naming convention typically follows a pattern such as "Main Road 1," which is not akin to traditional and unique branch identifiers like "Branch A" or "Branch B."

The primary issue - in this case -arises from the high likelihood of branches sharing identical names. Here, branches are only distinguishable by the city (i.e., their region) they are located in. For instance:

  • Country A (Region)
    • City A (Region)

      • Branch Main Road 1 (Site)
      • Branch Plaza 3 (Site)
    • City B (Region)

      • Branch Main Road 1 (Site)

This naming limitation seems unnescessary as sites can be uniquely identified based on their hierarchical structure, or their Facility ID, if present.
It would completely suffice if the site would need to have a unique name within the scope of its parent.

This problem is somewhat related to issue #2669.

Database changes

It should suffice to remove the unique=True field in the site data model.

External dependencies

None

@jakosp jakosp added status: needs triage This issue is awaiting triage by a maintainer type: feature Introduction of new functionality to the application labels Nov 25, 2024
@tyler-8
Copy link
Contributor

tyler-8 commented Dec 6, 2024

On the flip side, in many environments it is critical that site names are unique. If this feature were to be accepted, I would hope to see some kind of scoping added along side it, or maybe just a global configuration setting, similar to the setting that exists for globally unique IP objects.

@jakosp
Copy link
Author

jakosp commented Dec 8, 2024

While enforcing unique site names is a useful safeguard, applying this rule across the board can result in restrictions.
Instead, making site names unique within their specific hierarchy would allow NetBox to support such cases.

Ultimately, the decision should be left to the user to determine what works best for their specific situation. NetBox's structure should be flexible enough to represent their network without unnecessary restrictions. Safeguards are important, but there should be an option to disable them when needed and not technically required.

I believe that a tool like NetBox should enable its users and not unnecessarily restrict them. But please correct me here if I misunderstood something.

I support the idea of making this behavior configurable. This would prevent issues in environments where this restriction wasn't originally considered, while still allowing it to be enabled for those who need it.

Even with this change, sites would still have unique paths, such as:
/Country_A/City_A/Branch_Office and /Country_A/City_B/Branch_Office
This ensures that sites remain uniquely identifiable.

Trying to create another site with the same name and the same path should still be prevented, since this would only lead to problems.

Again, please correct me if I misunderstood something 😅

@rboucher-me rboucher-me added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation complexity: medium Requires a substantial but not unusual amount of effort to implement and removed status: needs triage This issue is awaiting triage by a maintainer labels Feb 13, 2025
@arthanson
Copy link
Collaborator

This would also break bulk import with natural keys unless it is changed to support the hierarchy as well.

@rboucher-me rboucher-me added the needs milestone Awaiting prioritization for inclusion with a future NetBox release label Feb 13, 2025
@jeremystretch jeremystretch added status: backlog Awaiting selection for work and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Feb 14, 2025
@rboucher-me rboucher-me removed the needs milestone Awaiting prioritization for inclusion with a future NetBox release label Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement status: backlog Awaiting selection for work type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

5 participants