[PR #1849] [CLOSED] implements #33 - device clone #12271

Closed
opened 2025-12-29 22:20:36 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/1849
Author: @lampwins
Created: 1/31/2018
Status: Closed

Base: developHead: feature/33-device-clone


📝 Commits (1)

📊 Changes

6 files changed (+355 additions, -0 deletions)

View changed files

📝 netbox/dcim/forms.py (+111 -0)
📝 netbox/dcim/urls.py (+1 -0)
📝 netbox/dcim/views.py (+113 -0)
netbox/templates/dcim/device_clone.html (+82 -0)
netbox/templates/dcim/inc/clone.html (+42 -0)
📝 netbox/templates/dcim/inc/device_header.html (+6 -0)

📄 Description

Fixes: #33

This adds a button on the top right of the device view page which allows the user to clone the current device. This then populates a variant of the device edit form with the data from the source device. At this point, all required data is filled out and the user may simply click clone at the bottom to finish. The user may also edit any of the data, like a normal device edit form before continuing.

When posting the form, a new device instance is initialized with the form data and all of the device components are then cloned (interfaces, console (server) ports, power outlets/ports). This honors edits made to device type component templates in the source device and also honors lag memberships.

Let me know what you think.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/1849 **Author:** [@lampwins](https://github.com/lampwins) **Created:** 1/31/2018 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `feature/33-device-clone` --- ### 📝 Commits (1) - [`6da7813`](https://github.com/netbox-community/netbox/commit/6da7813d2f9e1c2fbd61745e2c588e488e66cd42) implements #33 - device clone ### 📊 Changes **6 files changed** (+355 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms.py` (+111 -0) 📝 `netbox/dcim/urls.py` (+1 -0) 📝 `netbox/dcim/views.py` (+113 -0) ➕ `netbox/templates/dcim/device_clone.html` (+82 -0) ➕ `netbox/templates/dcim/inc/clone.html` (+42 -0) 📝 `netbox/templates/dcim/inc/device_header.html` (+6 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be opened for approval prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. Please indicate the relevant feature request or bug report below. --> ### Fixes: #33 <!-- Please include a summary of the proposed changes below. --> This adds a button on the top right of the device view page which allows the user to clone the current device. This then populates a variant of the device edit form with the data from the source device. At this point, all required data is filled out and the user may simply click clone at the bottom to finish. The user may also edit any of the data, like a normal device edit form before continuing. When posting the form, a new device instance is initialized with the form data and all of the device components are then cloned (interfaces, console (server) ports, power outlets/ports). This honors edits made to device type component templates in the source device and also honors lag memberships. Let me know what you think. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:20:36 +01:00
adam closed this issue 2025-12-29 22:20:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#12271