Enable recursive nesting for platforms #11303

Closed
opened 2025-12-29 21:43:18 +01:00 by adam · 5 comments
Owner

Originally created by @0lini on GitHub (Jun 21, 2025).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v4.3.2

Feature type

Data model extension

Proposed functionality

I would like to propose a new feature to extend the Platform model in NetBox to support multiple associated versions. This would allow tracking specific software or firmware versions for each platform, creating a 1:N relationship where:
• One Platform can have multiple PlatformVersion entries
• Each PlatformVersion would store version metadata (e.g., version string, release date, etc.)

Use case

Managing network infrastructure often involves not just knowing what platform a device runs on (e.g., Cisco IOS, Juniper JunOS, Arista EOS), but also which version of that platform is in use. Platform versions can significantly impact:
• Feature availability
• Configuration syntax
• Security vulnerabilities
• Lifecycle status (EoL/EoS)

Currently, NetBox allows setting the platform for a device, but does not support tracking version information in a structured and reusable way.

By introducing a PlatformVersion model, NetBox users would gain the ability to:
• Associate specific software/firmware versions with a platform
• Enforce consistency across devices using the same version
• Query all devices running a given version of a platform
• Integrate version data into config management workflows and compliance reports
• Avoid repeated entry of version strings or messy freeform notes/custom fields

This is especially beneficial in environments with:
• Strict change control and upgrade procedures
• Vulnerability management requirements (e.g., CVE patching)
• Automated configuration templates that vary based on software version

Ultimately, this feature would enable better data integrity, auditing, and automation across device lifecycle and configuration management processes.

Database changes

This feature would require the addition of a new model, PlatformVersion, to support a one-to-many relationship between Platform and its associated versions.

External dependencies

No response

Originally created by @0lini on GitHub (Jun 21, 2025). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v4.3.2 ### Feature type Data model extension ### Proposed functionality I would like to propose a new feature to extend the Platform model in NetBox to support multiple associated versions. This would allow tracking specific software or firmware versions for each platform, creating a 1:N relationship where: • One Platform can have multiple PlatformVersion entries • Each PlatformVersion would store version metadata (e.g., version string, release date, etc.) ### Use case Managing network infrastructure often involves not just knowing what platform a device runs on (e.g., Cisco IOS, Juniper JunOS, Arista EOS), but also which version of that platform is in use. Platform versions can significantly impact: • Feature availability • Configuration syntax • Security vulnerabilities • Lifecycle status (EoL/EoS) Currently, NetBox allows setting the platform for a device, but does not support tracking version information in a structured and reusable way. By introducing a PlatformVersion model, NetBox users would gain the ability to: • Associate specific software/firmware versions with a platform • Enforce consistency across devices using the same version • Query all devices running a given version of a platform • Integrate version data into config management workflows and compliance reports • Avoid repeated entry of version strings or messy freeform notes/custom fields This is especially beneficial in environments with: • Strict change control and upgrade procedures • Vulnerability management requirements (e.g., CVE patching) • Automated configuration templates that vary based on software version Ultimately, this feature would enable better data integrity, auditing, and automation across device lifecycle and configuration management processes. ### Database changes This feature would require the addition of a new model, PlatformVersion, to support a one-to-many relationship between Platform and its associated versions. ### External dependencies _No response_
adam added the status: acceptedtype: featurecomplexity: medium labels 2025-12-29 21:43:18 +01:00
adam closed this issue 2025-12-29 21:43:18 +01:00
Author
Owner

@jnovinger commented on GitHub (Jun 25, 2025):

Per the Platform model documentation:

A platform defines the type of software running on a device or virtual machine. This can be helpful to model when it is necessary to distinguish between different versions or feature sets. Note that two devices of the same type may be assigned different platforms: For example, one Juniper MX240 might run Junos 14 while another runs Junos 15.

There are a few ways this could be tackled given the tools already in NetBox: tags, custom fields, or even a plugin.

@jnovinger commented on GitHub (Jun 25, 2025): Per the [Platform model documentation](https://netboxlabs.com/docs/netbox/models/dcim/platform/): > A platform defines the type of software running on a [device](https://netboxlabs.com/docs/netbox/models/dcim/device/) or [virtual machine](https://netboxlabs.com/docs/netbox/models/virtualization/virtualmachine/). This can be helpful to model when it is necessary to distinguish between different versions or feature sets. Note that two devices of the same type may be assigned different platforms: For example, one Juniper MX240 might run Junos 14 while another runs Junos 15. There are a few ways this could be tackled given the tools already in NetBox: tags, custom fields, or even a plugin.
Author
Owner

@jeremystretch commented on GitHub (Jun 25, 2025):

This has been proposed in the past, and the sticking point was that declaring a specific release for each platform could force too much granularity on the user. For example, the user might want to differentiate between major releases of an OS, but not between patch releases.

Maybe we could take the same approach here as in #18245, by implementing the ability to nest platforms recursively. This would allow users to declare e.g. Cisco IOS 15 at the root level, with versions 15.1, 15.2, and so on beneath it.

@jeremystretch commented on GitHub (Jun 25, 2025): This has been proposed in the past, and the sticking point was that declaring a specific release for each platform could force too much granularity on the user. For example, the user might want to differentiate between major releases of an OS, but not between patch releases. Maybe we could take the same approach here as in #18245, by implementing the ability to nest platforms recursively. This would allow users to declare e.g. Cisco IOS 15 at the root level, with versions 15.1, 15.2, and so on beneath it.
Author
Owner

@ghost commented on GitHub (Jun 27, 2025):

Maybe we could take the same approach here as in #18245, by implementing the ability to nest platforms recursively. This would allow users to declare e.g. Cisco IOS 15 at the root level, with versions 15.1, 15.2, and so on beneath it.

I like this approach, but why make the root "Cisco IOS 15"? The root could just be "Cisco IOS", or "Cisco IOS-XE", or "Cisco IOS-XR" then just have nested major and minor versions underneath that.

@ghost commented on GitHub (Jun 27, 2025): > Maybe we could take the same approach here as in [#18245](https://github.com/netbox-community/netbox/issues/18245), by implementing the ability to nest platforms recursively. This would allow users to declare e.g. Cisco IOS 15 at the root level, with versions 15.1, 15.2, and so on beneath it. I like this approach, but why make the root "Cisco IOS 15"? The root could just be "Cisco IOS", or "Cisco IOS-XE", or "Cisco IOS-XR" then just have nested major and minor versions underneath that.
Author
Owner

@jeremystretch commented on GitHub (Jun 27, 2025):

It was just an example for illustration. You could arrange the hierarchy into as many tiers as makes sense for your use case.

@jeremystretch commented on GitHub (Jun 27, 2025): It was just an example for illustration. You could arrange the hierarchy into as many tiers as makes sense for your use case.
Author
Owner

@0lini commented on GitHub (Jul 7, 2025):

Jup, a hierarchical structure would work for this.

@0lini commented on GitHub (Jul 7, 2025): Jup, a hierarchical structure would work for this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11303