Skip to content

Resize a VPS disk

POST /api/v2/vps/{id}/actions/resize-disk

Make an existing disk on a VPS bigger. Find diskId and the disk’s actions.canResize gate with GET /api/v2/vps/{id}/disks. With incremental: true, sizeGb is the amount to add. Otherwise it is the new size of the disk.

On a regular VPS this works for extra disks. The growth uses attachable storage you have already bought. It must be at most attachable.availableGb from GET /api/v2/vps/{id}/storage-quota. Buy more with resources.additionalStorageGb on POST /api/v2/vps/{id}/actions/config. The primary disk of a regular VPS grows through the storageGb option of the same endpoint. This call refuses it with 403. On a Cloud VPS the growth counts toward the account’s Cloud VPS storage limit. It must be at most remaining.storageGb from GET /api/v2/vps/payg/limits. Above the limit the call returns 403 cloud_storage_limit_exceeded.

The disk is bigger when the call returns. Grow the partition and the file system inside the operating system to use the new space.

Authentication: An API key with the scopes write:vm and write:storage. About keys and scopes

Request

Path parameters

idstringrequired
The VPS ID (vps_…).

Body

diskIdstringrequired
The disk ID (vpsdisk_…) from GET /api/v2/vps/{id}/disks.
sizeGbintegerrequired
GB to add with incremental: true, otherwise the new size in GB. A whole number from 1 to 1000. 1 to 1000.
incrementalboolean
Add sizeGb to the current size instead of setting it. Default false.

Example

POST /api/v2/vps/{id}/actions/resize-disk
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/resize-disk" \
-H "Authorization: Bearer $HOSTUP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"diskId": "vpsdisk_01hxa3b4c5d6e7f8g9h0j1k2m3",
"sizeGb": 50,
"incremental": true
}'

Responses

200 The disk is resized.

Response 200
{
"disk": {
"id": "vpsdisk_01hxa3b4c5d6e7f8g9h0j1k2m3",
"sizeGb": 50,
"incremental": true
}
}
Response fields
diskobject
idstring
The disk ID.
sizeGbinteger
The sizeGb you sent. With incremental: true it is the amount added, not the new size.
incrementalboolean
The incremental you sent.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403The disk cannot grow. cloud_storage_limit_exceeded: it would go over the Cloud VPS storage limit. forbidden: there is not enough attachable storage. The same code comes back for the primary disk of a regular VPS and when the key may not change this VPS.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.