netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.77k stars 2.54k forks source link

Make interface name optional #11602

Closed BegBlev closed 1 year ago

BegBlev commented 1 year ago

NetBox version

v3.4.3

Feature type

Change to existing functionality

Proposed functionality

I think interface name should be optional.

The documentation specifies interface name is "The name of the interface, as reported by the device's operating system". A bare metal provider, won't know the name of the interface inside the operating system. He doen't even know which OS is installed. As an other exemple, if you have a JunOS device, the internal name depends of the SFP you will install (ge-0/0/0 or xe-0/0/0 or te-0/0/0...).

In my case, "label" has much more meaning as I have to make the cabling. The documentation specifies label is "An alternative physical label identifying the interface".

Of course, for virtual interfaces (bond0 on Linux or ae1 on JunOS) the name is much more relevant.

In a general way I wonder if the name should be optional also for other objects. Probably some people don't care about device names as they use serial number as a reference. In my case device name is just for printing on stckers :). My reference is definitly S/N

Best regards Vincent

Use case

A bare metal provider, won't know the name of the interface inside the operating system. He doen't even know which OS is installed. As an other exemple, if you have a JunOS device, the internal name depends of the SFP you will install (ge-0/0/0 or xe-0/0/0 or te-0/0/0...).

Database changes

No response

External dependencies

No response

DanSheps commented 1 year ago

Technically this is going to be difficult to implement, and somewhat impractical.

A bare metal provider, won't know the name of the interface inside the operating system. He doen't even know which OS is installed.

There are a couple of options for this, typically I just name it "ethernet" and rename as needed. If you are using automation, this should be part of your automation.

As an other exemple, if you have a JunOS device, the internal name depends of the SFP you will install (ge-0/0/0 or xe-0/0/0 or te-0/0/0...).

I am not sure about JunOS, but in Cisco IOS/IOS-XE you actually have all interfaces in the config (Gi, Te, Fo, etc) but only the active interface is the config that is used (for example, you have both Gi1/1/4 and Te1/1/4. You can have separate configs for each based on the network module inserted, a 1G SFP will still use the 10G config)

I definitely want to see comments based on this though, so upvote/downvote and comment please.

BarbarossaTM commented 1 year ago

I agree with @DanSheps that this would be impractical and just "inventing" an interface name here feels to be the easiest solution.

If this where to be allowed every automation piece would need to get a check for this new corner case as part of input validation.

jeremystretch commented 1 year ago

I strongly agree that this isn't something we can reasonably entertain, as it would violate many presumptions baked into both NetBox itself as well as user workflows. I suggest using formulaic placeholders in situations where interface names aren't known ahead of time.