netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Allow templating of virtual chassis position in templated component names on modules

Open cpmills1975 opened this issue 3 years ago • 1 comments

NetBox version

v3.3.4

Feature type

New functionality

Proposed functionality

When templating component names, e.g. interfaces, it is possible to include {module} in the name and have this replaced with the module position on instantiation. I'd like to propose expanding the selection of available templates to include the virtual chassis position.

Use case

Perhaps a bit of an edge case, but I was adding modules to a device that was already part of a virtual chassis. In the case of a JunOS or Cisco module, the interface names should would ideally be instantiated as interface-type/virtual chassis FPC number or FEX number/module slot/PIC number/interface number e.g. xe-1/2/3, Eth101/2/3, etc.

I was able to template the module/PIC number using the {module} tag, but not the FPC/FEX number. Had I been able to template the interface names as xe-{vcposition}/{module}/[0-7] or Eth{vcposition}/{module}/[1-8], I'd not have had to subsequently rename the interfaces that were instantiated.

Database changes

None

External dependencies

None

cpmills1975 avatar Sep 29 '22 20:09 cpmills1975

Makes sense. We should be able to follow the same pattern we use for module position. I don't have a strong opinion the token name but vc_position might offer slightly better readability.

jeremystretch avatar Oct 03 '22 14:10 jeremystretch

I believe this is also related to #8648, which is something I'd also like to see implemented at one point. Still want to look at the code a bit before I commit to working on this myself. Would really like to see a better way to implement virtual chassis though. Having each member of a switch stack show as -0X in the device list gets a little wonky and less intuitive than just seeing the name of the stack itself.

cpund avatar Oct 18 '22 21:10 cpund

It seems this is a duplicate of #8648 and some interesting points were raised by @jeremystretch at the time regarding devices and their components being instantiated before being added to a VC rather than at the same time. @DanSheps suggestion to offer the ability to template but with a default makes a lot of sense - in the case of Juniper ports, AFAIK the FPC number will always be zero unless the device is part of a VC so templating {vc_position:0} or something like that would be helpful here.

cpmills1975 avatar Oct 19 '22 08:10 cpmills1975

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. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

github-actions[bot] avatar Dec 19 '22 04:12 github-actions[bot]

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

github-actions[bot] avatar Jan 19 '23 04:01 github-actions[bot]