For the complete documentation index, see llms.txt. This page is also available as Markdown.

VM Configuration API

Complete guide to modifying VM configurations in VergeOS, including CPU/RAM updates, notes, drive management, and network interface management

Key Points

  • Modify VM settings like CPU, RAM, console, and video through REST API

  • Manage drives with resizing, adding, and removal capabilities

  • Update network interfaces and their configurations

  • Add documentation notes to VMs for operational tracking

This guide covers modifying virtual machine configurations in VergeOS after creation, including CPU/RAM updates, drive management, network interface changes, and adding operational notes.

Stage: VM Configuration (3 of 4) Input: VM key (42) + Machine key (54), configuration changes Output: Updated VM settings, modified hardware Previous: VM powered on → VM Power Management Common Next Steps:

This Document Helps With

  • "How to change VM CPU and RAM"

  • "Adding storage drives to existing VMs"

  • "Resizing VM drives and storage"

  • "Managing VM network interfaces"

  • "Adding notes and documentation to VMs"

  • "Hotplug operations and live changes"

  • "VM performance tuning"

  • "Storage expansion workflows"

  • "Network reconfiguration"

Quick Reference

Primary Endpoints

  • VM Settings: PUT /api/v4/vms/{id}

  • VM Notes: POST /api/v4/note_actions

  • Drive Management: POST/PUT/DELETE /api/v4/machine_drives

  • NIC Management: POST/PUT/DELETE /api/v4/machine_nics

Key Concepts

  • VM key: Use for VM settings (CPU, RAM, console)

  • Machine key: Use for hardware (drives, NICs, devices)

  • Hotplug: Some changes require VM restart

Authentication

Prerequisites

VM must be created first → See VM Creation

API Quick Reference

Operation
Method
Endpoint
Key Type
Purpose

Update VM

PUT

/api/v4/vms/{id}

VM key

CPU, RAM, console settings

Add Note

POST

/api/v4/note_actions

VM key

Documentation

Add Drive

POST

/api/v4/machine_drives

Machine key

Storage expansion

Resize Drive

PUT

/api/v4/machine_drives/{id}

Drive key

Increase disk size

Remove Drive

DELETE

/api/v4/machine_drives/{id}

Drive key

Storage removal

Add NIC

POST

/api/v4/machine_nics

Machine key

Network interface

Update NIC

PUT

/api/v4/machine_nics/{id}

NIC key

Network changes

Remove NIC

DELETE

/api/v4/machine_nics/{id}

NIC key

Interface removal

Troubleshooting Index

  • 400 Bad Request: Invalid RAM size, invalid CPU count, malformed JSON

  • 409 Conflict: VM must be stopped, hotplug not supported, resource in use

  • 507 Insufficient Storage: Tier full, disk size too large, quota exceeded

  • 403 Forbidden: API key permissions, VM access denied, cluster restrictions

  • 422 Unprocessable Entity: Drive cannot be shrunk, invalid interface type

  • 404 Not Found: VM not found, drive not found, NIC not found, invalid vnet

CPU and RAM Updates

PUT /api/v4/vms/{id}

Description: Updates VM configuration. Uses the VM key (not machine key) for VM-level settings.

Request Body Example:

Complete API Call:

Common Configuration Parameters

Parameter
Type
Description
Restart Required

ram

integer

RAM in MB

Usually yes

cpu_cores

integer

Number of CPU cores

Usually yes

console

string

Console type (spice, vnc, none)

On next start

video

string

Video adapter (qxl, virtio, std, cirrus)

On next start

nested_virtualization

string

Enable nested virtualization ("true"/"false")

Yes

disable_hypervisor

string

Disable hypervisor ("true"/"false")

Yes

guest_agent

string

Enable guest agent ("true"/"false")

On next start

uefi

string

Enable UEFI boot ("true"/"false")

Yes

secure_boot

string

Enable secure boot ("true"/"false")

Yes

Adding Notes to VMs

POST /api/v4/note_actions

Description: Adds or updates notes for a VM in the VergeOS UI for documentation purposes.

Request Body:

Complete API Call:

Parameters:

Name
Type
Required
Description

owner

string

Yes

Resource identifier (format: "vms/{vm_key}")

action

string

Yes

Action to perform ("update")

params.text

string

Yes

Note text content

Drive Management

Adding New Drives

Use the machine drives endpoint to add storage after VM creation:

POST /api/v4/machine_drives

Complete API Call:

Resizing Drives

PUT /api/v4/machine_drives/{drive_id}

Description: Increases the size of an existing drive. Note that drives can only be expanded, not shrunk.

Complete API Call:

Removing Drives

Before deletion, drives must be hot-unplugged if the VM is running:

Step 1: Hot-Unplug Drive (if VM is running)

Step 2: Delete the Drive

DELETE /api/v4/machine_drives/{drive_id}

Drive Management Examples

Adding a CDROM/ISO

Adding an Import Drive

Network Interface Management

Adding NICs

POST /api/v4/machine_nics

Complete API Call:

Updating NIC Configuration

PUT /api/v4/machine_nics/{nic_id}

Complete API Call:

Removing NICs

DELETE /api/v4/machine_nics/{nic_id}

NIC Configuration Parameters

Parameter
Type
Required
Description

machine

string

Yes

Machine ID

vnet

string

Yes

Virtual network ID

name

string

No

NIC name

interface

string

No

NIC interface type (virtio, e1000, rtl8139)

enabled

boolean

No

NIC enabled state

Virtual Network Keys

The vnet parameter uses the network's key/ID. You can find network keys by listing available networks via the networks API endpoint.

Complete Configuration Workflow

Here's an example of updating a VM's complete configuration:

Configuration Best Practices

Before Making Changes

  1. Check VM Status: Ensure VM is in appropriate state for changes

  2. Backup Important Data: Create snapshots before major changes

  3. Review Dependencies: Consider impact on running applications

  4. Plan Downtime: Some changes require VM restart

After Making Changes

  1. Verify Configuration: Check that changes were applied correctly

  2. Test Functionality: Ensure VM operates as expected

  3. Update Documentation: Add notes about configuration changes

  4. Monitor Performance: Watch for any performance impacts

Hotplug Considerations

Error Handling

Common Configuration Errors

Error: 400 Bad Request - Invalid RAM size

Error: 409 Conflict - VM must be stopped

Solution: Stop the VM or check hotplug capabilities before making changes.

Error: 507 Insufficient Storage

Solution: Choose different storage tier or reduce disk size.

Related Operations

Need Help?

For additional support with VM configuration:

  • Check the VergeOS documentation portal

  • Contact VergeOS support with specific error messages

  • Review system logs for detailed error information

  • Consult the VergeOS community forums

Last updated

Was this helpful?