Power ports for USB #4253

Closed
opened 2025-12-29 18:34:15 +01:00 by adam · 7 comments
Owner

Originally created by @garbled1 on GitHub (Nov 7, 2020).

Originally assigned to: @ndom91 on GitHub.

Environment

  • Python version: 3.6
  • NetBox version: 2.9.8

Proposed Functionality

USB style power ports/plugs/etc

Would want the same ones offered in console ports:

USB Type A
USB Type B
USB Type C
USB Mini A
USB Mini B
USB Micro A
USB Micro B

(I'm not sure, is that actually all the USB types these days?)

Use Case

Many smaller devices these days use things like USB-A, MicroUSB, mini-usb, USB-C etc etc for power. While a single PI might be powered directly by a wall-wart adapter, multiple ones might be powered by something like a USB charger, which has one NEMA style plug, and then 10 USB ports. You can code this into netbox by just saying everything is type OTHER, but that's not very precise.

It's very difficult for me to accurately track IOT style devices or PI-Clusters, etc etc accurately without this.

Database Changes

External Dependencies

Originally created by @garbled1 on GitHub (Nov 7, 2020). Originally assigned to: @ndom91 on GitHub. <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/g/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6 * NetBox version: 2.9.8 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality USB style power ports/plugs/etc Would want the same ones offered in console ports: USB Type A USB Type B USB Type C USB Mini A USB Mini B USB Micro A USB Micro B (I'm not sure, is that actually all the USB types these days?) <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case Many smaller devices these days use things like USB-A, MicroUSB, mini-usb, USB-C etc etc for power. While a single PI might be powered directly by a wall-wart adapter, multiple ones might be powered by something like a USB charger, which has one NEMA style plug, and then 10 USB ports. You can code this into netbox by just saying everything is type OTHER, but that's not very precise. It's very difficult for me to accurately track IOT style devices or PI-Clusters, etc etc accurately without this. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies
adam added the status: acceptedtype: feature labels 2025-12-29 18:34:15 +01:00
adam closed this issue 2025-12-29 18:34:15 +01:00
Author
Owner

@ypid commented on GitHub (Nov 8, 2020):

I assume you only checked out interface ports. Checkout console ports. All your USB types are supported. I misread this "Would want the same ones offered in console ports:", sorry. Also, this "You can code this into netbox by just saying everything is type OTHER, but that's not very precise." confused me.

However, I think for your use case power outlets would be more suitable. Refer to https://netbox.readthedocs.io/en/stable/core-functionality/device-types/ for the details. And there is no "Other" port type for power. I would propose to extend the PowerPortTypeChoices with "Other". As USB powering is not really common (in the data center), I would propose to not model all the USB types as power outlets. At a maximum USB type C because of the USB Power Delivery (USB PD) (rather don’t do that because USB type C does both, data and power). Every other type use is probably violating the USB spec anyway. Using the Netbox power model would also allow you to track power usage of your USB devices, see https://netbox.readthedocs.io/en/stable/core-functionality/power/

Modeling external power supplies that are just for one device is easy. You can just abstract it away and think of it as being part of the device itself. Your use case with multiple outlets is kind of a PDU that can be modeled like this https://netbox.readthedocs.io/en/stable/core-functionality/power/, considering that there is a "Other" type.

On the other hand, I feel this is slightly related to #1099 because USB is basically a console port (compared to an interface as in #1099) that can also provide power. But again, I feel this is too uncommon in the data center.

@ypid commented on GitHub (Nov 8, 2020): ~~I assume you only checked out interface ports. Checkout console ports. All your USB types are supported.~~ I misread this "Would want the same ones offered in console ports:", sorry. Also, this "You can code this into netbox by just saying everything is type OTHER, but that's not very precise." confused me. However, I think for your use case power outlets would be more suitable. Refer to https://netbox.readthedocs.io/en/stable/core-functionality/device-types/ for the details. And there is no "Other" port type for power. I would propose to extend the `PowerPortTypeChoices` with "Other". As USB powering is not really common (in the data center), I would propose to not model all the USB types as power outlets. ~~At a maximum USB type C because of the USB Power Delivery (USB PD)~~ (rather don’t do that because USB type C does both, data and power). Every other type use is probably violating the USB spec anyway. Using the Netbox power model would also allow you to track power usage of your USB devices, see https://netbox.readthedocs.io/en/stable/core-functionality/power/ Modeling external power supplies that are just for one device is easy. You can just abstract it away and think of it as being part of the device itself. Your use case with multiple outlets is kind of a PDU that can be modeled like this https://netbox.readthedocs.io/en/stable/core-functionality/power/, considering that there is a "Other" type. On the other hand, I feel this is slightly related to #1099 because USB is basically a console port (compared to an interface as in #1099) that can also provide power. But again, I feel this is too uncommon in the data center.
Author
Owner

@garbled1 commented on GitHub (Nov 8, 2020):

I agree this isn't necc. common in a datacenter, but is netbox only designed for datacenters? I'm using it to map my homelab out, and it's very useful for this.

Maybe it's a spec violation, but the fact remains that I have a bunch of objects that I model in Netbox that have a USB-something power port, and then plug into something else. Sometimes that's a wall-wart. Sometimes I have direct charging ports on outlets, sometimes I have multiple-port USB power systems.

These are not consoles, they are power. I have USB consoles, which I do use the modelling for, and it's great.

@garbled1 commented on GitHub (Nov 8, 2020): I agree this isn't necc. common in a datacenter, but is netbox only designed for datacenters? I'm using it to map my homelab out, and it's very useful for this. Maybe it's a spec violation, but the fact remains that I have a bunch of objects that I model in Netbox that have a USB-something power port, and then plug into something else. Sometimes that's a wall-wart. Sometimes I have direct charging ports on outlets, sometimes I have multiple-port USB power systems. These are not consoles, they are power. I have USB consoles, which I do use the modelling for, and it's great.
Author
Owner

@ypid commented on GitHub (Nov 8, 2020):

My current use case for Netbox is also not the typical data center. Still, https://netbox.readthedocs.io/en/stable/#keep-it-simple applies (at least how I see it, I am not a Netbox dev). So would you agree with my proposal to just add a "Other" power outlet type? Note that I once had a feature request that was also a bit special which is actually related to yours, see #5013. Maybe the description field together with the "Other" type solves it? We don’t need to overdo it, right ;-) ?

@ypid commented on GitHub (Nov 8, 2020): My current use case for Netbox is also not the typical data center. Still, https://netbox.readthedocs.io/en/stable/#keep-it-simple applies (at least how I see it, I am not a Netbox dev). So would you agree with my proposal to just add a "Other" power outlet type? Note that I once had a feature request that was also a bit special which is actually related to yours, see #5013. Maybe the description field together with the "Other" type solves it? We don’t need to overdo it, right ;-) ?
Author
Owner

@garbled1 commented on GitHub (Nov 10, 2020):

I think "Other" type power port is certainly useful in general. I can imagine things like 48v systems or 12v systems that aren't as easily covered. But at this point USB used as power is becoming kind of a standard. They sell 19" rackmount USB PDU's (a few of which I've been eyeing). I have 1 rackmount PDU that has 2 USB charging ports on it. I mean "Other" is certainly better than saying all my PI's are using nema15's into some kind of magical PDU instead of a giant charging station, but its also obnoxious. The device has 2 type C's and 8 type A's, so, how do I differentiate that? The point is I want to go into netbox and look and say "oh, ok, I have a free type C there, so I can plug in this device on that power unit"

It's not impossible to work around, and it doesn't make netbox useless or anything silly like that, but the reality is a bunch of stuff is just powered by USB now, and I suspect this will only continue to grow as power requirements get lower for things.

@garbled1 commented on GitHub (Nov 10, 2020): I think "Other" type power port is certainly useful in general. I can imagine things like 48v systems or 12v systems that aren't as easily covered. But at this point USB used as power is becoming kind of a standard. They sell 19" rackmount USB PDU's (a few of which I've been eyeing). I have 1 rackmount PDU that has 2 USB charging ports on it. I mean "Other" is certainly better than saying all my PI's are using nema15's into some kind of magical PDU instead of a giant charging station, but its also obnoxious. The device has 2 type C's and 8 type A's, so, how do I differentiate that? The point is I want to go into netbox and look and say "oh, ok, I have a free type C there, so I can plug in this device on that power unit" It's not impossible to work around, and it doesn't make netbox useless or anything silly like that, but the reality is a bunch of stuff is just powered by USB now, and I suspect this will only continue to grow as power requirements get lower for things.
Author
Owner

@jeremystretch commented on GitHub (Nov 16, 2020):

IMO it makes sense to add USB ports and outlets as types in the same right as the existing types. However, further thought needs to be given to what specific USB types qualify as power outputs (outlets) and consumers (ports). I'm tagging this as "needs owner" for whoever would like to volunteer.

@jeremystretch commented on GitHub (Nov 16, 2020): IMO it makes sense to add USB ports and outlets as types in the same right as the existing types. However, further thought needs to be given to what specific USB types qualify as power outputs (outlets) and consumers (ports). I'm tagging this as "needs owner" for whoever would like to volunteer.
Author
Owner

@ndom91 commented on GitHub (Nov 19, 2020):

I've done a little research, and next to the typical USB Type A port, it looks like theres only a few others than can act as outlets, including micro-USB and the newer USB-C.

image

https://en.wikipedia.org/wiki/USB#Power

All others can receive power afaik.

I can go ahead and add those are power outlets / power ports in a separate section in the types dropdown. Anything else that needs to be watched out for here?

@ndom91 commented on GitHub (Nov 19, 2020): I've done a little research, and next to the typical USB Type A port, it looks like theres only a few others than can act as outlets, including micro-USB and the newer USB-C. ![image](https://user-images.githubusercontent.com/7415984/99725459-77114600-2ab5-11eb-975a-0b735d6c383d.png) > https://en.wikipedia.org/wiki/USB#Power All others can receive power afaik. I can go ahead and add those are power outlets / power ports in a separate section in the types dropdown. Anything else that needs to be watched out for here?
Author
Owner

@jeremystretch commented on GitHub (Nov 19, 2020):

@ndom91 sounds good, I'll assign this to you. 👍

@jeremystretch commented on GitHub (Nov 19, 2020): @ndom91 sounds good, I'll assign this to you. :+1:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4253