Add decommissioning as device status #2516

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

Originally created by @clercrobin on GitHub (Apr 15, 2019).

Environment

  • Python version: 3.6.7
  • NetBox version: 2.5.10

Proposed Functionality

To extend the issue #154, we want to add a status decommissioning to the already existing status list:

  • offline
  • active
  • planned
  • staged
  • failed
  • inventory

Use Case

We are currently using Netbox as our asset management system, in addition to its DCIM functionality and are quite happy with this. A valuable output from Netbox would be a forecasting vision enabled by a status like planned. However it is not sufficient to complete this functionality and thus to indicate that a machine will be soon offline we want to add the status decommissioning.

It would enable the 2 following views:

  • Current status: Active + decommissioning
  • Forecast: Active + planned

Database Changes

The device statuses lines (314 - 328) of the file netbox\dcim\constants.py would change to:

STATUS_OFFLINE = 0
STATUS_ACTIVE = 1
STATUS_PLANNED = 2
STATUS_STAGED = 3
STATUS_FAILED = 4
STATUS_INVENTORY = 5
STATUS_DECOMMISSIONING = 6
DEVICE_STATUS_CHOICES = [
    [DEVICE_STATUS_ACTIVE, 'Active'],
    [DEVICE_STATUS_OFFLINE, 'Offline'],
    [DEVICE_STATUS_PLANNED, 'Planned'],
    [DEVICE_STATUS_STAGED, 'Staged'],
    [DEVICE_STATUS_FAILED, 'Failed'],
    [DEVICE_STATUS_INVENTORY, 'Inventory'],
    [DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'],
]

External Dependencies

No external dependancy

Originally created by @clercrobin on GitHub (Apr 15, 2019). <!-- NOTE: 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/forum/#!forum/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.7 * NetBox version: 2.5.10 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality To extend the issue #154, we want to add a status **decommissioning** to the already existing status list: - offline - active - planned - staged - failed - inventory <!-- 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 We are currently using Netbox as our asset management system, in addition to its DCIM functionality and are quite happy with this. A valuable output from Netbox would be a forecasting vision enabled by a status like **planned**. However it is not sufficient to complete this functionality and thus to indicate that a machine will be soon offline we want to add the status **decommissioning**. It would enable the 2 following views: - Current status: Active + decommissioning - Forecast: Active + planned <!-- 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 The device statuses lines (314 - 328) of the file netbox\dcim\constants.py would change to: ```python STATUS_OFFLINE = 0 STATUS_ACTIVE = 1 STATUS_PLANNED = 2 STATUS_STAGED = 3 STATUS_FAILED = 4 STATUS_INVENTORY = 5 STATUS_DECOMMISSIONING = 6 DEVICE_STATUS_CHOICES = [ [DEVICE_STATUS_ACTIVE, 'Active'], [DEVICE_STATUS_OFFLINE, 'Offline'], [DEVICE_STATUS_PLANNED, 'Planned'], [DEVICE_STATUS_STAGED, 'Staged'], [DEVICE_STATUS_FAILED, 'Failed'], [DEVICE_STATUS_INVENTORY, 'Inventory'], [DEVICE_STATUS_DECOMMISSIONING, 'Decommissioning'], ] ``` <!-- 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 No external dependancy
adam closed this issue 2025-12-29 18:19:34 +01:00
Author
Owner

@kasimon commented on GitHub (Apr 16, 2019):

Even when not (mis-)using netbox as an asset management tool, having a decomissioning (or to-be-decomissioned) status would be valuable, as it would make clear that the device is not ment to be repaired or taken back online, but is still taking up space in the datacenter until it has been removed from the rack and from netbox. So +1 from me.

@kasimon commented on GitHub (Apr 16, 2019): Even when not (mis-)using netbox as an asset management tool, having a decomissioning (or to-be-decomissioned) status would be valuable, as it would make clear that the device is not ment to be repaired or taken back online, but is still taking up space in the datacenter until it has been removed from the rack and from netbox. So +1 from me.
Author
Owner

@paravoid commented on GitHub (Apr 17, 2019):

+1 this, but (despite how much I like opinionated software) I would actually argue in favor of making all statuses site-configurable, e.g. via the admin panel, rather than trying to have a one-setting-fits-all.

Wikimedia has mapped Netbox's statuses to our own stages but I think we'd be better served if we were able to rename them to fit our own terminology, as well as add or remove stages as needed.

If that makes sense we can take a stab at implementing that, although I suspect it may be relatively trivial for someone that already knows the codebase :)

@paravoid commented on GitHub (Apr 17, 2019): +1 this, but (despite how much I like opinionated software) I would actually argue in favor of making all statuses site-configurable, e.g. via the admin panel, rather than trying to have a one-setting-fits-all. Wikimedia has mapped Netbox's statuses to [our own stages](https://wikitech.wikimedia.org/wiki/Server_Lifecycle) but I think we'd be better served if we were able to rename them to fit our own terminology, as well as add or remove stages as needed. If that makes sense we can take a stab at implementing that, although I suspect it may be relatively trivial for someone that already knows the codebase :)
Author
Owner

@mmahacek commented on GitHub (Apr 19, 2019):

@clercrobin check the last two lines of your sample status choices. I like the idea of a status to indicate a planned removal, but do prefer to have the reasons curated and not customizable per server.

@mmahacek commented on GitHub (Apr 19, 2019): @clercrobin check the last two lines of your sample status choices. I like the idea of a status to indicate a planned removal, but do prefer to have the reasons curated and not customizable per server.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2516