Enable adding/removing module assignments for components in bulk #6274

Closed
opened 2025-12-29 19:38:50 +01:00 by adam · 3 comments
Owner

Originally created by @mmfreitas on GitHub (Mar 31, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2.0-beta2

Feature type

Change to existing functionality

Proposed functionality

When a module is installed in a module bay, it creates the interfaces, when the modules is removed, it deletes the interfaces. Suppose that I have installed a module but the device on which it was installed already had the interfaces with the same name and when the module was installed I had to untick the replicate components.

The interfaces would still exist with the name that was intended for the module to create, what currently happens is that when you remove the module, the interfaces still remain on the device, because they were created prior to the module.

Even though the interfaces exist prior to the module, as the module can already be installed without replicating components, I propose that when a module is removed, the interfaces that still exist in the position that the module was removed should be deleted.

I am giving the example of interfaces, but this would be the same for other components such as power outlets, power ports, console ports etc. etc.

Use case

I will upgrade netbox to version 3.2 when it's stable.
I want to populate my data with the new module funcionality, so I will add the modules to the devices, the interfaces which the modules would create already exist in my database so I won't be replicating components. Problem is that when I need to remove a module, as currently happens in the beta, the interfaces would remain on the device, these should be deleted if the module is removed.

Database changes

None.

External dependencies

None.

Originally created by @mmfreitas on GitHub (Mar 31, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2.0-beta2 ### Feature type Change to existing functionality ### Proposed functionality When a module is installed in a module bay, it creates the interfaces, when the modules is removed, it deletes the interfaces. Suppose that I have installed a module but the device on which it was installed already had the interfaces with the same name and when the module was installed I had to untick the replicate components. The interfaces would still exist with the name that was intended for the module to create, what currently happens is that when you remove the module, the interfaces still remain on the device, because they were created prior to the module. Even though the interfaces exist prior to the module, as the module can already be installed without replicating components, I propose that when a module is removed, the interfaces that still exist in the position that the module was removed should be deleted. I am giving the example of interfaces, but this would be the same for other components such as power outlets, power ports, console ports etc. etc. ### Use case I will upgrade netbox to version 3.2 when it's stable. I want to populate my data with the new module funcionality, so I will add the modules to the devices, the interfaces which the modules would create already exist in my database so I won't be replicating components. Problem is that when I need to remove a module, as currently happens in the beta, the interfaces would remain on the device, these should be deleted if the module is removed. ### Database changes None. ### External dependencies None.
adam added the status: acceptedtype: featurebeta labels 2025-12-29 19:38:50 +01:00
adam closed this issue 2025-12-29 19:38:50 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 31, 2022):

Problem is that when I need to remove a module, as currently happens in the beta, the interfaces would remain on the device, these should be deleted if the module is removed.

The interfaces are not automatically removed when the module is deleted because they have never been associated with the module. The module field of each interface needs to be set to reference the module. Otherwise, NetBox has absolutely no indication that they're related.

The most prudent approach would be to allow assigning/removing a module to components in the bulk edit view. This would allow users to easily associate pre-existing components with newly installed modules.

@jeremystretch commented on GitHub (Mar 31, 2022): > Problem is that when I need to remove a module, as currently happens in the beta, the interfaces would remain on the device, these should be deleted if the module is removed. The interfaces are not automatically removed when the module is deleted because they have never been associated with the module. The `module` field of each interface needs to be set to reference the module. Otherwise, NetBox has absolutely no indication that they're related. The most prudent approach would be to allow assigning/removing a module to components in the bulk edit view. This would allow users to easily associate pre-existing components with newly installed modules.
Author
Owner

@mmfreitas commented on GitHub (Mar 31, 2022):

The most prudent approach would be to allow assigning/removing a module to components in the bulk edit view. This would allow users to easily associate pre-existing components with newly installed modules.

Yes, I think this would be a good solution for this.

@mmfreitas commented on GitHub (Mar 31, 2022): > The most prudent approach would be to allow assigning/removing a module to components in the bulk edit view. This would allow users to easily associate pre-existing components with newly installed modules. Yes, I think this would be a good solution for this.
Author
Owner

@jeremystretch commented on GitHub (Mar 31, 2022):

Cool; I'm going to tweak the focus of this issue to enable bulk adding/removing module assignments for components.

@jeremystretch commented on GitHub (Mar 31, 2022): Cool; I'm going to tweak the focus of this issue to enable bulk adding/removing module assignments for components.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6274