VLAN filtering with VLAN groups #8654

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

Originally created by @CTV-2023 on GitHub (Sep 21, 2023).

Originally assigned to: @DanSheps on GitHub.

NetBox version

v3.6.2

Python version

3.8

Steps to Reproduce

I have vlans associated to a vlan group. This vlan group scope is a site group. Sites A and B are member of this site group
When I create a new prefix associated to site A, I expect vlans from the vlan group to appear. They don't

On demo website :

  • Create a vlan group "Test-Group", scope type DCIM > site group. Choose a site group, Headquarters for instance
    image

  • Create a vlan and associate it with this vlan group
    image

  • Associate a site to the Headquarters site group, or select one already in it
    image

  • Try to create a prefix with this site. You won't see the vlan
    image

Expected Behavior

When you define a vlan group with site group as a scope, you expect its site members to "inherit" the vlan. I think this part is ok, but you can't select the vlan in prefix creation

Observed Behavior

The vlan is not visible in prefix creation, maybe due to #13721

As a side note, the vlan appears in 802.1q swiching in interfaces for a device member of the site DM-NYC
image

Originally created by @CTV-2023 on GitHub (Sep 21, 2023). Originally assigned to: @DanSheps on GitHub. ### NetBox version v3.6.2 ### Python version 3.8 ### Steps to Reproduce I have vlans associated to a vlan group. This vlan group scope is a site group. Sites A and B are member of this site group When I create a new prefix associated to site A, I expect vlans from the vlan group to appear. They don't On demo website : - Create a vlan group "Test-Group", scope type DCIM > site group. Choose a site group, Headquarters for instance ![image](https://github.com/netbox-community/netbox/assets/64533932/02626fe0-d508-4d27-84c3-748ed8614380) - Create a vlan and associate it with this vlan group ![image](https://github.com/netbox-community/netbox/assets/64533932/d778065e-7ecc-48ee-85de-5c5b8839d54b) - Associate a site to the Headquarters site group, or select one already in it ![image](https://github.com/netbox-community/netbox/assets/64533932/7fd5ef34-5453-4c08-8f4d-c2cdab3a9d0d) - Try to create a prefix with this site. You won't see the vlan ![image](https://github.com/netbox-community/netbox/assets/64533932/e763fc0f-4d14-45a6-9cd6-6db61863560a) ### Expected Behavior When you define a vlan group with site group as a scope, you expect its site members to "inherit" the vlan. I think this part is ok, but you can't select the vlan in prefix creation ### Observed Behavior The vlan is not visible in prefix creation, maybe due to #13721 As a side note, the vlan appears in 802.1q swiching in interfaces for a device member of the site DM-NYC ![image](https://github.com/netbox-community/netbox/assets/64533932/470eb588-7d6c-410d-a26e-bfac02d52223)
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:39:26 +01:00
adam closed this issue 2025-12-29 20:39:26 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 21, 2023):

I think you're correct in calling this out as a side effect of #13721, however I'm not sure it's a bug. The VLAN field is being filtered by a specific site, to which the desired VLAN is not assigned. This is desired behavior under the condition captured in #13721, but under the condition captured here (where the intent is to infer site assignment via the site group).

Maybe the best solution would be to introduce a separate filter e.g. available_at_site (similar to available_on_device) to filter VLANs according to both site and site group assignments.

As a workaround, you can still use the selector button to the right of the field to select any VLAN, regardless of the selected site.

@jeremystretch commented on GitHub (Sep 21, 2023): I think you're correct in calling this out as a side effect of #13721, however I'm not sure it's a bug. The VLAN field is being filtered by a specific site, to which the desired VLAN is not assigned. This is desired behavior under the condition captured in #13721, but under the condition captured here (where the intent is to infer site assignment via the site group). Maybe the best solution would be to introduce a separate filter e.g. `available_at_site` (similar to `available_on_device`) to filter VLANs according to both site and site group assignments. As a workaround, you can still use the selector button to the right of the field to select any VLAN, regardless of the selected site.
Author
Owner

@bandwiches commented on GitHub (Sep 29, 2023):

Is there a workaround for v3.3.8? I see the same behavior when editing a site prefix where the vlan group is not populating based on the scope unless the vlan group is it's directly scoped to the site itself (not the region or anything else). The selector button does not appear in 3.3.8 as far as I can tell.

@bandwiches commented on GitHub (Sep 29, 2023): Is there a workaround for v3.3.8? I see the same behavior when editing a site prefix where the vlan group is not populating based on the scope unless the vlan group is it's directly scoped to the site itself (not the region or anything else). The selector button does not appear in 3.3.8 as far as I can tell.
Author
Owner

@DanSheps commented on GitHub (Dec 15, 2023):

Blocked by #14538

@DanSheps commented on GitHub (Dec 15, 2023): Blocked by #14538
Author
Owner

@jeremystretch commented on GitHub (Dec 21, 2023):

Unblocking as #14538 has been completed

@jeremystretch commented on GitHub (Dec 21, 2023): Unblocking as #14538 has been completed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8654