Modify check for parent Interface to support different parentable interfaces (patch available) #11532

Closed
opened 2025-12-29 21:46:27 +01:00 by adam · 6 comments
Owner

Originally created by @uedvt359 on GitHub (Aug 26, 2025).

NetBox version

v4.3.6

Feature type

Other

Proposed functionality

I would like to ask for the following patch to be applied upstream: d86d94f184 - happy to open a PR for it.

Currently, only virtual interfaces can have a parent interface. This modification would allow this check to be easily extended out-of-tree. The proposed patch is minimally invasive. I'd be happy to also submit a second patch, implementing our use case of partitioned ports, if there is interest.

Use case

We are already patching dcim.constants to add some additional interface types we need. We would like to now add a new type, "partition", to properly document partitioned ports (splitting the four lanes of a 40/100G QSFP+/28 into four separate ports, with a breakout cable).

In addition to the submitted patch, here is how our custom interface patch (not submitted here, but would if you want): 5c173d93ed

This would look like this, using our ExtremeNetworks 7720 as an example:

Image

The first port, "12:1", is the master port, which can either be 100G, or split into four 25G ports, as is done here. Hence, it has three sub-ports, "12:2" to "12:4" which have "12:1" as their parent.

This is how this port looks on the switch's CLI:

# a port with four partitions (physically, a single QSFP+ 40G module in the QSFP28 slot):
12:1                          (0003)              E     A      10G    FULL 
12:2                          vlanMApublic1       E     A      10G    FULL 
12:3                          vlanMApublic1       E     A      10G    FULL 
12:4                          vlanMApublic1       E     A      10G    FULL 

# a not partitioned port (note how :2 to :4 are "not present", all four lanes go to a single logical port):
13:1                          (0038)              E     A      100G   FULL 
13:2                                              E     NP                              
13:3                                              E     NP                              
13:4                                              E     NP                              

This solution has the following benefits over previously suggested workarounds:

  • it allows to connect a Cable to the proper partition instead of using a multi-ended cable on the master partition
  • It allows us to correctly set the Interface Type to the proper value (it's a single QSFP* slot with a single QSFP* module, not four SFP* slots/modules)

Database changes

none.

External dependencies

none.

Originally created by @uedvt359 on GitHub (Aug 26, 2025). ### NetBox version v4.3.6 ### Feature type Other ### Proposed functionality I would like to ask for the following patch to be applied upstream: https://github.com/uedvt359/netbox/commit/d86d94f1841aa2981a1397f07310a214ff25cc60 - happy to open a PR for it. Currently, only virtual interfaces can have a parent interface. This modification would allow this check to be easily extended out-of-tree. The proposed patch is minimally invasive. I'd be happy to also submit a second patch, implementing our use case of partitioned ports, if there is interest. ### Use case We are already patching `dcim.constants` to add some additional interface types we need. We would like to now add a new type, "partition", to properly document partitioned ports (splitting the four lanes of a 40/100G QSFP+/28 into four separate ports, with a breakout cable). In addition to the submitted patch, here is how our custom interface patch (not submitted here, but would if you want): https://github.com/netbox-community/netbox/commit/5c173d93eda4a24568941a31192108034b2e7b83 This would look like this, using our ExtremeNetworks 7720 as an example: <img width="901" height="268" alt="Image" src="https://github.com/user-attachments/assets/8b668c1b-88b1-40a1-849e-fef244eb54d2" /> The first port, "12:1", is the master port, which can either be 100G, or split into four 25G ports, as is done here. Hence, it has three sub-ports, "12:2" to "12:4" which have "12:1" as their parent. This is how this port looks on the switch's CLI: ``` # a port with four partitions (physically, a single QSFP+ 40G module in the QSFP28 slot): 12:1 (0003) E A 10G FULL 12:2 vlanMApublic1 E A 10G FULL 12:3 vlanMApublic1 E A 10G FULL 12:4 vlanMApublic1 E A 10G FULL # a not partitioned port (note how :2 to :4 are "not present", all four lanes go to a single logical port): 13:1 (0038) E A 100G FULL 13:2 E NP 13:3 E NP 13:4 E NP ``` This solution has the following benefits over previously suggested workarounds: * it allows to connect a Cable to the proper partition instead of using a multi-ended cable on the master partition * It allows us to correctly set the Interface Type to the proper value (it's a single QSFP\* slot with a single QSFP\* module, not four SFP\* slots/modules) ### Database changes none. ### External dependencies none.
adam added the type: feature label 2025-12-29 21:46:27 +01:00
adam closed this issue 2025-12-29 21:46:27 +01:00
Author
Owner

@uedvt359 commented on GitHub (Aug 26, 2025):

We looked at the following other solutions to this problem before this patch, but none of those are suitable:

  • create the partitions with type "virtual": this doesn't work, because one cannot patch a Cable to a virtual interface. All four connections would have to end up at the master port, unable to distinguish which logical sub-port (i.e, lane) the cable is really connected to
  • using four separate (Q)SFP+/28 ports: this breaks the inventory calculation (there is only 1 module in reality, not 4), and there is no connection between which ports in the netbox are part of the same physical interface. with the above example (12:1-12:4) one could parse the name, but on other switches they are just numbered (13,14,15,16).
@uedvt359 commented on GitHub (Aug 26, 2025): We looked at the following other solutions to this problem before this patch, but none of those are suitable: * create the partitions with type "virtual": this doesn't work, because one cannot patch a Cable to a virtual interface. All four connections would have to end up at the master port, unable to distinguish which logical sub-port (i.e, lane) the cable is really connected to * using four separate (Q)SFP+/28 ports: this breaks the inventory calculation (there is only 1 module in reality, not 4), and there is no connection between which ports in the netbox are part of the same physical interface. with the above example (12:1-12:4) one could parse the name, but on other switches they are just numbered (13,14,15,16).
Author
Owner

@dotie commented on GitHub (Aug 27, 2025):

This would be very helpful for documenting the cabling for these ports. Thanks!

@dotie commented on GitHub (Aug 27, 2025): This would be very helpful for documenting the cabling for these ports. Thanks!
Author
Owner

@jeremystretch commented on GitHub (Aug 28, 2025):

NetBox intentionally does not support assigning a parent to a physical interface as it does not reflect reality. In the scenario where you've installed a channelized transceiver, it's important to recognize that the QSFP port is treated as four discrete physical interfaces, each with no parent. In your example above, interfaces 12:1, 12:2, 12:3, and 12:4 are each independent physical 25 Gigabit Ethernet interfaces, and should be modeled as such.

Hope that helps. If you need further assistance with interface modeling, please consider opening a discussion.

@jeremystretch commented on GitHub (Aug 28, 2025): NetBox intentionally does not support assigning a parent to a physical interface as it does not reflect reality. In the scenario where you've installed a channelized transceiver, it's important to recognize that the QSFP port is treated as four discrete physical interfaces, each with no parent. In your example above, interfaces `12:1`, `12:2`, `12:3`, and `12:4` are each independent physical 25 Gigabit Ethernet interfaces, and should be modeled as such. Hope that helps. If you need further assistance with interface modeling, please consider opening a [discussion](https://github.com/netbox-community/netbox/discussions/new?category=help-wanted).
Author
Owner

@bitcollector1 commented on GitHub (Aug 28, 2025):

I'm breaking my brain trying to digest and script for the new SFP "module" concept.....converting from already working inventory scripts.

I will say, I love the fact that the interfaces get populated automatically now when a module is plugged in......but the breakouts are not easy.

I've came up with an ugly workaround that uses a "breakout" module type that I am going to assign to the children ports.

@bitcollector1 commented on GitHub (Aug 28, 2025): I'm breaking my brain trying to digest and script for the new SFP "module" concept.....converting from already working inventory scripts. I will say, I love the fact that the interfaces get populated automatically now when a module is plugged in......but the breakouts are not easy. I've came up with an ugly workaround that uses a "breakout" module type that I am going to assign to the children ports.
Author
Owner

@uedvt359 commented on GitHub (Aug 29, 2025):

@jeremystretch : I was hoping you could accept the first patch, which simply moves the type of parentable interfaces to a list (with still just 1 member, "virtual"). with this, we can keep our other patches out-of-tree without too much hassle.

In your example above, interfaces 12:1, 12:2, 12:3, and 12:4 are each independent physical 25 Gigabit Ethernet interfaces, and should be modeled as such.

well, they are mostly independent, except that they share a physical QSFP module and a single slot in the switch. My concern is mostly for provisioning/generating config files, where I need to know that I have to add some config lines to "split" the port.

thanks!

@uedvt359 commented on GitHub (Aug 29, 2025): @jeremystretch : I was hoping you could accept the [first patch](https://github.com/uedvt359/netbox/commit/d86d94f1841aa2981a1397f07310a214ff25cc60), which simply moves the type of parentable interfaces to a list (with still just 1 member, "virtual"). with this, we can keep our other patches out-of-tree without too much hassle. > In your example above, interfaces 12:1, 12:2, 12:3, and 12:4 are each independent physical 25 Gigabit Ethernet interfaces, and should be modeled as such. well, they are mostly independent, except that they share a physical QSFP module and a single slot in the switch. My concern is mostly for provisioning/generating config files, where I need to know that I have to add some config lines to "split" the port. thanks!
Author
Owner

@jeremystretch commented on GitHub (Aug 29, 2025):

Again, there is no parent interface in this scenario: There are only four peer channelized interfaces. Parent interfaces can only have virtual children, e.g. an 802.1Q-encapsulated routed interfaces with a virtual subinterface for each configured VLAN.

@jeremystretch commented on GitHub (Aug 29, 2025): Again, there is no parent interface in this scenario: There are only four peer channelized interfaces. Parent interfaces can only have virtual children, e.g. an 802.1Q-encapsulated routed interfaces with a virtual subinterface for each configured VLAN.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11532