Volumes

Attach volume to VM

Changed on

Attach a volume to a VM. The VM must be in the same region as the volume. A volume can only be attached to one VM at a time — detach it first if it's already attached elsewhere.

A Cost-Optimized server keeps its volumes on its node: it takes the volumes created to attach to a Cost-Optimized server, and they attach to no other server. A volume created on its own attaches to General Purpose, CPU-Optimized and Windows servers.

Inside the guest, the volume appears as /dev/vdb, /dev/vdc, etc. (virtio-blk).

post/api/v1/volumes/{id}/attach

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/volumes/{id}/attach
  • Auth
    API key in header X-API-Key

Path parameters

idinteger required

Volume ID

Headers

X-Project-IDstring uuid required

Project ID. Required for all mutating operations (create, delete, power actions, resize).

Request body

vm_idstring uuid required

UUID of the VM to attach this volume to. VM must be in the same region as the volume.

Response

Volume attached

successboolean

Example response

{
  "data": {
    "name": "data-vol-1",
    "volume_type": "nvme",
    "size": 100
  }
}

Changes