Filtering for single device + interface name returns multiple interfaces in a virtual chassis #7627

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

Originally created by @troeger on GitHub (Feb 9, 2023).

NetBox version

v3.4.4

Python version

3.8

Steps to Reproduce

  1. Create a new virtual chassis.
  2. Create two new devices (f.e. ID 152 and 153) with interfaces. Make sure that both devices have the same interface names. This can be easily achieved by using a common device template with predefined interface names.
  3. Add both devices to the virtual chassis. Do not define a master.
  4. Perform an API call that fetches all interfaces for a given device ID (e.g. for the first device), and a given interface name.

For device ID 152 and the interface name "ge-0/0/0", the query would look like this:

https://demo.netbox.dev/api/dcim/interfaces/?device_id=152&name=ge-0%2f0%2f0

Alternatively, you can simply define an according filter in the UI interface view.

Expected Behavior

One interface is returned, specifically the interface "ge-0/0/0" for device ID 152.

This was the behavior in Netbox 3.3.

Observed Behavior

Two interfaces are returned, specifically the interfaces "ge-0/0/0" for device ID 152 and device ID 153.

Originally created by @troeger on GitHub (Feb 9, 2023). ### NetBox version v3.4.4 ### Python version 3.8 ### Steps to Reproduce 1. Create a new virtual chassis. 2. Create two new devices (f.e. ID 152 and 153) with interfaces. Make sure that both devices have the same interface names. This can be easily achieved by using a common device template with predefined interface names. 3. Add both devices to the virtual chassis. Do **not** define a master. 4. Perform an API call that fetches all interfaces for a given device ID (e.g. for the first device), and a given interface name. For device ID 152 and the interface name "ge-0/0/0", the query would look like this: https://demo.netbox.dev/api/dcim/interfaces/?device_id=152&name=ge-0%2f0%2f0 Alternatively, you can simply define an according filter in the UI interface view. ### Expected Behavior One interface is returned, specifically the interface "ge-0/0/0" for device ID 152. This was the behavior in Netbox 3.3. ### Observed Behavior Two interfaces are returned, specifically the interfaces "ge-0/0/0" for device ID 152 and device ID 153.
adam added the type: bugstatus: duplicate labels 2025-12-29 20:26:13 +01:00
adam closed this issue 2025-12-29 20:26:13 +01:00
Author
Owner

@troeger commented on GitHub (Feb 9, 2023):

It seems like the following commit introduced the new behavior:

d8c07abd68

Given the fact the Devices.vc_interfaces has if_master=True as default, the Netbox v3.3 implementation (before the commit) would only show this behavior when the device is the VC master. This seems to be according to documentation.

With the commit above, all VC interfaces with a matching name are always returned, regardless of the the definition of a VC master. It remains to be clarified if this was an intended, or unintended side-effect of the change.

@troeger commented on GitHub (Feb 9, 2023): It seems like the following commit introduced the new behavior: https://github.com/netbox-community/netbox/commit/d8c07abd6817771b4f5491df19550d9f58261165 Given the fact the `Devices.vc_interfaces` has `if_master=True` as default, the Netbox v3.3 implementation (before the commit) would only show this behavior when the device is the VC master. This seems to be according to documentation. With the commit above, all VC interfaces with a matching name are always returned, regardless of the the definition of a VC master. It remains to be clarified if this was an intended, or unintended side-effect of the change.
Author
Owner

@kkthxbye-code commented on GitHub (Feb 10, 2023):

This is essentially a duplicate of https://github.com/netbox-community/netbox/issues/11478 as far as I can tell (same cause, the form just uses the API to get the selections). I'll close this, let me know if you believe this is a separate issue @troeger.

@kkthxbye-code commented on GitHub (Feb 10, 2023): This is essentially a duplicate of https://github.com/netbox-community/netbox/issues/11478 as far as I can tell (same cause, the form just uses the API to get the selections). I'll close this, let me know if you believe this is a separate issue @troeger.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7627