Config Context for racks #3733

Closed
opened 2025-12-29 18:30:50 +01:00 by adam · 2 comments
Owner

Originally created by @ryanmerolle on GitHub (May 29, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.8.5

Proposed Functionality

Enable config context for racks.

Use Case

In some instances it is useful to apply config context by rack. For example, each rack can be given a group number so that each compute leaf and each management leaf can be assigned a spine up-links based on said group id.

Database Changes

External Dependencies

Originally created by @ryanmerolle on GitHub (May 29, 2020). ### Environment * Python version: 3.6.9 * NetBox version: 2.8.5 ### Proposed Functionality Enable config context for racks. ### Use Case In some instances it is useful to apply config context by rack. For example, each rack can be given a group number so that each compute leaf and each management leaf can be assigned a spine up-links based on said group id. ### Database Changes ### External Dependencies
adam closed this issue 2025-12-29 18:30:50 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 29, 2020):

This was originally proposed under #1349 and omitted because IMO it's a very roundabout way of mapping attributes. The fact that a device exists within a specific physical rack is not typically pertinent for configuration purposes. Rather, what we're after when we make this reference is why the device is housed within a particular rack, which is likely ascertainable via other, more direct means.

For example, each rack can be given a group number so that each compute leaf and each management leaf can be assigned a spine up-links based on said group id.

Why tie this to the rack, instead of mapping leafs to spines directly? Doing so allows for much more flexibility.

@jeremystretch commented on GitHub (May 29, 2020): This was originally proposed under #1349 and omitted because IMO it's a very roundabout way of mapping attributes. The fact that a device exists within a specific physical rack is not typically pertinent for configuration purposes. Rather, what we're after when we make this reference is _why_ the device is housed within a particular rack, which is likely ascertainable via other, more direct means. > For example, each rack can be given a group number so that each compute leaf and each management leaf can be assigned a spine up-links based on said group id. Why tie this to the rack, instead of mapping leafs to spines directly? Doing so allows for much more flexibility.
Author
Owner

@ryanmerolle commented on GitHub (May 30, 2020):

I appreciate the feedback. The 3 switches in a rack tie back to a rack_id which is an arbitrator id starting at 1 per site.

The reality is that you are right. A netbox script could handle the interface assignments. I was thinking short sighted since my templates were developed before leveraging netbox for passing all the interfaces and config context. The rack context would have just been a temp bridge gap.

@ryanmerolle commented on GitHub (May 30, 2020): I appreciate the feedback. The 3 switches in a rack tie back to a rack_id which is an arbitrator id starting at 1 per site. The reality is that you are right. A netbox script could handle the interface assignments. I was thinking short sighted since my templates were developed before leveraging netbox for passing all the interfaces and config context. The rack context would have just been a temp bridge gap.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3733