Update a virtual machine
Updating a virtual machine changes only the fields in its update mask. This guide explains how disk identities behave when an update replaces the disk list.
Before you begin
Section titled “Before you begin”- Authentication. Export an authenticated bearer token as
QIBDO_API_TOKENand the API base URL asQIBDO_BASE_URL. See Authenticate a user and manage the session. - Permissions. Your identity needs permission to update the VM in its workspace. See the authorization model.
- Current VM. Export the target workspace and VM identifiers as
QIBDO_WORKSPACEandQIBDO_VM.
Keep the disk identities you already have
Section titled “Keep the disk identities you already have”A disk identifier is server-assigned. Read the VM before changing its disks and keep the returned identifier for every disk that remains attached. Do not choose an identifier for a new disk.
If an update contains a disk identifier that does not belong to that VM, omits an identifier, or repeats one, the platform ignores that value and assigns a new identifier. This prevents one VM update from reusing a disk identity that belongs to another VM or workspace.
Update the VM
Section titled “Update the VM”Put only the fields that you intend to change in the request body, and set an
update_mask for those fields. To replace the disk list, use disks in the
mask. The VM object in the body contains the desired disks; existing disks keep
the identifiers that the preceding read returned.
curl -X PATCH \ "$QIBDO_BASE_URL/compute/v1/workspaces/$QIBDO_WORKSPACE/engines/qibdo/vms/$QIBDO_VM?update_mask=disks" \ -H "Authorization: Bearer $QIBDO_API_TOKEN" \ -H "Content-Type: application/json" \ --data @vm-update.jsonThe update returns an operation. Track it to completion, then read the VM back to obtain the authoritative disk list and its server-assigned identifiers.
Use the generated API reference supplied by your deployment for the complete request and response shape.
- API standards: field-mask behaviour and output-only fields.