Virtual Machines
- POST /compute/vms/attach-disk
Attach disk
Attach an existing volume to a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/attachiso
Attach ISO to VM
Attach an ISO image to a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/byID
GetVirtualMachineByID
Get virtual machine details by ID
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/byName
GetVirtualMachineByName
Get virtual machine details by name
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/configure-tpm
Configure VM firmware (boot type, Secure Boot, vTPM)
Set a stopped instance’s boot type (BIOS/UEFI), Secure Boot, and virtual TPM (version + model). Maps to VM details (UEFI=LEGACY|SECURE; virtual.tpm.model/version) — BIOS removes the UEFI detail and an empty tpm_model removes the TPM. Takes effect on the next start. Only allowed while the instance is stopped.
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/create-and-attach-disk
Create and attach disk
Create a new disk volume and attach it to a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/create-console
CreateConsole
Create a console for a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- DELETE /compute/vms/delete-disk
Delete disk
Delete a volume from the system
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/destroy
Destroy a VM
Destroy a virtual machine instance
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/detach-disk
Detach disk
Detach a volume from a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/detachiso
Detach ISO from VM
Detach an ISO image from a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- DELETE /compute/vms/expunge
Expunge a VM
Permanently remove a destroyed virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/getIdbyName
GetVirtualMachineID
Get virtual machine ID by name
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- GET /compute/vms/isos
List available ISOs
Get a list of all available ISO images
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/list
ListVirtualMachines
Get a list of virtual machines with optional filters
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/list-for-import
ListVmsForImport
Get a list of VMs available for import
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- GET /compute/vms/metrics/aggregate
Aggregate VM metrics
Returns aggregated CPU, memory, disk IOPS and network metrics across all virtual machines
- Status Codes:
200 OK – Aggregated VM metrics
500 Internal Server Error – Internal server error
- Response JSON Object:
averages.cpu_used_percent (number)
averages.disk_iops_total (number)
averages.memory_used_percent (number)
averages.network_kbs_total (number)
generated_at (string)
latest_sample_time (string)
state_counts.destroyed (integer)
state_counts.expunged (integer)
state_counts.other (integer)
state_counts.running (integer)
state_counts.stopped (integer)
totals.cpu_total_mhz (number)
totals.cpu_used_mhz (number)
totals.cpu_used_percent_sum (number)
totals.disk_io_read (integer)
totals.disk_io_write (integer)
totals.disk_iops_total (integer)
totals.disk_kbs_read (integer)
totals.disk_kbs_write (integer)
totals.memory_assigned_kbs (integer)
totals.memory_internal_free_kbs (integer)
totals.memory_target_kbs (integer)
totals.memory_used_kbs (integer)
totals.network_kbs_read (integer)
totals.network_kbs_total (integer)
totals.network_kbs_write (integer)
virtual_machine_count (integer)
- POST /compute/vms/migrate
MigrateVirtualMachine
Migrate a virtual machine to another host
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/nic/add
Add NIC to VM
Add a network interface card to an existing virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/nic/ip/add
Add secondary IP to NIC
Add a secondary IP address to an existing NIC. CS auto-allocates from the network pool when ip_address omitted.
- Status Codes:
200 OK – Secondary IP added
400 Bad Request – Invalid request payload
500 Internal Server Error – Failed to add IP to NIC
- POST /compute/vms/nic/ip/remove
Remove secondary IP from NIC
Remove a secondary IP from a NIC by its NIC-secondary-IP id (NOT the IP address)
- Status Codes:
200 OK – Secondary IP removed
400 Bad Request – Invalid request payload
500 Internal Server Error – Failed to remove IP from NIC
- POST /compute/vms/nic/ip/update
Reconfigure primary IP of NIC
Reconfigure the primary IP of a NIC. The VM should be in Stopped state; CS may reject otherwise.
- Status Codes:
200 OK – NIC primary IP updated
400 Bad Request – Invalid request payload
500 Internal Server Error – Failed to update NIC IP
- POST /compute/vms/nic/list
List NICs on a VM
List NICs attached to a virtual machine, optionally filtered by nic_id / network_id / keyword with pagination
- Status Codes:
200 OK – List of NICs
400 Bad Request – Invalid request payload
500 Internal Server Error – Failed to list NICs
- DELETE /compute/vms/nic/remove
Remove NIC from virtual machine
Remove a network interface card from a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/nic/set-default
Set default NIC for VM
Promote a NIC to default for a VM. VM should be in Running or Stopped state (not Migrating/Starting).
- Status Codes:
200 OK – Default NIC updated
400 Bad Request – Invalid request payload
500 Internal Server Error – Failed to update default NIC
- POST /compute/vms/provision
Provision a new virtual machine
Create and provision a new virtual machine instance
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
409 Conflict – Capacity threshold exceeded
500 Internal Server Error – Internal server error
- POST /compute/vms/reboot
Reboot virtual machine
Reboot a virtual machine instance
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/recover
Recover virtual machine
Recover a failed virtual machine instance
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/restore
Restore virtual machine
Restore a virtual machine from backup or snapshot
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/routers
List Virtual Routers
Get a list of CloudStack virtual routers with optional filters (zone, host, pod, state, network, VPC)
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/scale
Scale virtual machine
Scale computing resources for a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/settings/compute
Update VM compute
Resize a VM’s compute — swap service offering and/or set custom cpu/memory on a dynamic offering. Branches live-scale (KVM, scale-up, dynamic offering, Running) vs stopped (changeServiceForVirtualMachine). Admin-only.
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/settings/detail-options
VM settings detail options
Allowed values per VM-settings field (mirrors CloudStack listDetailOptions). Keyed by field name; empty list = free numeric/text. Admin-only.
- Status Codes:
200 OK – Success response
500 Internal Server Error – Internal server error
- POST /compute/vms/settings/get
Get VM settings
Read the curated hardware-detail settings, raw display=true detail map, and compute/scale metadata for a VM. Admin-only.
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/settings/update
Update VM settings
Apply curated hardware-detail edits and/or the full raw detail map (read-merge-write — the update REPLACES the displayable detail map, so the full intended map is always sent) plus top-level fields and extraconfig. Admin-only; stop-guarded by default.
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/start
Start virtual machine
Start a stopped virtual machine instance
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/stop
Stop virtual machine
Stop a running virtual machine instance
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/systemvms
List System VMs
Get a list of CloudStack system VMs with optional filters (type, zone, host, pod, state)
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/update
Update VM configuration
Update the configuration of an existing virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/update-affinity
Update VM affinity groups
Update the affinity groups associated with a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- PUT /compute/vms/update-disksize
Update disk
Update configuration of an existing disk volume
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- GET /compute/vms/usage-history
List VM usage history
Retrieve usage history and metrics for virtual machines
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/usage-history-byID
VirtualMachinesUsageHistoryByID
Get usage history for a specific virtual machine by ID
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error
- POST /compute/vms/userdata/reset
Reset user data for VM
Reset user data configuration for a virtual machine
- Status Codes:
200 OK – Success response
400 Bad Request – Invalid request payload
500 Internal Server Error – Internal server error