Disallow deletion of physical port if there are objects depending on it #8890

Closed
opened 2025-12-29 20:42:33 +01:00 by adam · 2 comments
Owner

Originally created by @dejantep on GitHub (Nov 28, 2023).

NetBox version

3.5.7

Feature type

Change to existing functionality

Proposed functionality

User should not be able to delete a physical port if:

  • port has cable attached
  • port is parent to other interfaces such as LAG and virtual child interfaces

Every attempt to delete a port under those circumstances should result in "denied" message with text "port in use" or similar.
If possible message should show objects that are blocking deletion, similar to another FR that has been accepted.

Use case

In my opinion this is fundamental feature of a system like Netbox where you need to keep your data in order. There should be a natural hierarchy of elements that are depending on each other. Just like you cannot remove site if there are devices assigned to it.

This would keep objects safe from accidental removal and possible nightmare with orphan objects.

Database changes

not sure

External dependencies

none

Originally created by @dejantep on GitHub (Nov 28, 2023). ### NetBox version 3.5.7 ### Feature type Change to existing functionality ### Proposed functionality User should not be able to delete a physical port if: * port has cable attached * port is parent to other interfaces such as LAG and virtual child interfaces Every attempt to delete a port under those circumstances should result in "denied" message with text "_port in use_" or similar. If possible message should show objects that are blocking deletion, similar to another FR that has been accepted. ### Use case In my opinion this is fundamental feature of a system like Netbox where you need to keep your data in order. There should be a natural hierarchy of elements that are depending on each other. Just like you cannot remove site if there are devices assigned to it. This would keep objects safe from accidental removal and possible nightmare with orphan objects. ### Database changes not sure ### External dependencies none
adam added the type: feature label 2025-12-29 20:42:33 +01:00
adam closed this issue 2025-12-29 20:42:33 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 27, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Feb 27, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Mar 27, 2024):

While I can appreciate the use case, there are valid competing use cases that depend on the current behavior. NetBox v3.7 extended the deletion confirmation dialog so that it now lists any dependent objects that will also be deleted as a consequence of deleting the primary object (see #13690). This provides a nice compromise to help safeguard against inadvertent deletions without inhibiting workflows which depend on cascading object deletions.

@jeremystretch commented on GitHub (Mar 27, 2024): While I can appreciate the use case, there are valid competing use cases that depend on the current behavior. NetBox v3.7 extended the deletion confirmation dialog so that it now lists any dependent objects that will also be deleted as a consequence of deleting the primary object (see #13690). This provides a nice compromise to help safeguard against inadvertent deletions without inhibiting workflows which depend on cascading object deletions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8890