Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add site specific vlans to bulk editing of interfaces #4523

Closed
nathbooth opened this issue Apr 22, 2020 · 7 comments
Closed

Add site specific vlans to bulk editing of interfaces #4523

nathbooth opened this issue Apr 22, 2020 · 7 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@nathbooth
Copy link

Environment

  • Python version: 3.7
  • NetBox version: 2.7.11

Attempt to bulk edit interfaces and add vlans;

  • Device is within a tenant
  • VLANs are linked to the same tenant
  • Navigate to Devices>Interfaces and bulk edit interfaces
  • Set mode to access or trunk
  • VLAN lookup returns 'no results found' for tagged and untagged vlans

If i edit the interfaces in the same way but select the interfaces from the device page under /dcim/devices it works correctly and shows the vlans.

Steps to Reproduce

  1. Create a tenant
  2. Create device with interfaces and vlans within that tenant
  3. Navigate to Devices>Interfaces
  4. Bulk edit device interfaces
  5. Set mode to access or trunk
  6. Observe no results found for vlans.
  7. Create new vlan without a tenant attached
  8. Repeat step 3-5
  9. Global VLAN create in step 7 is available for interface even though the device is within a tenant.

Expected Behavior

VLAN are shown for the tenant

Observed Behavior

No results are found and global vlans are shown when only tenant ones should be

@nathbooth nathbooth changed the title No VLANs found for interface when bulk editing interfaces from dcim/interfaces No VLANs found for interface when bulk editing interfaces from dcim/interfaces within tenant Apr 22, 2020
@DanSheps
Copy link
Member

I am not able to recreate this on https://master.netbox.dansheps.com/

Could you please test on there and then revise your steps. You need to include:

Device:

  • Site used
  • Rack, if any

Interface:

  • Type

VLAN:

  • Status
  • Site, if any
  • Group, if any

For both test cases.

@DanSheps DanSheps added the status: revisions needed This issue requires additional information to be actionable label Apr 22, 2020
@nathbooth
Copy link
Author

Well you are running 2.8.0 on there, could it be that it's the same issue as this? #4474

@DanSheps
Copy link
Member

Possible but unlikely as it wouldn't work on your second case. You can attempt to upgrade to 2.8 and see if it still persists.

@nathbooth
Copy link
Author

Have upgraded to 2.8.1 and issue still persists.
The issue from what i can see is as part of the bulk edit of interfaces the lookup references site=null
GET /api/ipam/vlans/?q=&limit=50&offset=0&brief=&site_id=null
I have managed to replicate this on your test instance now.
If you try and bulk edit interfaces on device NB-TEST-SWITCH you are only able to assign vlan 100 and 101 which are not assigned to a site.
Edit from dcim/interfaces
image
Edit from devices page (appears to add site_id=null and site_id-
image

@DanSheps
Copy link
Member

Alright, so it isn't that there are no sites showing, it is that there are only global sites showing. Which right now is to be expected as bulk edit has no concept of being in a site (mainly because you can bulk edit across many devices).

We can try changing this, but we would have to find a good balance. Do we only show site vlans when bulk editing devices in the same site? Do we allow bulk editing of any site a device is currently in and silently ignore invalid site vlan assignments? Do we throw an error? Do we attempt to map if the same VID's exist?

A lot of options and each might be perfectly viable.

@DanSheps DanSheps added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed status: revisions needed This issue requires additional information to be actionable labels Apr 27, 2020
@DanSheps DanSheps changed the title No VLANs found for interface when bulk editing interfaces from dcim/interfaces within tenant Bulk edit interfaces missing site vlans Apr 27, 2020
@DanSheps DanSheps changed the title Bulk edit interfaces missing site vlans Add site specific vlans to bulk editing of interfaces Apr 27, 2020
@DanSheps DanSheps added the type: feature Introduction of new functionality to the application label Apr 27, 2020
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application labels Jul 24, 2020
@stale stale bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Jul 24, 2020
@netbox-community netbox-community deleted a comment from stale bot Jul 27, 2020
@stale stale bot removed the pending closure Requires immediate attention to avoid being closed for inactivity label Jul 27, 2020
@DanSheps DanSheps self-assigned this Aug 4, 2020
@jeremystretch
Copy link
Member

@DanSheps any progress on this?

@DanSheps
Copy link
Member

I have gotten this working and chosen the following approach:

If the site matches for all interfaces, the site-specific interfaces will display. If the site does not match, only global vlans will display. I think this is a nice balanced approach which does not require a lot of further coding to be workable (existing validation logic is still valid).

What we get is this:

Same Device: Shows site vlans
Different Device, Same Site: Shows site vlans
Different Device, Different Site: Only Show Global VLANs

@DanSheps DanSheps self-assigned this Sep 29, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

3 participants