Repository: netbox-community/netbox

Issue:
Status Decommissioning missing for virtual machines
### Environment
* Python version:  3.6.9
* NetBox version:   2.7.4

### Proposed Functionality
Currently a virtual machine can only have as status:
* Active
* Offline
* Staged

I'm missing here at least Decommissioning as status.

### Use Case
I would distinguish between Offline and Decommissioning in this way:

**Offline** is a VM that is temporary powered off and will be later powered on again.
**Decommissioning** is a VM that is powered off and will be later deleted.

Our decommissioning process is actually to power off a VM and then wait a reasonable time if still someone came up who needs this VM.
Being able to set Decommissioning as status would help to track VM's  planned for decommissioning.

Maybe it also makes sense to use for virtual machines the same status as for devices.
If you think of devices as hardware servers, the same processes are often used for hardware servers and VM's. Having the same status choices for both of them would help here.

### Database Changes
None

### External Dependencies
None



Discussion:
This is reasonable to me. when it accepted, let me set Decommissioning to virtual machine.

This change will be like this. LEGACY_MAP might not be necessary?
```
class VirtualMachineStatusChoices(ChoiceSet):

    STATUS_ACTIVE = 'active'
    STATUS_OFFLINE = 'offline'
    STATUS_STAGED = 'staged'
    STATUS_DECOMMISSIONING = 'decommissioning'

    CHOICES = (
        (STATUS_ACTIVE, 'Active'),
        (STATUS_OFFLINE, 'Offline'),
        (STATUS_STAGED, 'Staged'),
        (STATUS_DECOMMISSIONING, 'Decommissioning'),
    )

    LEGACY_MAP = {
        STATUS_OFFLINE: 0,
        STATUS_ACTIVE: 1,
        STATUS_STAGED: 3,
        STATUS_DECOMMISSIONING: 4,
    }
```

Resolving patch:
diff --git a/netbox/virtualization/choices.py b/netbox/virtualization/choices.py
--- a/netbox/virtualization/choices.py
+++ b/netbox/virtualization/choices.py
@@ -8,14 +8,20 @@
 
 class VirtualMachineStatusChoices(ChoiceSet):
 
-    STATUS_ACTIVE = 'active'
     STATUS_OFFLINE = 'offline'
+    STATUS_ACTIVE = 'active'
+    STATUS_PLANNED = 'planned'
     STATUS_STAGED = 'staged'
+    STATUS_FAILED = 'failed'
+    STATUS_DECOMMISSIONING = 'decommissioning'
 
     CHOICES = (
-        (STATUS_ACTIVE, 'Active'),
         (STATUS_OFFLINE, 'Offline'),
+        (STATUS_ACTIVE, 'Active'),
+        (STATUS_PLANNED, 'Planned'),
         (STATUS_STAGED, 'Staged'),
+        (STATUS_FAILED, 'Failed'),
+        (STATUS_DECOMMISSIONING, 'Decommissioning'),
     )
 
     LEGACY_MAP = {
diff --git a/netbox/virtualization/models.py b/netbox/virtualization/models.py
--- a/netbox/virtualization/models.py
+++ b/netbox/virtualization/models.py
@@ -267,9 +267,12 @@ class VirtualMachine(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
     ]
 
     STATUS_CLASS_MAP = {
-        'active': 'success',
-        'offline': 'warning',
-        'staged': 'primary',
+        VirtualMachineStatusChoices.STATUS_OFFLINE: 'warning',
+        VirtualMachineStatusChoices.STATUS_ACTIVE: 'success',
+        VirtualMachineStatusChoices.STATUS_PLANNED: 'info',
+        VirtualMachineStatusChoices.STATUS_STAGED: 'primary',
+        VirtualMachineStatusChoices.STATUS_FAILED: 'danger',
+        VirtualMachineStatusChoices.STATUS_DECOMMISSIONING: 'warning',
     }
 
     class Meta:


Test patch: