Resize a VM
Change the size of a VM. The disk follows the new memory.
POST /v1/tenants/{tenant}/vms/{name}/resize
curl -X POST "https://api.shako.dev/v1/tenants/acme/vms/web1/resize" \
-H "Authorization: Bearer $SHAKO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"size":"mid","restart":true}'200 (excerpt)
{
"name": "web1",
"tenant": "acme",
"state": "awake",
"ssh": "web1.acme.shako.dev",
"vcpus": 1,
"mem_mib": 2048,
"disk_gb": 10
}Authenticate with Authorization: Bearer <API key> on https://api.shako.dev. Role: contributor or owner.
Path parameters
tenantstringrequired- The tenant's name, from GET /v1/tenants.
namestringrequired- The VM's name.
Request body
sizestring (small, mid, large, xl)default: small- The new size: small (1 vCPU, 2 GB memory, 10 GB disk), mid (2 vCPU, 4 GB memory, 20 GB disk), large (4 vCPU, 8 GB memory, 40 GB disk), xl (4 vCPU, 16 GB memory, 80 GB disk).
cpusinteger, 1 to 256- Custom vCPUs: 1 or an even number. Only the vCPUs change.
memorystring- Custom memory, for example "3G" or "2560M". The disk is 5 GB for each GB of memory. Only the memory and the disk change.
restartbooleandefault: false- true: a VM that is awake or asleep may restart for the resize. Without it, Shako refuses to restart it.
Response
200 with the VM object.
Behavior
A VM that is awake or asleep restarts, and only with restart: true.
The errors. All the endpoints of VMs.