Closes #5795: Add Virtual Machine Type model #73

Closed
opened 2026-04-05 16:21:29 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @pheus on 3/26/2026

Fixes: #5795

This PR introduces VirtualMachineType to classify virtual machines and provide default values for platform, vCPUs, and memory when a VM is created.

We chose the classification + create-time defaults approach here because it adds practical value beyond metadata alone, while keeping the scope well-defined. It solves the immediate need to model VM types natively in NetBox and avoids overloading Platform, without jumping straight into full DeviceType-style templating for interfaces and disks.

Defaults are only applied at creation time, explicit values on the VM always take precedence, and updating a VirtualMachineType does not retroactively change existing virtual machines.

The implementation includes the new model and its relationship to VirtualMachine, along with support across forms, filtersets, tables, views, the REST API, GraphQL, navigation, search, documentation, and tests.

The design is also intended to leave the door open for a more template-oriented approach in the future if there is a stronger need to model VMInterface and VirtualDisk templates as well.

*Originally created by @pheus on 3/26/2026* ### Fixes: #5795 This PR introduces `VirtualMachineType` to classify virtual machines and provide default values for platform, vCPUs, and memory when a VM is created. We chose the **classification + create-time defaults** approach here because it adds practical value beyond metadata alone, while keeping the scope well-defined. It solves the immediate need to model VM types natively in NetBox and avoids overloading `Platform`, without jumping straight into full `DeviceType`-style templating for interfaces and disks. Defaults are only applied at creation time, explicit values on the VM always take precedence, and updating a `VirtualMachineType` does not retroactively change existing virtual machines. The implementation includes the new model and its relationship to `VirtualMachine`, along with support across forms, filtersets, tables, views, the REST API, GraphQL, navigation, search, documentation, and tests. The design is also intended to leave the door open for a more template-oriented approach in the future if there is a stronger need to model `VMInterface` and `VirtualDisk` templates as well.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#73