Replies: 3 comments 3 replies
-
As far as I can see, the attribute is indeed
which is seen as
This might be broken caching of the count of device bays on a device. To test this theory, try
If the count is zero then it suppresses the tab in the GUI. If that is the problem, it could be down to how you're adding the device bays to the device. The safest option would be to put device bay templates in the device type, and then they'll be created automatically whenever you instantiate a device from the device type. If you're adding the device bays manually, then make sure you're using individual save() for each one and not using bulk_create(), because the latter bypasses the post-save hooks which update the count. Here's a similar change I had to do: https://github.com/netbox-community/customizations/pull/101/files Also, you must always call EDIT: it's also not impossible you've found a bug of course, but in that case first I suggest you update to v3.7.8 to pick up any hidden bugfixes in that train, and then write a small standalone custom script which replicates the behaviour you're experiencing. Then it's clear if the bug is in the script itself, or deeper inside Netbox. |
Beta Was this translation helpful? Give feedback.
-
Thanks for all you do for the NetBox community, I learn so much from you, keep up the awesome work!
|
Beta Was this translation helpful? Give feedback.
-
Alternative workaround I found on another device 🦆 Do as @candlerb says, call |
Beta Was this translation helpful? Give feedback.
-
I cannot find the correct Documentation or an example script and am wondering how I would add a Device to a DeviceBay.
When working with modules, creating a Module one can pass the target bay with the
module_bay
parameter, but there is nodevice_bay
parameter inDevice
(at least in 3.7.3).It does not appear to be correct to set
installed_device
of the target bay, since this breaks in frontend, such that/dcim/devices/{device_id}/
page does not show a tab "Device Bays" anymore, but navigating to/dcim/devices/{device_id}/device-bays/
correctly shows a table of bays and the devices set in theinstalled_device
field.My goal is to create fully populated blade server chassis. The device types have their "parent"/"child" flags set correctly and for every chassis I create 12 blades in a loop, but I am lacking a way to assign the blades to the correct bay.
Beta Was this translation helpful? Give feedback.
All reactions