Config Contexts by Racks #3320

Closed
opened 2025-12-29 18:27:40 +01:00 by adam · 3 comments
Owner

Originally created by @sakbhav on GitHub (Feb 13, 2020).

Environment

  • Python version: 3.6.3
  • NetBox version: 2.7.4

Proposed Functionality

To be able to set config context per rack basis.

Use Case

I want to set some rack specific configurations (e.g. static routes/network switch related configs etc.) via ansible using netbox as inventory. Though this can be achieved by setting a tag and defining config context on that tag but it won't scalable for large number of servers.

Database Changes

Yes

External Dependencies

None

Originally created by @sakbhav on GitHub (Feb 13, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.3 * NetBox version: 2.7.4 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality To be able to set config context per rack basis. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case I want to set some rack specific configurations (e.g. static routes/network switch related configs etc.) via ansible using netbox as inventory. Though this can be achieved by setting a tag and defining config context on that tag but it won't scalable for large number of servers. ### Database Changes Yes <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None
adam closed this issue 2025-12-29 18:27:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 13, 2020):

I want to set some rack specific configurations (e.g. static routes/network switch related configs etc.)

A device's physical location shouldn't have any bearing on its function, so inferring characteristics of a device from the rack in which it's installed strikes me as backwards. It sounds like you're using the rack as a proxy for some other piece(s) of information, which will inevitably present a problem at some point down the road.

Though this can be achieved by setting a tag and defining config context on that tag but it won't scalable for large number of servers.

Why don't you expect the use of tags to scale?

@jeremystretch commented on GitHub (Feb 13, 2020): > I want to set some rack specific configurations (e.g. static routes/network switch related configs etc.) A device's physical location shouldn't have any bearing on its function, so inferring characteristics of a device from the rack in which it's installed strikes me as backwards. It sounds like you're using the rack as a proxy for some other piece(s) of information, which will inevitably present a problem at some point down the road. > Though this can be achieved by setting a tag and defining config context on that tag but it won't scalable for large number of servers. Why don't you expect the use of tags to scale?
Author
Owner

@sakbhav commented on GitHub (Feb 15, 2020):

A device's physical location shouldn't have any bearing on its function, so inferring characteristics of a device from the rack in which it's installed strikes me as backwards.

Well, device's physical location does have bearing with its function when we need to reduce the network latency to its minimum.

It sounds like you're using the rack as a proxy for some other piece(s) of information, which will inevitably present a problem at some point down the road.

In my case, I am trying to keep server's static route information (which are different for each rack) in config context.
Rack config context can also be used in a more general case like if you want to set the hostname/alias of servers based on the rack it is present in etc.

Why don't you expect the use of tags to scale?

This will involve tagging all the servers in a rack with same tag which is cumbersome and error prone. Also this is going to be redundant information.

I understand that this use case might not be a very general one, but if this can be easily done and doesn't have huge performance overhead then please enable config context to be defined per rack.

Thanks

@sakbhav commented on GitHub (Feb 15, 2020): > A device's physical location shouldn't have any bearing on its function, so inferring characteristics of a device from the rack in which it's installed strikes me as backwards. Well, device's physical location does have bearing with its function when we need to reduce the network latency to its minimum. > It sounds like you're using the rack as a proxy for some other piece(s) of information, which will inevitably present a problem at some point down the road. In my case, I am trying to keep server's static route information (which are different for each rack) in config context. Rack config context can also be used in a more general case like if you want to set the hostname/alias of servers based on the rack it is present in etc. > Why don't you expect the use of tags to scale? This will involve tagging all the servers in a rack with same tag which is cumbersome and error prone. Also this is going to be redundant information. I understand that this use case might not be a very general one, but if this can be easily done and doesn't have huge performance overhead then please enable config context to be defined per rack. Thanks
Author
Owner

@jeremystretch commented on GitHub (Feb 17, 2020):

In my case, I am trying to keep server's static route information (which are different for each rack) in config context.

It's not different for each rack: It's different for each prefix, and you just happen to allocate (presumably) one prefix per rack. If one prefix were to span two racks, all the devices in both racks would still use the same gateway. Similarly, there may be two prefixes within a single rack which use different gateways. There is no direct correlation of rack to IP gateway.

I'm going to decline this FR because using a device's rack as a proxy for other information is unnecessary and there are mechanisms available in NetBox better suited for this purpose.

@jeremystretch commented on GitHub (Feb 17, 2020): > In my case, I am trying to keep server's static route information (which are different for each rack) in config context. It's not different for each rack: It's different for each _prefix_, and you just happen to allocate (presumably) one prefix per rack. If one prefix were to span two racks, all the devices in both racks would still use the same gateway. Similarly, there may be two prefixes within a single rack which use different gateways. There is no direct correlation of rack to IP gateway. I'm going to decline this FR because using a device's rack as a proxy for other information is unnecessary and there are mechanisms available in NetBox better suited for this purpose.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3320