---
title: "Attach volume to VM"
method: POST
path: "/api/v1/volumes/{id}/attach"
tags: ["Volumes"]
---

# Attach volume to VM

`POST /api/v1/volumes/{id}/attach`

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.

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

## Path parameters

- `id` integer, required

## Headers

- `X-Project-ID` string, uuid, required

## Request body

- AttachVolumeRequest
  - `vm_id` string, uuid, required — UUID of the VM to attach this volume to. VM must be in the same region as the volume.

## Response `200`

Volume attached

- object
  - `success` boolean
  - `data` Volume
    - `id` integer, required — Volume ID. Use this in `/volumes/{id}` for get, delete, attach, detach, resize.
    - `account_id` string, uuid — Account that owns the volume
    - `project_id` string, uuid — Project the volume belongs to
    - `product_vm` string, uuid — UUID of the VM the volume is currently attached to. Empty when detached.
    - `name` string, required — Volume display name
    - `volume_type` 'nvme', required — Storage class
    - `size` integer, required — Volume size in GB
    - `status` 'creating' | 'available' | 'attached' | 'deleting' | 'failed', required — Volume lifecycle status: - `creating` — being provisioned on the hypervisor - `available` — ready, not attached to any VM - `attached` — attached to a VM (see `product_vm`) - `deleting` — being torn down - `failed` — creation or attach failed
    - `price_per_hour` string — Hourly billing rate in USD
    - `region` 'us-east'
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400` — Invalid request parameters
- `404` — Resource not found

---

[API](https://skmtc.dev/rafftechnologies/apis/raff-api.md) · [All operations](https://skmtc.dev/rafftechnologies/apis/raff-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rafftechnologies/raff-api/revisions/2f4df56be77c/schema)
