devicetype-library icon indicating copy to clipboard operation
devicetype-library copied to clipboard

Add functionality for recording Rack Types for netbox 4.1.0+

Open justin-davisibm opened this issue 1 year ago • 12 comments

I suppose this is more of a discussion on formatting as any logic would likely live in https://github.com/netbox-community/Device-Type-Library-Import, but I'd like to propose the following:

  • Add new top level folder rack-types
  • Children folders will follow the same {{ manufacturer_name }} format as device-types and module-types does today.
  • Add new schema that supports the allowed field options for rack types in Netbox:
    • manufacturer (required)
    • model (required)
    • slug (required)
    • width (required)
    • u_height (required)
    • form_factor (2-post-frame, 4-post-frame, 4-post-cabinet, wall-frame, wall-frame-vertical, wall-cabinet, wall-cabinet-vertical)
    • starting_unit
    • desc_units (boolean)
    • outer_width
    • outer_depth
    • outer_unit (mm, in)
    • mounting_depth
    • weight
    • max_weight
    • weight_unit (kg, g, lb, oz)
    • description
    • comments
    • tags
    • id

This will allow a feature request to Device-Type-Library-Import to support Rack types as an importable object.

justin-davisibm avatar Jan 08 '25 14:01 justin-davisibm

If this gets approved / added, I have access to the following 2 rack types I'd be willing to add files for:

BCurrell avatar Jan 13 '25 00:01 BCurrell

@harryajc, is this possible in current state devicetype-library or is this something that has to come down from upstream netbox?

phillf avatar Jan 25 '25 22:01 phillf

Hey all, could you submit an example file built out for this? Attach it here and I will review. This might work well and if so we would be happy to help build it out/review what you build out

danner26 avatar Feb 01 '25 19:02 danner26

Example / actual file for Startech 42U 4 poster:

---
manufacturer: Startech
model: 4 Post 42U
slug: startech-4postrack42
width: 19
u_height: 42
form_factor: 4-post-frame
description: Startech 4 Post 42U 19in rack with optional casters
starting_unit: 1
outer_width: 600
outer_unit: mm
# Adjustable depth, do we want the minimum or maximum depth?
# Minimum adjusted depth
mounting_depth: 560
# Maximum adjusted depth
# mounting_depth: 1017
weight: 38.5
# Different weights between stationary and on casters, which one?
# Stationary
# max_weight: 600
# Rolling
max_weight: 360
weight_unit: kg

Couple of possible options for mounting_depth and max_weight, not sure which option would be best. And I'm not sure if I need to add a manufacturer somewhere, or if it handles that automatically?

There's no field for this currently, but maybe somewhere we could also put a URL to the product page / specs? Could add that to comments I guess.

BCurrell avatar Feb 01 '25 19:02 BCurrell

Adding a field for spec sheet/datasheet is a good idea.

phillf avatar Feb 02 '25 14:02 phillf

Yeah I also agree with adding a field for the spec sheet as a lot of our racks in our DC have datasheets that are a little hard to find for new techs

GeorgeRyanDev avatar Feb 16 '25 16:02 GeorgeRyanDev

I have a few APC rack types I could probably help import as well

GeorgeRyanDev avatar Feb 16 '25 16:02 GeorgeRyanDev

I don't think we can just add a field to this data. I assume if the field doesn't exist, it'll fail or ignore it. And I doubt we should assume the custom field exists or enforce one. I think the remaining 2 options are:

  • Add the spec sheet as a URL to the comments field, although there is a risk of the URLs dying once a rack is EOL
  • Update netbox to add a spec sheet field that accepts a file, then use that to add a spec sheet in the same way front/back images are loaded

BCurrell avatar Feb 16 '25 17:02 BCurrell

Hello all, in regard to the spec sheet, this has historically been asked to be recorded in the comments. We will continue to allow that, as long as the link is to the official manufacturers website. We do not allow links to 3rd party sites.

Having a dead link to the manufacturers site is much safer than allowing 3rd party links. And the comments section is the best place for this, as it will be imported into NetBox in the device/modules comment area/

danner26 avatar Feb 16 '25 18:02 danner26

Hi @danner26. Does this PR just need the folder structure doing, or is there more to it? I'm happy to create a PR with my above sample rack data and the spec sheet in the comments, but not sure if I'll be able to do anything further without a clear instruction.

BCurrell avatar Feb 16 '25 18:02 BCurrell

Sorry about being a bit AWOL here on my own request.

I would agree with the spec sheet being a URL in comments like normal.

I believe what is needed is the folder structure + the JSON schema but I'm just the requestor

justin-davisibm avatar Feb 20 '25 21:02 justin-davisibm

I implemented it. The Importer is now able to import the Rack-Types.

The Structure is based on everything else, with no special elements.

Can you test if it works on your systems? Thanks!

bastianleicht avatar Apr 18 '25 14:04 bastianleicht