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¶
Scope: read or full.
Create a volume¶
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¶
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¶
Scope: full.
Delete a volume¶
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.