Copy device location from rack
NetBox version
v4.0.6
Feature type
Change to existing functionality
Proposed functionality
When creating or editing a device, all racks in a location are selectable, including racks in child locations. If you select a rack in a child location, saving the device is rejected with this error message:
Rack RACK01 does not belong to location PARENT.
Therefore, I suggest that all racks of a location (including child locations) can be selected in the form. When saving, the location of the device will be replaced by the location of the rack, thus automatically correcting it if needed.
Steps to reproduce:
- Create location PARENT
- Create child location CHILD
- Create rack RACK01 in CHILD
- Create new device. Select location PARENT and RACK01 as rack.
- Save
Use case
The structure of the locations is entirely up to the NetBox user. A typical scenario could be to have parent locations for the room and child locations for the rack rows named "R1", "R2", ... in each room. Searching for the room is quite easy because it is unique. Finding the right rack row is not as easy, as there are several with the same name.
Also, it seems a bit odd that the racks are selectable in the UI and the backend does not accept the user's choice.
Database changes
None
External dependencies
None