Device Type Clones #3256

Closed
opened 2025-12-29 18:27:10 +01:00 by adam · 4 comments
Owner

Originally created by @agrrajag on GitHub (Jan 31, 2020).

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.3

Steps to Reproduce

  1. Create a Device Type with information: Manufacturer, Model, Slug, Height
  2. After creation, go into the device type and add all necessary interfaces
  3. After interfaces are created, select the Clone button to clone the device type

Expected Behavior

When a device profile is cloned, it was expected that all the properties of that device type would clone, including interfaces.

Observed Behavior

The only thing that cloned was the Manufacturer name.

References

#33 and #3938

Originally created by @agrrajag on GitHub (Jan 31, 2020). ### Environment * Python version: 3.6.9 * NetBox version: 2.7.3 ### Steps to Reproduce 1. Create a Device Type with information: Manufacturer, Model, Slug, Height 2. After creation, go into the device type and add all necessary interfaces 3. After interfaces are created, select the Clone button to clone the device type ### Expected Behavior When a device profile is cloned, it was expected that all the properties of that device type would clone, including interfaces. ### Observed Behavior The only thing that cloned was the Manufacturer name. ### References #33 and #3938
adam added the type: feature label 2025-12-29 18:27:10 +01:00
adam closed this issue 2025-12-29 18:27:10 +01:00
Author
Owner

@kobayashi commented on GitHub (Feb 14, 2020):

I think this is expected behavior, so set enhancement label for this

@kobayashi commented on GitHub (Feb 14, 2020): I think this is expected behavior, so set enhancement label for this
Author
Owner

@jeremystretch commented on GitHub (Feb 14, 2020):

Cloning merely pre-populates the form fields when creating a new object, based on the properties of the current object; it doesn't consider related objects at all. This behavior is global for all clonable objects in NetBox. For example, when you clone a VLAN, it doesn't replicate all the assigned VLANs.

Implementing this would require an entirely new view class. I don't really see it being worth development effort, particularly because a) device types typically don't have the same exact set of components, so you'll usually need to do some manual work anyway, and b) device types can be exported and imported in YAML format very quickly and easily.

@jeremystretch commented on GitHub (Feb 14, 2020): Cloning merely pre-populates the form fields when creating a new object, based on the properties of the current object; it doesn't consider related objects at all. This behavior is global for all clonable objects in NetBox. For example, when you clone a VLAN, it doesn't replicate all the assigned VLANs. Implementing this would require an entirely new view class. I don't really see it being worth development effort, particularly because a) device types typically don't have the same exact set of components, so you'll usually need to do some manual work anyway, and b) device types can be exported and imported in YAML format very quickly and easily.
Author
Owner

@agrrajag commented on GitHub (Feb 22, 2020):

It would be nice if you were able to have interfaces/power ports/etc. added to the clone as well. It would take almost no time to recreate the values under the current behavior, but would save minutes per device if we were able to clone interfacing options as well. What has taken us the most time to document is setting up device types to populate the rack elevations, and this change of behavior would drastically reduce that time as most of our switches and servers are very similar and would only require minor tweaks after a clone.

If you did a YAML export, it looks like it exported all device types in a single file instead of just a selected object. When you import, would you import a single device type, or would you have to re-import the entire list?

@agrrajag commented on GitHub (Feb 22, 2020): It would be nice if you were able to have interfaces/power ports/etc. added to the clone as well. It would take almost no time to recreate the values under the current behavior, but would save minutes per device if we were able to clone interfacing options as well. What has taken us the most time to document is setting up device types to populate the rack elevations, and this change of behavior would drastically reduce that time as most of our switches and servers are very similar and would only require minor tweaks after a clone. If you did a YAML export, it looks like it exported all device types in a single file instead of just a selected object. When you import, would you import a single device type, or would you have to re-import the entire list?
Author
Owner

@jeremystretch commented on GitHub (Jul 24, 2020):

I don't have anything to add beyond my comment above, and it looks like no one else does either, so I'm going to close this out.

When you import, would you import a single device type, or would you have to re-import the entire list?

Import is currently a single device type at a time. This is likely to change in the near future.

@jeremystretch commented on GitHub (Jul 24, 2020): I don't have anything to add beyond my comment above, and it looks like no one else does either, so I'm going to close this out. > When you import, would you import a single device type, or would you have to re-import the entire list? Import is currently a single device type at a time. This is likely to change in the near future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3256