Editing device bay da0 #4414

Closed
opened 2025-12-29 18:35:46 +01:00 by adam · 4 comments
Owner

Originally created by @n4zmz on GitHub (Dec 29, 2020).

Screen Shot 2020-12-29 at 4 23 43 PM
Trying to update the description on a device bay and it reports that the device does not support device bays.
Screen Shot 2020-12-29 at 4 25 52 PM

Originally created by @n4zmz on GitHub (Dec 29, 2020). ![Screen Shot 2020-12-29 at 4 23 43 PM](https://user-images.githubusercontent.com/72481599/103314985-48f71e00-49f2-11eb-87a8-93af7ea2dd54.png) Trying to update the description on a device bay and it reports that the device does not support device bays. ![Screen Shot 2020-12-29 at 4 25 52 PM](https://user-images.githubusercontent.com/72481599/103315071-8d82b980-49f2-11eb-8e28-fa1023b63995.png)
adam closed this issue 2025-12-29 18:35:47 +01:00
Author
Owner

@candlerb commented on GitHub (Jan 4, 2021):

It appears that device "trueNas-01" is linked to device type "Slicestor".

Can you open the "Slicestor" device type, and check what it says for "Parent/child status"? This can be one of:

  • empty (-----)
  • Parent
  • Child

This needs to be set to "Parent" to allow device bays to be created (or edited).

(If this fixes the problem, then the issue becomes one of data consistency: how the device bays were created in the first place when the device wasn't a parent, or how the status was changed from "Parent" to "-----" when bays already existed)

@candlerb commented on GitHub (Jan 4, 2021): It appears that device "trueNas-01" is linked to device type "Slicestor". Can you open the "Slicestor" device type, and check what it says for "Parent/child status"? This can be one of: - empty (`-----`) - Parent - Child This needs to be set to "Parent" to allow device bays to be created (or edited). (If this fixes the problem, then the issue becomes one of data consistency: how the device bays were created in the first place when the device wasn't a parent, or how the status was changed from "Parent" to "-----" when bays already existed)
Author
Owner

@n4zmz commented on GitHub (Jan 4, 2021):

The device type "Slicestor" was set to "----". Changing it to Parent fixed
the editing issue.

The type was created with interfaces and device bays with the parent status
blank. It stills allows this behavior at v2.10.2.

Process:
Device type add
Manufacturer: IBM
Model: store2
Rest left at default (parent/child is ---------)
click create
click add components and select device bays
Name: da[0-11]
click create

I did add interfaces as well, but not necessary to reproduce the issue.

Create a device with the new type and try and edit one of the device bays.
Which will fail due to the parent status not being set.

On Mon, Jan 4, 2021 at 6:30 AM Brian Candler notifications@github.com
wrote:

It appears that device "trueNas-01" is linked to device type "Slicestor".

Can you open the "Slicestor" device type, and check what it says for
"Parent/child status"? This can be one of:

  • empty (-----)
  • Parent
  • Child

This needs to be set to "Parent" to allow device bays to be created (or
edited).

(If this fixes the problem, then the issue becomes one of data
consistency: how the device bays were created in the first place when the
device wasn't a parent, or how the status was changed from "Parent" to
"-----" when bays already existed)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netbox-community/netbox/issues/5550#issuecomment-753922975,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ARI7WP5YHNJNSLUFTHJ3EYDSYGRHHANCNFSM4VNUBEJQ
.

@n4zmz commented on GitHub (Jan 4, 2021): The device type "Slicestor" was set to "----". Changing it to Parent fixed the editing issue. The type was created with interfaces and device bays with the parent status blank. It stills allows this behavior at v2.10.2. Process: Device type add Manufacturer: IBM Model: store2 Rest left at default (parent/child is ---------) click create click add components and select device bays Name: da[0-11] click create I did add interfaces as well, but not necessary to reproduce the issue. Create a device with the new type and try and edit one of the device bays. Which will fail due to the parent status not being set. On Mon, Jan 4, 2021 at 6:30 AM Brian Candler <notifications@github.com> wrote: > It appears that device "trueNas-01" is linked to device type "Slicestor". > > Can you open the "Slicestor" device type, and check what it says for > "Parent/child status"? This can be one of: > > - empty (-----) > - Parent > - Child > > This needs to be set to "Parent" to allow device bays to be created (or > edited). > > (If this fixes the problem, then the issue becomes one of data > consistency: how the device bays were created in the first place when the > device wasn't a parent, or how the status was changed from "Parent" to > "-----" when bays already existed) > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netbox-community/netbox/issues/5550#issuecomment-753922975>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ARI7WP5YHNJNSLUFTHJ3EYDSYGRHHANCNFSM4VNUBEJQ> > . >
Author
Owner

@candlerb commented on GitHub (Jan 4, 2021):

Good catch. If the device type template allows bays to be added, even when the device type is not set to "Parent", I think that's a separate bug you can raise, and close this one.

The validation already exists in class DeviceBay in netbox/dcim/models/device_components.py:

    def clean(self):
        super().clean()

        # Validate that the parent Device can have DeviceBays
        if not self.device.device_type.is_parent_device:
            raise ValidationError("This type of device ({}) does not support device bays.".format(
                self.device.device_type
            ))

A corresponding check needs adding to DeviceBayTemplate in netbox/dcim/models/device_component_templates.py

@candlerb commented on GitHub (Jan 4, 2021): Good catch. If the device type template allows bays to be added, even when the device type is not set to "Parent", I think that's a separate bug you can raise, and close this one. The validation already exists in class DeviceBay in `netbox/dcim/models/device_components.py`: ``` def clean(self): super().clean() # Validate that the parent Device can have DeviceBays if not self.device.device_type.is_parent_device: raise ValidationError("This type of device ({}) does not support device bays.".format( self.device.device_type )) ``` A corresponding check needs adding to DeviceBayTemplate in `netbox/dcim/models/device_component_templates.py`
Author
Owner

@n4zmz commented on GitHub (Jan 4, 2021):

Closing the device issue and creating a device_type/template issue.

@n4zmz commented on GitHub (Jan 4, 2021): Closing the device issue and creating a device_type/template issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4414