Bulk edit devices: Switching Site fails when devices are racked #10824

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

Originally created by @uedvt359 on GitHub (Feb 28, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.2.4

Python Version

3.11

Steps to Reproduce

  1. select the checkbox of a bunch of devices, e.g. by device type, that are in different sites and are assigned a rack.
  2. click "edit selected" and change the site, selecting "set null" for location.
  3. click "save".

Expected Behavior

The Site should be updated for all selected devices, and the Rack should be cleared.

Alternatively, the rack should be able to be cleared manually, but there is no option for this.

Observed Behavior

The following error toast is displayed in the lower right corner: Rack oldlocation-rack1 does not belong to site newlocation.

It is not possible to edit the Rack/set it to null on the bulk-edit devices page.

Originally created by @uedvt359 on GitHub (Feb 28, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.2.4 ### Python Version 3.11 ### Steps to Reproduce 1. select the checkbox of a bunch of devices, e.g. [by device type](http://netbox.local/dcim/devices/?device_type_id=1234), that are in different sites and are assigned a rack. 2. click "edit selected" and change the site, selecting "set null" for location. 3. click "save". ### Expected Behavior The Site should be updated for all selected devices, and the Rack should be cleared. Alternatively, the rack should be able to be cleared manually, but there is no option for this. ### Observed Behavior The following error toast is displayed in the lower right corner: `Rack oldlocation-rack1 does not belong to site newlocation.` It is not possible to edit the Rack/set it to null on the bulk-edit devices page.
adam closed this issue 2025-12-29 21:36:20 +01:00
Author
Owner

@uedvt359 commented on GitHub (Feb 28, 2025):

I've opened this ticket as a bug, since one cannot bulk-move devices from one location to another right now. But there is an implicit feature request here as well: This bug can be avoided if the bulk-edit page has the option to change/set-null the Rack in addition to Site and Location.

This bug report is solely about the fact that there is no option to bulk-move devices. Adding the option to change/set-null the rack on the bulk-edit page would be one way to solve this.

Reason I ran into this bug is that we have a special 'warehouse' Site for inventory items, and I was decommissioning a bunch of similar devices at once.

@uedvt359 commented on GitHub (Feb 28, 2025): I've opened this ticket as a bug, since one cannot bulk-move devices from one location to another right now. But there is an implicit feature request here as well: This bug can be avoided if the bulk-edit page has the option to change/set-null the Rack in addition to Site and Location. This bug report is solely about the fact that there is no option to bulk-move devices. Adding the option to change/set-null the rack on the bulk-edit page would be one way to solve this. Reason I ran into this bug is that we have a special 'warehouse' Site for inventory items, and I was decommissioning a bunch of similar devices at once.
Author
Owner

@jeremystretch commented on GitHub (Feb 28, 2025):

The Site should be updated for all selected devices, and the Rack should be cleared.

I'm going to disagree with this expectation. NetBox is very careful to avoid assuming the user's intention, as it can lead to unintended consequences: We cannot safely assume that the user intended to clear the rack assignment of all these devices. (It's very possible that the user did not realize that one or more of the devices was assigned to a rack.) Because the user only instructed NetBox to move the devices to a different site, and said nothing about rack assignment, the validation failure is correct and expected.

But there is an implicit feature request here as well: This bug can be avoided if the bulk-edit page has the option to change/set-null the Rack in addition to Site and Location.

This has been proposed recently in FR #18599, which is currently open for volunteers. I'm going to close this out as I believe the use case is addressed by that FR.

@jeremystretch commented on GitHub (Feb 28, 2025): > The Site should be updated for all selected devices, and the Rack should be cleared. I'm going to disagree with this expectation. NetBox is very careful to avoid assuming the user's intention, as it can lead to unintended consequences: We cannot safely assume that the user _intended_ to clear the rack assignment of all these devices. (It's very possible that the user did not realize that one or more of the devices was assigned to a rack.) Because the user only instructed NetBox to move the devices to a different site, and said nothing about rack assignment, the validation failure is correct and expected. > But there is an implicit feature request here as well: This bug can be avoided if the bulk-edit page has the option to change/set-null the Rack in addition to Site and Location. This has been proposed recently in FR #18599, which is currently open for volunteers. I'm going to close this out as I believe the use case is addressed by that FR.
Author
Owner

@uedvt359 commented on GitHub (Mar 3, 2025):

Thanks for the link to the FR - I somehow missed that one.

The problem as I see it is that, as it stands, the Site and Location fields are useless, since they cannot work for the majority of devices.

@uedvt359 commented on GitHub (Mar 3, 2025): Thanks for the link to the FR - I somehow missed that one. The problem as I see it is that, as it stands, the Site and Location fields are useless, since they cannot work for the majority of devices.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10824