Attach a disk to a server
POST
Attaches an available disk to a running server in the same zone, then mounts it at its mount folder. Returns an operation to track it.
Access: API key: vm:write · Session: developer, admin or owner.
- A new disk is formatted (ext4) the first time it is mounted. A disk that cannot be mounted automatically stays attached, unmounted, with a
note; its data is never changed. - Different zones, a stopped server or a server at its disk limit return
400or409.
header
AuthorizationBearer <token>Send Authorization: Bearer <token>. A token is an API key (lb_live_…, scoped, for programs) or a session (lb_sess_…, from signup or login, for people). See Authentication above.
id*stringThe resource id.
X-Org-ID?stringSessions only: act on this organization (you must be a member). Default: your first organization.
application/json- body
vm_id*stringAccepted: the disk is being attached
application/json- response
volume*A Premium disk. It is billed on its own and keeps its data when detached.
operation*curl -X POST 'https://layerbeat.com/v1/volumes/string/attach' \ -H 'Content-Type: application/json' \ -d '{ "vm_id": "vm_gnkrp6zuxvsqki7sqxeluvsw2y"}'{ "volume": { "id": "vol_k3q9w2m7c4x8z5t6v1b0n2h4ra", "name": "data", "status": "available", "type": "premium", "region": "sgp", "zone": "sgp-1", "size_gb": 50, "server": null, "mount_path": "/mnt/data", "mounted": false, "term_months": 1, "billing": { "currency": "USD", "amount": "3.89" }, "price_per_gb_month": { "USD": "0.07770", "IDR": "1384" }, "expires_at": "2026-11-10T10:00:00Z", "note": null, "created_at": "2026-10-10T10:00:00Z", "deleted_at": null }, "operation": { "id": "op_4yw4xmradad4bstgr4d5qtreb4", "type": "volume.attach", "status": "pending", "vm_id": null, "volume_id": "vol_k3q9w2m7c4x8z5t6v1b0n2h4ra", "steps": [ { "name": "attaching", "status": "running" }, { "name": "mounting", "status": "pending" } ], "result": null, "error": null, "created_at": "2026-10-10T10:00:00Z", "finished_at": null }}