VLAN attribute Site Group not saved #5773

Closed
opened 2025-12-29 19:32:32 +01:00 by adam · 7 comments
Owner

Originally created by @jhammond-git on GitHub (Dec 15, 2021).

NetBox version

v3.1.0

Python version

3.8

Steps to Reproduce

  1. Create a Site Group
  2. Create a VLAN Group, scope type "site group", Site group set to the group created in 1.
  3. Create a VLAN and assign it to Group Scope of "site group", and VLAN Group of the group created in 2.
  4. Navigate to /ipam/vlans/ and click the Filter tab. Add a filter for the site group created in 1.

Expected Behavior

The filtered list will be the VLAN created in 3.

Observed Behavior

Nothing shows up as "Site Group" doesn't seem to be a retained attribute of a VLAN.

Originally created by @jhammond-git on GitHub (Dec 15, 2021). ### NetBox version v3.1.0 ### Python version 3.8 ### Steps to Reproduce 1. Create a Site Group 2. Create a VLAN Group, scope type "site group", Site group set to the group created in 1. 3. Create a VLAN and assign it to Group Scope of "site group", and VLAN Group of the group created in 2. 4. Navigate to /ipam/vlans/ and click the Filter tab. Add a filter for the site group created in 1. ### Expected Behavior The filtered list will be the VLAN created in 3. ### Observed Behavior Nothing shows up as "Site Group" doesn't seem to be a retained attribute of a VLAN.
adam added the type: bug label 2025-12-29 19:32:32 +01:00
adam closed this issue 2025-12-29 19:32:33 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 15, 2021):

Ah, I see the confusion. The site_group filter on the VLAN filterset filters on the group of the site to which a VLAN is assigned. Basically, there are two possible relations:

  • VLAN -> site -> site group
  • VLAN -> VLAN group -> site group

The site_group filter matches on the former, which predates support for scoped VLAN groups. We should not alter this as doing so would be a breaking change to the API.

We could introduce a set of new filters to filter by VLAN group scope, but I'm not sure what those would look like.

@jeremystretch commented on GitHub (Dec 15, 2021): Ah, I see the confusion. The `site_group` filter on the VLAN filterset filters on the group of the _site_ to which a VLAN is assigned. Basically, there are two possible relations: * VLAN -> site -> site group * VLAN -> VLAN group -> site group The `site_group` filter matches on the former, which predates support for scoped VLAN groups. We should not alter this as doing so would be a breaking change to the API. We could introduce a set of new filters to filter by VLAN group scope, but I'm not sure what those would look like.
Author
Owner

@jhammond-git commented on GitHub (Dec 15, 2021):

Can the filter not be applied as an OR and grab both sets of data? I'm sorry I'm not familiar with the back end.

@jhammond-git commented on GitHub (Dec 15, 2021): Can the filter not be applied as an OR and grab both sets of data? I'm sorry I'm not familiar with the back end.
Author
Owner

@jeremystretch commented on GitHub (Dec 15, 2021):

I'm pretty sure it's feasible, but I'm hesitant to do so because it may lead to undesired or surprising behavior. It's probably best to introduce a separate filter. We'd likely want the ability to filter by other scope objects too anyway.

@jeremystretch commented on GitHub (Dec 15, 2021): I'm pretty sure it's feasible, but I'm hesitant to do so because it may lead to undesired or surprising behavior. It's probably best to introduce a separate filter. We'd likely want the ability to filter by other scope objects too anyway.
Author
Owner

@jhammond-git commented on GitHub (Dec 15, 2021):

"Undesired or Surprising Behavior" is my Motley Crue cover band.

So should this be an FR then instead of a bug, or should they be two separate issues - one to fix "site -> site group" and the other to add "VLAN group -> site group"?

@jhammond-git commented on GitHub (Dec 15, 2021): "Undesired or Surprising Behavior" is my Motley Crue cover band. So should this be an FR then instead of a bug, or should they be two separate issues - one to fix "site -> site group" and the other to add "VLAN group -> site group"?
Author
Owner

@jeremystretch commented on GitHub (Dec 15, 2021):

I think a new FR to enable filtering VLANs by their group's scope makes sense.

@jeremystretch commented on GitHub (Dec 15, 2021): I think a new FR to enable filtering VLANs by their group's scope makes sense.
Author
Owner

@jhammond-git commented on GitHub (Dec 16, 2021):

Sounds good. Thank you.

@jhammond-git commented on GitHub (Dec 16, 2021): Sounds good. Thank you.
Author
Owner

@jhammond-git commented on GitHub (Dec 16, 2021):

https://github.com/netbox-community/netbox/issues/8085

@jhammond-git commented on GitHub (Dec 16, 2021): https://github.com/netbox-community/netbox/issues/8085
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5773