netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.26k stars 2.59k forks source link

Allow changing module bay and/or device to which a module is assigned #15289

Open francesco-noc opened 8 months ago

francesco-noc commented 8 months ago

NetBox version

v3.7.3

Feature type

New functionality

Proposed functionality

The topic was introduced in #13779 and #15162.

Once a module is created, it is bound to a specific module bay of a specific device. So apart from editing the descriptive fields (serial, asset_tag, ecc) , it can only be destroyed (deleted). It would be useful allowing move an existing module to another module bay of the same device or to a module bay of a different device, while keeping the descriptive fields unchanged and updating its components. If a (destination) module bay is already in use, an error is returned. Here you can find a working implementation.

Use case

Some organizations have to manage thousands of devices with thousands of modules, so it often happens that a module is removed from one device and installed in another device, or sometimes in other module bay of same device. This is exactly what happens with inventory items.

Database changes

None

External dependencies

None

francesco-noc commented 4 months ago

Hi @jeremystretch, I see that no one is assigned to this task yet. If you want, I can port changes I made on version 3 to version 4.

francesco-noc commented 1 month ago

Hi, these changes also work with version 4.1.3 but I've not tested them with nested modules.