Provide default platform value for new device instances, inherited from device_type and manufacturer #6033

Closed
opened 2025-12-29 19:35:54 +01:00 by adam · 2 comments
Owner

Originally created by @decoupca on GitHub (Feb 1, 2022).

NetBox version

v3.1.2

Feature type

New functionality

Proposed functionality

Provide an inheritance-based model for assigning a default platform value to device objects upon creation.

Discussion

New optional field platform_default in both manufacturer and device_type objects. New device_types inherit manufacturer platform_default upon creation. New devices created from device_type inherit device_type platform default upon creation. Option to leave null (no platform_default) for either. Upon creation of either, user can opt to keep or override suggested defaults.

Assigning a platform_default for an existing device_type does NOT cause existing instances of that device_type to inherit that default. The platform_default is only inherited on device creation; it's up to us to update existing device instances via webgui or API.

Examples:
(assumes appropriate platform objects have already been created)

  1. Create cisco manufacturer. Assign platform_default = ios. Create C9500-24Y4C device_type. Leave suggested ios platform_default. Create N9K-C9332PQ device_type, select nxos platform_default. Devices created from either device_type inherit the appropriate platform_default.
  2. Create juniper manufacturer. Assign platform_default = junos. All device_types created with manufacturer = juniper receive junos platform_default, and in turn, all device instances created inherit junos platform_default.

If accepted, I'm willing to help implement.

Use case

  1. Provides a flexible and non-intrusive mechanism to assign platforms to devices upon creation.
  2. For environments that depend on them, reduces the likelihood that a given device instance either does not receive any platform value, or receives the wrong one.
  3. Reduces cognitive load during device creation.

Database changes

Add platform_default value to both manufacturer and device_type models.

External dependencies

No response

Originally created by @decoupca on GitHub (Feb 1, 2022). ### NetBox version v3.1.2 ### Feature type New functionality ### Proposed functionality Provide an inheritance-based model for assigning a default platform value to device objects upon creation. [Discussion](https://github.com/netbox-community/netbox/discussions/8500) New optional field `platform_default` in both `manufacturer` and `device_type` objects. New `device_types` inherit manufacturer `platform_default` upon creation. New `devices` created from `device_type` inherit `device_type` platform default upon creation. Option to leave null (no `platform_default`) for either. Upon creation of either, user can opt to keep or override suggested defaults. Assigning a `platform_default` for an **existing** `device_type` does NOT cause **existing** instances of that `device_type` to inherit that default. The platform_default is only inherited on device creation; it's up to us to update existing `device` instances via webgui or API. Examples: (assumes appropriate platform objects have already been created) 1. Create `cisco` manufacturer. Assign platform_default = `ios`. Create `C9500-24Y4C` device_type. Leave suggested `ios` platform_default. Create `N9K-C9332PQ` device_type, select `nxos` platform_default. Devices created from either device_type inherit the appropriate platform_default. 2. Create `juniper` manufacturer. Assign platform_default = `junos`. All device_types created with manufacturer = `juniper` receive `junos` platform_default, and in turn, all device instances created inherit `junos` platform_default. If accepted, I'm willing to help implement. ### Use case 1. Provides a flexible and non-intrusive mechanism to assign platforms to devices upon creation. 2. For environments that depend on them, reduces the likelihood that a given device instance either does not receive any platform value, or receives the wrong one. 3. Reduces cognitive load during device creation. ### Database changes Add `platform_default` value to both `manufacturer` and `device_type` models. ### External dependencies _No response_
adam added the type: featurepending closurestatus: under review labels 2025-12-29 19:35:54 +01:00
adam closed this issue 2025-12-29 19:35:54 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 4, 2022):

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. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Apr 4, 2022): 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. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (May 4, 2022):

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] commented on GitHub (May 4, 2022): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6033