netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.15k stars 2.58k forks source link

Rack SVG rending oddity when 0U device assigned to an RU #4578

Closed 2bithacker closed 4 years ago

2bithacker commented 4 years ago

Environment

Steps to Reproduce

  1. Have a DeviceType with a 0U size
  2. Assign a device of that type to a rack unit
  3. View the Rack

Expected Behavior

Not really sure what the correct representation of a 0U device in an RU should be, but at least it shouldn't alter the rendering of other devices in the rack.

Observed Behavior

The 0U device is rendered oddly, with it's name halfway through a U boundary. 1U devices get duplicated in incorrect RUs. Larger devices get 1U dups.

jeremystretch commented 4 years ago

I'm not able to reproduce this with the steps outlined above. It seems you need to:

  1. Create a 1U device type
  2. Install a device of that type in a rack
  3. Modify the device type to be 0U
  4. Render the rack SVG
fsedano commented 4 years ago

Hello folks @jeremystretch - If the fix is to NOT allow a 0U size on a rack, that will break me.

My use case: I have 10s of Access Points in a particular shelf on a rack. They're really piled up, so they're in a rack but they're 0U. Any suggestion here?

jeremystretch commented 4 years ago

@fsedano 0U devices may be assigned to a rack, just not to a specific position. This has always been the case; this fix merely addresses a condition in which the validation could be bypassed by modifying a device type that was previously 1U+.

fsedano commented 4 years ago

Thanks Jeremy - If it's not in a specific position, what do you suggest to use for this use case (i.e. a lot of small devices in a shelf in a position in the rack). I.e. raspberry PIs, access points, etc. We have multiple shelves per Rack, each of them at a given position, so we have like 30 RPis on each shelf.

2bithacker commented 4 years ago

You could have a Device Type for a generic rack shelf with a number of device bays for the things on the shelf.

fsedano commented 4 years ago

You could have a Device Type for a generic rack shelf with a number of device bays for the things on the shelf.

Thanks for the hint!