netbox
netbox copied to clipboard
Ability to add custom fields to device templates and module templates
NetBox version
v3.3.2
Feature type
New functionality
Proposed functionality
When creating custom fields, they only appear when working inside a device or module, not the device type or module type.
Please add the ability to have custom fields be part of the device type and module type areas of netbox.
Based on : https://github.com/netbox-community/netbox/discussions/10293
Use case
Our use case would be to add a custom field to a power port. Then when that power port is added to any device the custom field is already populated. Similar to how maximum draw and allocated draw would already be present when adding a power port to a type.
Currently, you would have to create the device, go to the power port for the device AFTER its created, click edit, and populate the custom field every time for every device.
Database changes
I'm unsure what kind of database requirements would be needed to add the ability for custom fields to show up on device type and module type pages.
External dependencies
None that I can see.
I asked for something similar in #9243 as well.
these look similar. Since multiple people are asking for similar functionality maybe it will get some traction.
Can you add an example of custom field that would warrant such functionality ?
So let me describe my use case in more detail.
When you create a device template you can add 'power ports' to the template. When you add these power ports you are able to specify the maximum draw and allocated draw. Let's use easy numbers and say max draw is 100 watts, and allocated draw is 25 watts.
Now, when you create a new device from the device template that you just created the power ports are automatically added. And the max draw and allocated draw are already populated for you. Which is great! Now of course you can change these numbers per device if you so choose, but typically its unnecessary.
Now say we want to have a custom field on the power port. Currently, the custom field will only show up on the power port page when viewing a device. Not the device template. So if I wanted a custom field called 'BTU' that tracks the heat output of our power supplies I have to first create the device, then go to the power ports and fill in the BTU load for each device manually.
If the custom field 'BTU' were available on the device template, I could make the calculation and input the value just like I do for max draw and allocated draw. This way, when I create a new device from that device template, the BTU value is already filled out for me. Sure, I can change it if I need to (just like max draw), but the point is, the value is already filled in since its coming over from the device template.
My last comment was deleted. So I'm not sure if I have satisfied the requirements of 'revisions needed'
Your previous comment was directly mentioning circumventing auto closure of the issue, which is explicitly against the rules.
In my opinion you still haven't explained how it should work in practice. Is it just matched by name the name of the field? What happens if customer field types do not match? In your FR you mention that it should be added to device and module types, but when you explain further you are referring component templates, is it both?
The proposal is still not very thorough in my opinion.
What are you talking about? custom fields are not going to be different field types between a device and a device template. It's the same field. You just are able to select the device template page inside the model(s) selection
Currently, if you apply a custom field to the "DCIM > power port" model it will only show up on the device power port page after a device is created. You should also be able to apply this same custom field to the 'power port' of a device template.
What are you talking about?
This is no way to talk. Locking this until we can figure out a way forward with regards to your agressive and hostile comments.
custom fields are not going to be different field types between a device and a device template
There's no such thing as a device template. There's device types and devices, both can have independant custom fields. Then there are device components and device component templates, where only the first ones can have custom fields.
Closing this as #9243 provides a much better description of the proposed feature.