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

Assign configuration context to VLAN #6340

Closed jcralbino closed 2 years ago

jcralbino commented 3 years ago

NetBox version

v2.11.2

Feature type

Change to existing functionality

Proposed functionality

In order to improve the automation capability for the VLAN in a SDN environment it is interesting to provide more details than the ones provided by the object itself.

Using a configuration context mapping, would simplify this as it will provide a structure information related to a L2 domain.

Use case

For ACI configuration and related SDN Environment, a VLAN is mapped to a L2 Bridge domain according to specific configuration parameters.

A configuration context would allow to use netbox to document the required configuration for this VLAN/L2 domain.

Database changes

Probably creating one additional entry in the VLAN model to allow a mapping to a configuration context.

External dependencies

none

jcralbino commented 3 years ago

@jeremystretch i believe that this is something we can add maintaining the principle behind configuration context

Do you prefer If a discussion for this is opened before ?

jeremystretch commented 3 years ago

Unfortunately I don't think this would be feasible, as there is (intentionally) no relationship from devices/VMs directly to VLANs. This precludes us from rendering config contexts as part of a device/VM queryset, which is a crucial function of the feature.

jcralbino commented 3 years ago

Thanks for your feedback. Indeed I missed that concept of configuration context, but it is true that the object where they are used is mainly with devices.

So for this specific use case it should a completely new configuration context object, like VLAN configuration context.

The principle behind should be to use this to improve the automation of a l2 broadcast domains ( VLAN, VXLAN,..) across different switches .

jeremystretch commented 3 years ago

Can you elaborate on your use case here? Specifically, why wouldn't a custom field on the VLAN and/or VLANGroup model work for this?

jcralbino commented 3 years ago

In my perception this object is used to represent a layer 2 broadcast domain. In this case we can assume the following

Using a custom field for this will mean that legacy vlans objects ( placed outside this VLAN group) are having a database field that is not going to be used.

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

jcralbino commented 3 years ago

@jeremystretch

From your previous comments I understood that the issue was related with the way the current model for device is made, where the local context is tied to that model.

Do you see the value of having another field associated with the vlan to improve the way new networks are represented in netbox, after my detailed use case ?

I have seen in the past request to model l2vpn( that are nothing more than an extended layer 2) that can be also accomplished using this local context that will provide configuration details while using the current vlan fields( name, vlan role,..) we can model this l2 network constructs in netbox better.

jeremystretch commented 2 years ago

As I noted above, the proposed feature is not technically feasible given the current data model.