Grow the disk
POST/api/v1/vms/{vm_uuid}/disk/resize
Grows the root disk while the server runs. A disk cannot shrink. Systems from our images grow their filesystem by themselves; with disk auto-extend on, the server does this on its own before the disk fills up.
Parameters
| Name | In | Description |
|---|---|---|
| vm_uuid | path, stringrequired | Server id, from Create a VM or List VMs |
Request body
| Field | Type | Description |
|---|---|---|
| new_size_gb | integerrequired | New root disk size, GB; bigger than now |
Example request
curl -X POST "https://platform.serverscamp.com/api/v1/vms/$VM_UUID/disk/resize" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"new_size_gb": 100
}'import os, requests
token = os.environ["API_TOKEN"]
vm_uuid = "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34"
r = requests.post(
f"https://platform.serverscamp.com/api/v1/vms/{vm_uuid}/disk/resize",
headers={"Authorization": f"Bearer {token}"},
json={
"new_size_gb": 100
},
)
r.raise_for_status()
print(r.json())const vmUuid = '6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34';
const r = await fetch(`https://platform.serverscamp.com/api/v1/vms/${vmUuid}/disk/resize`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.API_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({
"new_size_gb": 100
}),
});
console.log(r.status, await r.json());Answer
Status 200 with this body.
| Field | Type | Description |
|---|---|---|
| vm_uuid | stringrequired | |
| status | stringrequired | queued: the change runs in the background while the server runs |
| disk_gb | integerrequired | Root disk size after the change, GB |
| storage_class_id | integerrequired | Disk id after the change |
{
"vm_uuid": "6f1c2a9e-4b3d-4e8a-9c71-2d5e8f0a1b34",
"status": "queued",
"disk_gb": 100,
"storage_class_id": 18
}Errors
| Status | When |
|---|---|
400 | Not bigger than now, or above the disk's largest size |
401 | No token, or a token that is not valid |
409 | The server is busy with another operation |
422 | The body or a parameter is not what the operation takes |
Every operation can also answer 401 without a valid token. All errors