Return a list of all available rack space prior to creating rack reservation #1084

Closed
opened 2025-12-29 16:28:39 +01:00 by adam · 3 comments
Owner

Originally created by @cmccallan on GitHub (Jul 10, 2017).

Issue type: Feature Request

**Python version: 2.7
**NetBox version: 2.0

Prior to making a rack reservation we currently manually check in Racks for free space before allocating, as /api/dcim/racks doesn't return information on what is currently in a rack or on what unit. We'd like to be able to query all racks and return a list of available space and units for each.

We think writing a script that will automate rack allocation could be useful in taking away some of the back and forth between the networks team and provisioning teams and improve how up-to-date our information on netbox is.

Originally created by @cmccallan on GitHub (Jul 10, 2017). <!-- Please note: GitHub issues are to be used only for feature requests and bug reports. For installation assistance or general discussion, please join us on the mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please indicate "bug report" or "feature request" below. Be sure to search the existing set of issues (both open and closed) to see if a similar issue has already been raised. --> ### Issue type: Feature Request <!-- If filing a bug, please indicate the version of Python and NetBox you are running. (This is not necessary for feature requests.) --> **Python version: 2.7 **NetBox version: 2.0 <!-- If filing a bug, please record the exact steps taken to reproduce the bug and any errors messages that are generated. If filing a feature request, please precisely describe the data model or workflow you would like to see implemented, and provide a use case. --> Prior to making a rack reservation we currently manually check in Racks for free space before allocating, as /api/dcim/racks doesn't return information on what is currently in a rack or on what unit. We'd like to be able to query all racks and return a list of available space and units for each. We think writing a script that will automate rack allocation could be useful in taking away some of the back and forth between the networks team and provisioning teams and improve how up-to-date our information on netbox is.
adam closed this issue 2025-12-29 16:28:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 10, 2017):

/api/dcim/racks doesn't return information on what is currently in a rack or on what unit

The API endpoint at /api/dcim/racks/<pk>/units/ provides this information. Note that you can view the front or rear rack face by passing ?face=0 (default) or ?face=1 respectively. Does this address your requirement? If not, please detail the exact change(s) you're proposing per the contributing guidelines.

@jeremystretch commented on GitHub (Jul 10, 2017): > /api/dcim/racks doesn't return information on what is currently in a rack or on what unit The API endpoint at `/api/dcim/racks/<pk>/units/` provides this information. Note that you can view the front or rear rack face by passing `?face=0` (default) or `?face=1` respectively. Does this address your requirement? If not, please detail the exact change(s) you're proposing per the [contributing guidelines](https://github.com/digitalocean/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@cmccallan commented on GitHub (Jul 11, 2017):

Didn't realize /api/dcim/racks/<pk>/units/ provided something like this, having issues with it but I posted it in the forum rather than here.

What ideally I think would be a good enhancement is having something like /api/dcim/racks/<units_needed>/ that returns the free space on a rack and their unit number(s) where the <units_needed> are all directly beside each other. Information this spits out could then be used by an ops engineer and separately pushed into a jira ticket, removing back and forth of discussion between the various networks/ops teams as to what unit(s) to allocate for a server.

Don't think any schema changes or 3rd party libraries would be needed, it would be using already present information to return a particular unit or units that can then be reserved.

@cmccallan commented on GitHub (Jul 11, 2017): Didn't realize `/api/dcim/racks/<pk>/units/` provided something like this, having issues with it but I posted it in the forum rather than here. What ideally I think would be a good enhancement is having something like `/api/dcim/racks/<units_needed>/` that returns the free space on a rack and their unit number(s) where the <units_needed> are all directly beside each other. Information this spits out could then be used by an ops engineer and separately pushed into a jira ticket, removing back and forth of discussion between the various networks/ops teams as to what unit(s) to allocate for a server. Don't think any schema changes or 3rd party libraries would be needed, it would be using already present information to return a particular unit or units that can then be reserved.
Author
Owner

@jeremystretch commented on GitHub (Jul 11, 2017):

Provisioning rack space is typically more involved than requesting n free units. You need to consider power availability, direction of airflow, total weight, etc. This is why NetBox simply provides all free units within a rack and relies on a human to select from that.

@jeremystretch commented on GitHub (Jul 11, 2017): Provisioning rack space is typically more involved than requesting _n_ free units. You need to consider power availability, direction of airflow, total weight, etc. This is why NetBox simply provides all free units within a rack and relies on a human to select from that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1084