Removing module from bay does not delete cables associated with its interfaces #7038

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

Originally created by @mmfreitas on GitHub (Sep 28, 2022).

NetBox version

v3.3.4

Python version

3.9

Steps to Reproduce

  1. Create a Site "Test_Site" with "Active" status
  2. Create Manufacturer "Cisco"
  3. Create Device Role "Test Role"
  4. Create a Module Type "Module_Test" with manufacturer "Cisco" and create interfaces "Gi{module}/[1-4]" of type "SFP (1GE)"
  5. Create a Device Type "Device_Type_Test" with manufacturer "Cisco" and add a module bay "Slot 0" with position "0"
  6. Create two devices "Device_Test_1" and "Device_Test_2" of type "Device_Type_Test", role "Test Role" and in site "Test_Site"
  7. Install in module bay of each device the created module "Module_Test"
  8. Connect any interface from "Device_Test_1" to any interface in "Device_Test_2" with any cable
  9. Remove module bay installed on "Device_Test_1"
  10. Navigate to "Device_Test_2" and check interfaces, the cable is still associated with the interface even though there is a missing termination.

Expected Behavior

When the module is removed (deleted), all the components and sub-consequently every object that is associated with a component of that module should be deleted as well.

Observed Behavior

The module is removed (deleted), it's component's are deleted, but cables associated with that module interface are kept on the database (maybe other objects are kept as well, didn't test this option).

Originally created by @mmfreitas on GitHub (Sep 28, 2022). ### NetBox version v3.3.4 ### Python version 3.9 ### Steps to Reproduce 1. Create a Site "Test_Site" with "Active" status 1. Create Manufacturer "Cisco" 2. Create Device Role "Test Role" 3. Create a Module Type "Module_Test" with manufacturer "Cisco" and create interfaces "Gi{module}/[1-4]" of type "SFP (1GE)" 4. Create a Device Type "Device_Type_Test" with manufacturer "Cisco" and add a module bay "Slot 0" with position "0" 5. Create two devices "Device_Test_1" and "Device_Test_2" of type "Device_Type_Test", role "Test Role" and in site "Test_Site" 6. Install in module bay of each device the created module "Module_Test" 7. Connect any interface from "Device_Test_1" to any interface in "Device_Test_2" with any cable 8. Remove module bay installed on "Device_Test_1" 9. Navigate to "Device_Test_2" and check interfaces, the cable is still associated with the interface even though there is a missing termination. ### Expected Behavior When the module is removed (deleted), all the components and sub-consequently every object that is associated with a component of that module should be deleted as well. ### Observed Behavior The module is removed (deleted), it's component's are deleted, but cables associated with that module interface are kept on the database (maybe other objects are kept as well, didn't test this option).
adam added the type: bug label 2025-12-29 19:48:11 +01:00
adam closed this issue 2025-12-29 19:48:11 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 28, 2022):

Per the bug report template, please rewrite your issue above so that it does not rely on references to public demo data, which may be modified or erased at any time.

@jeremystretch commented on GitHub (Sep 28, 2022): Per the bug report template, please rewrite your issue above so that it does not rely on references to public demo data, which may be modified or erased at any time.
Author
Owner

@mmfreitas commented on GitHub (Sep 28, 2022):

Per the bug report template, please rewrite your issue above so that it does not rely on references to public demo data, which may be modified or erased at any time.

I've rewritten the "steps to reproduce" to not rely on demo data.

@mmfreitas commented on GitHub (Sep 28, 2022): > Per the bug report template, please rewrite your issue above so that it does not rely on references to public demo data, which may be modified or erased at any time. I've rewritten the "steps to reproduce" to not rely on demo data.
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2022):

Navigate to "Device_Test_2" and check interfaces, the cable is still associated with the interface even though there is a missing termination.

This is expected behavior. The interfaces from the first device have been deleted, however the cable remains connected to the interfaces on the second device. This change was introduced in NetBox v3.3 as a result of the improved cabling model.

You may be interested in FR #9837, which proposes disabling the deletion of any device components with a cable still attached, which would avoid this. However, there are valid use cases for retaining the current behavior.

@jeremystretch commented on GitHub (Oct 3, 2022): > Navigate to "Device_Test_2" and check interfaces, the cable is still associated with the interface even though there is a missing termination. This is expected behavior. The interfaces from the first device have been deleted, however the cable remains connected to the interfaces on the second device. This change was introduced in NetBox v3.3 as a result of the improved cabling model. You may be interested in FR #9837, which proposes disabling the deletion of any device components with a cable still attached, which would avoid this. However, there _are_ valid use cases for retaining the current behavior.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7038