Prefix cannot be assigned if the site is a member of a sitegroup #6854

Closed
opened 2025-12-29 19:46:05 +01:00 by adam · 3 comments
Owner

Originally created by @heiko-ma on GitHub (Aug 23, 2022).

NetBox version

v3.2.9

Python version

3.10

Steps to Reproduce

  1. Create a VLAN Group (e.g. Global) with no scope filtering (should be usable everywhere)
  2. Create a VLAN and assign it to the created VLAN group
  3. Create a Prefix and assign it to any site which is a member of a sitegroup
  4. Try to assign the Prefix to the created VLAN

Expected Behavior

The VLAN group and the VLAN is selectable as the group has no filtering and should be considered "global".

Observed Behavior

The VLAN group selection returns not results and the only usable VLANs are the ones assigned directly to the site or site group.
image

The interesting thing about this is the following:
When you remove all site and site group assignments and assign the VLAN group and VLAN, the site and site group can be assigned afterwards resulting in the following constillation:
image

Is this a wanted behavior? I believe there is something wrong with the API-Request and there are to many filters so that no result is returned.

I want to provide a little context as why this is a problem:
We have some VLANs we use at every site of ours (e.g. VLAN 10). Instead of creating this vlan for every site, we'd like to create it once and assign all corresponding prefixes to it, resulting in a more structured VLAN database.

Originally created by @heiko-ma on GitHub (Aug 23, 2022). ### NetBox version v3.2.9 ### Python version 3.10 ### Steps to Reproduce 1. Create a VLAN Group (e.g. Global) with no scope filtering (should be usable everywhere) 2. Create a VLAN and assign it to the created VLAN group 3. Create a Prefix and assign it to any site which is a member of a sitegroup 4. Try to assign the Prefix to the created VLAN ### Expected Behavior The VLAN group and the VLAN is selectable as the group has no filtering and should be considered "global". ### Observed Behavior The VLAN group selection returns not results and the only usable VLANs are the ones assigned directly to the site or site group. ![image](https://user-images.githubusercontent.com/64192965/186125500-a9248e7a-d64f-421b-9330-b3097d41e202.png) The interesting thing about this is the following: When you remove all site and site group assignments and assign the VLAN group and VLAN, the site and site group can be assigned afterwards resulting in the following constillation: ![image](https://user-images.githubusercontent.com/64192965/186125411-9724927a-b693-4ec5-85bd-999d29c02214.png) Is this a wanted behavior? I believe there is something wrong with the API-Request and there are to many filters so that no result is returned. I want to provide a little context as why this is a problem: We have some VLANs we use at every site of ours (e.g. VLAN 10). Instead of creating this vlan for every site, we'd like to create it once and assign all corresponding prefixes to it, resulting in a more structured VLAN database.
adam added the type: bugstatus: revisions needed labels 2025-12-29 19:46:05 +01:00
adam closed this issue 2025-12-29 19:46:05 +01:00
Author
Owner

@IdRatherStand commented on GitHub (Aug 23, 2022):

I can't help as to whether this is a bug or not - but we currently assign both a Site + Vlan Group as per your second screenshot, if the ability to do this is removed then this would cause us some headaches (we stretch some L2 between sites and the only way to represent this is in a VLAN group AFAIK)

@IdRatherStand commented on GitHub (Aug 23, 2022): I can't help as to whether this is a bug or not - but we currently assign both a Site + Vlan Group as per your second screenshot, if the ability to do this is removed then this would cause us some headaches (we stretch some L2 between sites and the only way to represent this is in a VLAN group AFAIK)
Author
Owner

@DanSheps commented on GitHub (Aug 23, 2022):

I would call this more of a feature request as currently this would be going against the data model where the prefix and vlan need to be in the same site (a global vlan is not in a single site and should have a prefix reflected as such, if it is really multiple vlans at different sites, it should be modelled as separate vlans) if it operated differently.

Would you be willing to re-open this as such using the feature request template (Should be specific to prefixes, I don't think there are any data model changes needed, depending on what is being done)? Otherwise, please revise your post above to elaborate on why you believe the observed behavior is flawed.

Also, I see this being tangentally related to #10054

@DanSheps commented on GitHub (Aug 23, 2022): I would call this more of a feature request as currently this would be going against the data model where the prefix and vlan need to be in the same site (a global vlan is not in a single site and should have a prefix reflected as such, if it is really multiple vlans at different sites, it should be modelled as separate vlans) if it operated differently. Would you be willing to re-open this as such using the [feature request template](https://github.com/netbox-community/netbox/issues/new?template=feature_request.md) (Should be specific to prefixes, I don't think there are any data model changes needed, depending on what is being done)? Otherwise, please revise your post above to elaborate on why you believe the observed behavior is flawed. Also, I see this being tangentally related to #10054
Author
Owner

@heiko-ma commented on GitHub (Aug 24, 2022):

Thank you for your response. If this isn't wanted behavior, I'll create a feature request as this could be useful for a couple of cases.

@heiko-ma commented on GitHub (Aug 24, 2022): Thank you for your response. If this isn't wanted behavior, I'll create a feature request as this could be useful for a couple of cases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6854