Skip to content
sistemo.io beta
GitHub Docs Quickstart

Volumes

Persistent disks you can attach to a machine. Data on a volume survives the machine being destroyed and recreated.

Base URL: https://api.sistemo.io · all requests require authentication.

List volumes

GET /v1/volumes

Scope: read or full.

curl https://api.sistemo.io/v1/volumes \
  -H "Authorization: Bearer $SISTEMO_API_KEY"

Create a volume

POST /v1/volumes

Scope: full.

Field Type Notes
name string Label
size_gb int Size in GB
curl -X POST https://api.sistemo.io/v1/volumes \
  -H "Authorization: Bearer $SISTEMO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"data","size_gb":10}'

Attach a volume

POST /v1/volumes/{id}/attach

Scope: full. The machine must be stopped and on the same host. Body identifies the target machine:

curl -X POST "https://api.sistemo.io/v1/volumes/$VOL/attach" \
  -H "Authorization: Bearer $SISTEMO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"machine_id":"'"$MACHINE"'"}'

Detach a volume

POST /v1/volumes/{id}/detach

Scope: full.

Delete a volume

DELETE /v1/volumes/{id}

Scope: full. The volume must not be attached.

Durability test

Write a string to a volume, destroy the machine, reattach to a new one — the data survives:

# in machine A (volume mounted at /mnt/data):
echo "hello $(date)" > /mnt/data/test.txt
# destroy A, create B, attach the same volume, then:
cat /mnt/data/test.txt   # the string is still there

See also: Machines · the SDK close(preserve_storage=True) keeps a machine's root disk as a volume.