VLAN Groups show "0 VLANS Available" following a range if the last VLAN in the range exists #11551

Closed
opened 2025-12-29 21:46:40 +01:00 by adam · 2 comments
Owner

Originally created by @aq5747 on GitHub (Aug 31, 2025).

Originally assigned to: @aq5747 on GitHub.

Deployment Type

NetBox Cloud

NetBox Version

v4.3.7

Python Version

3.10

Steps to Reproduce

  1. Add a new VLAN Group with one or more child VLAN ID ranges (something like "5-6,10-20,30-35" or "1-4094")
  2. Add one or more VLANs that corresponds to the last VLAN ID in one or more of those ranges. Make sure that they are assigned to that new VLAN Group. So for "5-6,10-20,30-35" add VLANs 6, 20, 35, for "1-4094" add 4094, etc.
  3. Open the VLAN Group, go to the VLANs tab. Notice that NetBox shows "0 VLANs available" after the last defined VLAN in those ranges.

Expected Behavior

NetBox should only display "x VLANs Available" if there is at least 1 or more availble VLANs ID at the end a range, matching the behavior with IP addresses in a prefix.

Observed Behavior

The VLANs table in the VLAN Group contains an entry that displays "0 VLANs available" at the end of a range if the last VLAN in the range exists. While this is technically true, this can be confusing for a user -- at a quick glance a user may believe there is room for another VLAN, when in actuality this is not true. Furthermore, if the user clicks the "0 VLANs available" button, NetBox will try to add the next VLAN sequentially, which falls outside of the VLAN range. If the user then tries to save this page then they will get an error that this VLAN is outside of the range.

Here I created a VLAN Group with range of "5,10,15,20,25" and created and associated the five VLANs:

Image
Originally created by @aq5747 on GitHub (Aug 31, 2025). Originally assigned to: @aq5747 on GitHub. ### Deployment Type NetBox Cloud ### NetBox Version v4.3.7 ### Python Version 3.10 ### Steps to Reproduce 1. Add a new VLAN Group with one or more child VLAN ID ranges (something like "5-6,10-20,30-35" or "1-4094") 2. Add one or more VLANs that corresponds to the last VLAN ID in one or more of those ranges. Make sure that they are assigned to that new VLAN Group. So for "5-6,10-20,30-35" add VLANs 6, 20, 35, for "1-4094" add 4094, etc. 3. Open the VLAN Group, go to the VLANs tab. Notice that NetBox shows "0 VLANs available" after the last defined VLAN in those ranges. ### Expected Behavior NetBox should only display "x VLANs Available" if there is at least 1 or more availble VLANs ID at the end a range, matching the behavior with IP addresses in a prefix. ### Observed Behavior The VLANs table in the VLAN Group contains an entry that displays "0 VLANs available" at the end of a range if the last VLAN in the range exists. While this is technically true, this can be confusing for a user -- at a quick glance a user may believe there is room for another VLAN, when in actuality this is not true. Furthermore, if the user clicks the "0 VLANs available" button, NetBox will try to add the next VLAN sequentially, which falls outside of the VLAN range. If the user then tries to save this page then they will get an error that this VLAN is outside of the range. Here I created a VLAN Group with range of "5,10,15,20,25" and created and associated the five VLANs: <img width="1617" height="780" alt="Image" src="https://github.com/user-attachments/assets/66356366-33c3-49cf-99c2-48c66fcf9c12" />
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:46:40 +01:00
adam closed this issue 2025-12-29 21:46:40 +01:00
Author
Owner

@aq5747 commented on GitHub (Aug 31, 2025):

I think this should be a simple fix. I'd like to take a stab at it if possible.

@aq5747 commented on GitHub (Aug 31, 2025): I think this should be a simple fix. I'd like to take a stab at it if possible.
Author
Owner

@jnovinger commented on GitHub (Sep 2, 2025):

Thanks, @aq5747 !

@jnovinger commented on GitHub (Sep 2, 2025): Thanks, @aq5747 !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11551