virtual machine model - field adjustments to better suit vm concepts #9328

Closed
opened 2025-12-29 20:48:35 +01:00 by adam · 2 comments
Owner

Originally created by @ITJamie on GitHub (Mar 7, 2024).

NetBox version

v3.7.3

Feature type

Data model extension

Proposed functionality

new fields:
"is_template" field - boolean type - to denote if a VM is a template VM which gets used to clone new vms
"bios_type" field - choices - legacy or uefi options

adjustments:
status field - extend default choices with - suspended (or paused)

Use case

the status field doesn't account for the fact that vms can be paused

the template field would be useful for documenting what templates exist in a cluster
the bios type field would let us document if a VM is uefi or legacy bios

these are pretty standard concepts across most hypervisors (vmware vcenter, proxmox, xcp-ng as examples where all the above apply) and would be useful in the standard model rather than custom fields

Database changes

two additional fields on virtual machine model

External dependencies

No response

Originally created by @ITJamie on GitHub (Mar 7, 2024). ### NetBox version v3.7.3 ### Feature type Data model extension ### Proposed functionality new fields: "is_template" field - boolean type - to denote if a VM is a template VM which gets used to clone new vms "bios_type" field - choices - legacy or uefi options adjustments: status field - extend default choices with - suspended (or paused) ### Use case the status field doesn't account for the fact that vms can be paused the template field would be useful for documenting what templates exist in a cluster the bios type field would let us document if a VM is uefi or legacy bios these are pretty standard concepts across most hypervisors (vmware vcenter, proxmox, xcp-ng as examples where all the above apply) and would be useful in the standard model rather than custom fields ### Database changes two additional fields on virtual machine model ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:48:35 +01:00
adam closed this issue 2025-12-29 20:48:35 +01:00
Author
Owner

@troycarpenter commented on GitHub (Mar 14, 2024):

FYI, the status field can already be extended using the FIELD_CHOICES configuration parameter in configuration.py. In fact, I added "Paused" and "Template" to my installation based on your suggestion.

It would look like this:

FIELD_CHOICES = {
    'virtualization.VirtualMachine.status+': (
        ('paused', 'Paused', 'pink'),
        ('template', 'Template', 'orange'),
    )
}

(Edit: Fixed link to the docs)

@troycarpenter commented on GitHub (Mar 14, 2024): FYI, the status field can already be extended using the [FIELD_CHOICES](https://docs.netbox.dev/en/stable/configuration/data-validation/#field_choices) configuration parameter in configuration.py. In fact, I added "Paused" and "Template" to my installation based on your suggestion. It would look like this: ``` FIELD_CHOICES = { 'virtualization.VirtualMachine.status+': ( ('paused', 'Paused', 'pink'), ('template', 'Template', 'orange'), ) } ``` (Edit: Fixed link to the docs)
Author
Owner

@jeremystretch commented on GitHub (Apr 3, 2024):

@ITJamie you've proposed three somewhat related but separate changes. Please open a separate FR for each, including detailed use cases.

@jeremystretch commented on GitHub (Apr 3, 2024): @ITJamie you've proposed three somewhat related but separate changes. Please open a separate FR for each, including detailed use cases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9328