netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Allow non-unique VLAN names within a VLAN group

Open CoolSilver opened this issue 8 years ago • 5 comments

Issue type

[x] Feature request [ ] Bug report [ ] Documentation

Environment

  • Python version: 3.5.1.3
  • NetBox version: 2.2.8

Description

It would be nice to have multiple vlans in a particular vlan group with the same name. Currently you can have the same name on multiple vlans as long as they are either not assigned to a vlan group or different groups. This would be good for the same customer and application who have multiple vlans on different IP segments.

Taking two vlans named the same, assigning to the same vlan group gives the following message about unique ids

Duplicate key value violates unique constraint "ipam_vlan_group_id_name__uniq" Detail: Key (group_id, name) = (5, vlan-name) already exists

Can this relationship be tied to the vlan itself since there is already a constraint on one per vlan number per group?

CoolSilver avatar Jan 17 '18 19:01 CoolSilver

I can see use cases both for and against the unique constraint imposed on the VLAN name. Leaving this open for feedback.

jeremystretch avatar Jan 30 '18 18:01 jeremystretch

I have come across this before myself. Really it comes down to use case. As @jeremystretch has pointed out, it is easy to see it both ways but the current constraint does make NetBox opinionated as to the intended use case. That being said, I worked around it in other ways (not related to the use case explained above). The only danger I see is if two vlans are created without assigning a prefix, it would be hard to differentiate them in the UI.

lampwins avatar Feb 05 '18 17:02 lampwins

True it would be difficult if there were named the same and the same vlan id. The only difference would be the group name as a difference which works.

In my example there are two different vlan ids with the same name. Each exists without any group without conflict. Only when adding to same group. They are still forced unique by the vlan id per group.

Not every vlan would have a prefix as some could be layer 2 only between sites or devices etc

CoolSilver avatar Feb 05 '18 20:02 CoolSilver

This doesn't seem to have gotten any traction, and I think the constraint we have in place now is the less-surprising approach.

jeremystretch avatar Apr 03 '18 17:04 jeremystretch

Hey guys,

I ran into this issue as well when porting an existing VLAN administration from mediawiki (yeah, I know) to netbox. A large number of VLANs have a reservation status and a generic name. So lots of duplicates. I could potentially include the VLAN ID in the name but it feels a bit clunky.

I'm running netbox v2.4.8.

@jeremystretch Could you please consider re-opening this case?

swerveshot avatar Dec 04 '18 08:12 swerveshot