# Snapshots and forks

Save the disk of a VM, start new VMs from the saved copy, and fork a running VM in one step.

Source: https://slashinfra.com/docs/platform/snapshots
Last modified: 2026-11-30T16:36:19.000Z

A snapshot captures the writable disk of one VM. It keeps files and their contents, not memory or running programs, and the VM keeps running while the capture is made. A snapshot stays in the project of its VM: a VM create that names a snapshot of another project answers 404 `snapshot_not_found`.

A fork captures a running VM and starts a new VM from that disk in one step.

## Create a snapshot

A capture starts at once and answers with state `creating`; the VM keeps running, and a sleeping VM is captured without waking. The snapshot turns `ready` when the capture finishes, or `failed` if it does not complete. Without a name it is `<VM name or id>-YYYYMMDD-HHMMSS`, cut to 32 characters. The samples use a VM named `app` with `v1` in `/home/user/note.txt`; `si create --name app` creates it, and `si exec app -- sh -c 'echo v1 > /home/user/note.txt'` writes the file.

### Dashboard

- Open [SVMs](https://app.slashinfra.com/svms) and select `app`. 
- Select More actions, then Snapshot. 
- Enter `before-upgrade` in Name. 
- Select Create snapshot. The Snapshots tab of `app` lists it as `creating`, then `ready`.

### CLI

```bash
si snapshot create app --name before-upgrade
```

Output

```text
0zs0pshr3x
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/svms/app/snapshots" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"before-upgrade"}'
```

Output

```text
{"id":"0zs0pshr3x","project":"proj_6f1c0f0e8a","name":"before-upgrade","state":"creating","kind":"user","error":null,"source":"6f1c0f0e8a","created_ms":1795958251456,"expires_ms":null,"logical_bytes":0,"stored_bytes":0,"used_by":[]}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/svms/app/snapshots",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"name": "before-upgrade"},
)
res.raise_for_status()
snapshot = res.json()
print(snapshot["id"], snapshot["state"])
```

Output

```text
0zs0pshr3x creating
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/svms/app/snapshots', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'before-upgrade' }),
})
if (!res.ok) throw new Error(await res.text())
const snapshot = (await res.json()) as { id: string; state: string }
console.log(snapshot.id, snapshot.state)
```

Output

```text
0zs0pshr3x creating
```

## List snapshots

List returns every snapshot of one project, newest first. `used_by` names the VMs that read each snapshot, including asleep and deleting ones, and a snapshot with an entry there cannot be deleted. The CLI table shows the source VM, the stored size and the used-by list.

### Dashboard

- Open [Snapshots](https://app.slashinfra.com/svms/snapshots). The table lists every snapshot of the active project with Name, Created, Size, Source, State and Used by.

### CLI

```bash
si snapshot ls
```

Output

```text
id          name            state  stored   created               source      used by
0zs0pshr3x  before-upgrade  ready  9.8 KiB  2026-11-29 13:17:31Z  6f1c0f0e8a  -
```

### curl

```bash
curl -sS "https://api.slashinfra.com/snapshots" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
[{"id":"0zs0pshr3x","project":"proj_6f1c0f0e8a","name":"before-upgrade","state":"ready","kind":"user","error":null,"source":"6f1c0f0e8a","created_ms":1795958251456,"expires_ms":null,"logical_bytes":1544192,"stored_bytes":10014,"used_by":[]}]
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/snapshots",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
for snapshot in res.json():
print(snapshot["id"], snapshot["name"], snapshot["state"])
```

Output

```text
0zs0pshr3x before-upgrade ready
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/snapshots', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const snapshots = (await res.json()) as { id: string; name: string; state: string }[]
for (const snapshot of snapshots) console.log(snapshot.id, snapshot.name, snapshot.state)
```

Output

```text
0zs0pshr3x before-upgrade ready
```

## Get a snapshot

Get returns one snapshot. A name resolves in the `project` query, `default` when omitted; an id resolves in every project of the organization. `logical_bytes` is the used part of the disk and `stored_bytes` the compressed bytes the capture uploaded; a chunk the shared store already held counts 0, so `stored_bytes` is not the current storage cost. Both are 0 while the state is `creating`. The CLI and dashboard have no single-snapshot view.

### curl

```bash
curl -sS "https://api.slashinfra.com/snapshots/before-upgrade" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
{"id":"0zs0pshr3x","project":"proj_6f1c0f0e8a","name":"before-upgrade","state":"ready","kind":"user","error":null,"source":"6f1c0f0e8a","created_ms":1795958251456,"expires_ms":null,"logical_bytes":1544192,"stored_bytes":10014,"used_by":[]}
```

### Python

```python
import os, requests

res = requests.get(
"https://api.slashinfra.com/snapshots/before-upgrade",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
snapshot = res.json()
print(snapshot["name"], snapshot["state"], snapshot["kind"], snapshot["used_by"])
```

Output

```text
before-upgrade ready user []
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/snapshots/before-upgrade', {
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
const snapshot = (await res.json()) as { name: string; state: string; kind: string; used_by: string[] }
console.log(snapshot.name, snapshot.state, snapshot.kind, JSON.stringify(snapshot.used_by))
```

Output

```text
before-upgrade ready user []
```

## Rename a snapshot

Rename changes the name and keeps the id, disk, state, kind, source and expiry. The new name follows the VM name rules and is unique in the project; a name another snapshot of the project has answers 409 `name_taken`. A VM started from the snapshot keeps reading it.

### Dashboard

- Open [Snapshots](https://app.slashinfra.com/svms/snapshots). 
- Select the pencil icon (Rename before-upgrade) on the row. 
- Enter `app-before-upgrade` in New name for before-upgrade. 
- Select the check icon (Save the name of before-upgrade).

### CLI

```bash
si snapshot rename before-upgrade app-before-upgrade
```

Output

```text
renamed to app-before-upgrade
```

### curl

```bash
curl -sS -X PATCH "https://api.slashinfra.com/snapshots/before-upgrade" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"app-before-upgrade"}'
```

Output

```text
{"id":"0zs0pshr3x","project":"proj_6f1c0f0e8a","name":"app-before-upgrade","state":"ready","kind":"user","error":null,"source":"6f1c0f0e8a","created_ms":1795958251456,"expires_ms":null,"logical_bytes":1544192,"stored_bytes":10014,"used_by":[]}
```

### Python

```python
import os, requests

res = requests.patch(
"https://api.slashinfra.com/snapshots/before-upgrade",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"name": "app-before-upgrade"},
)
res.raise_for_status()
print(res.json()["name"])
```

Output

```text
app-before-upgrade
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/snapshots/before-upgrade', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'app-before-upgrade' }),
})
if (!res.ok) throw new Error(await res.text())
console.log(((await res.json()) as { name: string }).name)
```

Output

```text
app-before-upgrade
```

## Start a VM from a snapshot

A VM create names the snapshot with `snapshot` (`--snapshot`), by name in the new VM’s project or by id. The disk starts from the snapshot; memory and running programs do not, so start your services yourself. A `creating` snapshot is accepted, and the first request waits for the capture. The memory of the new VM is 2048, 4096, 8192 or 16384 MiB.

### Dashboard

- Open [Snapshots](https://app.slashinfra.com/svms/snapshots). 
- Select Start SVM on the `app-before-upgrade` row. 
- Enter `app-restored` in Name. 
- Select Create SVM.

### CLI

```bash
si create --name app-restored --snapshot app-before-upgrade
```

Output

```text
7a2b3c4d5e
```

```bash
si exec app-restored -- cat /home/user/note.txt
```

Output

```text
v1
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/svms" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"app-restored","snapshot":"app-before-upgrade"}'
```

Output

```text
{"id":"7a2b3c4d5e","project":"proj_6f1c0f0e8a","url":"https://7a2b3c4d5e.slashinfra.dev/bin/bash","region":"eu-gra","expires_at":null,"generation":1,"labels":{}}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/svms",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"name": "app-restored", "snapshot": "app-before-upgrade"},
)
res.raise_for_status()
print(res.json()["id"])
```

Output

```text
7a2b3c4d5e
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/svms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'app-restored', snapshot: 'app-before-upgrade' }),
})
if (!res.ok) throw new Error(await res.text())
const vm = (await res.json()) as { id: string }
console.log(vm.id)
```

Output

```text
7a2b3c4d5e
```

`app-restored` has `v1` in `/home/user/note.txt`. Nothing that ran on `app` is running.

## Fork a VM

A fork takes a snapshot of a VM and starts a new VM from it in one step. The create names the source with `fork_of` (`--fork`), and `fork_of` excludes `snapshot`. The capture is a `fork` snapshot named `fork-of-<source>-<time>`, which does not count against the plan quota and is deleted with the last VM that reads it. The fork does not stop or wake the source VM.

### Dashboard

- Open [SVMs](https://app.slashinfra.com/svms) and select `app`. 
- Select More actions, then Fork. 
- Enter `app-fork` in Name. 
- Select Fork SVM.

### CLI

```bash
si create --name app-fork --fork app
```

Output

```text
6f1c0f0e8b
```

```bash
si exec app-fork -- cat /home/user/note.txt
```

Output

```text
v1
```

### curl

```bash
curl -sS -X POST "https://api.slashinfra.com/svms" \
-H "Authorization: Bearer $SI_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"app-fork","fork_of":"app"}'
```

Output

```text
{"id":"6f1c0f0e8b","project":"proj_6f1c0f0e8a","url":"https://6f1c0f0e8b.slashinfra.dev/bin/bash","region":"eu-gra","expires_at":null,"generation":1,"labels":{}}
```

### Python

```python
import os, requests

res = requests.post(
"https://api.slashinfra.com/svms",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
json={"name": "app-fork", "fork_of": "app"},
)
res.raise_for_status()
print(res.json()["id"])
```

Output

```text
6f1c0f0e8b
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/svms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SI_API_KEY!}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'app-fork', fork_of: 'app' }),
})
if (!res.ok) throw new Error(await res.text())
const vm = (await res.json()) as { id: string }
console.log(vm.id)
```

Output

```text
6f1c0f0e8b
```

`app-fork` has `v1` in `/home/user/note.txt`. Its capture appears in `si snapshot ls` as `fork-of-app-<time>` with state `ready` and `app-fork` in `used_by`.

## Delete a snapshot

A snapshot that a VM reads cannot be deleted: the API answers 409 `snapshot_in_use` and lists the VMs in `used_by`. `app-restored` reads `app-before-upgrade`, so delete it first with `si rm app-restored` or the VMs page, and wait until it is gone. Delete removes the snapshot and its cold objects, and the source VM `app` keeps its disk.

### Dashboard

- Open [Snapshots](https://app.slashinfra.com/svms/snapshots). 
- Select More actions on the `app-before-upgrade` row. 
- Select Delete. The row stays for five seconds; select Undo to keep the snapshot.

### CLI

```bash
si snapshot rm app-before-upgrade
```

Output

```text
deleted snapshot app-before-upgrade
```

### curl

```bash
curl -sS -i -X DELETE "https://api.slashinfra.com/snapshots/app-before-upgrade" \
-H "Authorization: Bearer $SI_API_KEY"
```

Output

```text
HTTP/2 204
...
```

### Python

```python
import os, requests

res = requests.delete(
"https://api.slashinfra.com/snapshots/app-before-upgrade",
headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},
)
res.raise_for_status()
print(res.status_code)
```

Output

```text
204
```

### TypeScript

```ts
const res = await fetch('https://api.slashinfra.com/snapshots/app-before-upgrade', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },
})
if (!res.ok) throw new Error(await res.text())
console.log(res.status)
```

Output

```text
204
```

The VMs `app` and `app-fork` remain. Delete them with `si rm` when you are done; deleting a VM does not delete a `user` snapshot, and the fork snapshot goes with `app-fork`.

## Options

| Field | Type | Default | Allowed values | What it changes |
| --- | --- | --- | --- | --- |   
| `name` (`--name` on create) | string | Create: `<VM name or id>-YYYYMMDD-HHMMSS`; rename: Required | 1 to 32 lowercase letters, digits or hyphens, starting with a letter; unique in the project | The snapshot name. A rename changes only the name. | 
| `ttl_s` | number | None, the snapshot lives until deleted | Whole seconds from 1 to 2592000 (30 days) | The life of the snapshot. The minute cron deletes it at `expires_ms` unless a VM reads it. API only. | 
| `project` (`--project`) | string | `default` | A project name, or its `proj_` id | The project of the snapshot. A query on snapshot operations and a body field on a VM create. | 
| `snapshot` (`--snapshot`) | string | None | A snapshot name in the new VM’s project, or its id | The disk to start from. A `creating` snapshot is accepted. Excludes `fork_of`. | 
| `fork_of` (`--fork`) | string | None | A VM name in the new VM’s project, or its id | Captures that VM’s disk and starts the new VM from it. Excludes `snapshot`. | 
| `ref` (path) | string | Required | A snapshot name in the `project` query, or its id | The snapshot that get, rename and delete act on. |

`si snapshot create` has no `--ttl` flag, and the CLI has no command to get one snapshot; use the API for both. The other fields of a VM create, such as `memory_mib` and `tier`, are on [VMs](https://slashinfra.com/docs/platform/vms).

## States

| State or kind | What it means for you | What you can do |
| --- | --- | --- |   
| `creating` | The capture is running; `logical_bytes` and `stored_bytes` are 0. | Start a VM from it, or wait for `ready`. | 
| `ready` | The capture is complete and the sizes are set. | Start VMs, rename it, or delete it when `used_by` is empty. | 
| `failed` | The capture did not finish; `error` holds the catalog code. | Take a new snapshot; a VM create that names it answers 409 `snapshot_failed`. | 
| `kind: user` | Made by a snapshot create. Counts against the plan’s 50 or 200. | Read, rename or delete it. | 
| `kind: fork` | Made by a `fork_of` create, named `fork-of-<source>-<time>`. Does not count against the plan. | Read it; it is deleted with the last VM that reads it. | 
| `kind: backup` | Made by a schedule’s `snapshot` action. Does not count against the plan. | Read it; the schedule’s `keep` retention deletes older ones. |

## Errors

| Code | When | Fix |
| --- | --- | --- |   
| [`invalid_name`](https://slashinfra.com/docs/reference/errors#invalid_name) | Create or rename sends a name outside the rule in Options. | Start with a letter, use 1 to 32 lowercase letters, digits or hyphens. | 
| [`name_taken`](https://slashinfra.com/docs/reference/errors#name_taken) | Create or rename uses a name another snapshot of the project has. | Choose another name. | 
| [`invalid_ttl`](https://slashinfra.com/docs/reference/errors#invalid_ttl) | Create sends a lifetime outside 1 to 2592000 seconds. | Send a whole number of seconds from 1 to 2592000. | 
| [`snapshot_limit`](https://slashinfra.com/docs/reference/errors#snapshot_limit) | Create would exceed the plan’s count of `user` snapshots. | Delete a snapshot, or ask about your plan. | 
| [`snapshot_not_found`](https://slashinfra.com/docs/reference/errors#snapshot_not_found) | Get, rename, delete or a VM create names no snapshot the key can see, or one of another project. | Check the name or id and the project. | 
| [`snapshot_in_use`](https://slashinfra.com/docs/reference/errors#snapshot_in_use) | Delete names a snapshot that a VM reads, including an asleep VM. | Delete the VMs in `used_by` first. | 
| [`snapshot_failed`](https://slashinfra.com/docs/reference/errors#snapshot_failed) | The capture failed, or a VM create names a failed snapshot. | Take a new snapshot. | 
| [`snapshot_pending`](https://slashinfra.com/docs/reference/errors#snapshot_pending) | The first request reaches a VM whose starting snapshot is still `creating`. | Wait for `Retry-After`; the VM starts when the capture is `ready`. | 
| [`invalid_snapshot`](https://slashinfra.com/docs/reference/errors#invalid_snapshot) | A VM create sends both `snapshot` and `fork_of`, or a malformed reference. | Send exactly one of them. | 
| [`svm_not_found`](https://slashinfra.com/docs/reference/errors#svm_not_found) | Create or fork names no VM in the project. | Check the VM name or id and the project. | 
| [`deleting`](https://slashinfra.com/docs/reference/errors#deleting) | Create or fork names a VM that is being deleted. | Wait for the delete to finish. | 
| [`project_not_found`](https://slashinfra.com/docs/reference/errors#project_not_found) | The project query or body names no project of the organization, or one outside the key’s scope. | Check the name or id, and the key’s project scope. | 
| [`no_capacity`](https://slashinfra.com/docs/reference/errors#no_capacity) | Delete cannot reach the storage that holds the snapshot. | Wait for `Retry-After` and retry. | 
| [`svm_unreachable`](https://slashinfra.com/docs/reference/errors#svm_unreachable) | The storage does not answer the delete. | Wait for `Retry-After` and retry. |

Errors that any request can return are in the [error catalog](https://slashinfra.com/docs/reference/errors).

## Permissions

| Operation | Who can | Key action |
| --- | --- | --- |   
| Take a snapshot | Any member | `snapshot:write` | 
| List snapshots | Any member | `snapshot:read` | 
| Get a snapshot | Any member | `snapshot:read` | 
| Rename a snapshot | Any member | `snapshot:write` | 
| Start a VM from a snapshot | Any member | `svm:write` | 
| Fork a VM | Any member | `svm:write` | 
| Delete a snapshot | Any member | `snapshot:delete` |

## Limits

- A snapshot name has 1 to 32 lowercase letters, digits or hyphens and starts with a letter. Without one, the name is `<VM name or id>-YYYYMMDD-HHMMSS`, cut to 32 characters. 
- `ttl_s` is 1 to 2592000 seconds (30 days). The minute cron deletes the snapshot at `expires_ms`, unless a VM reads it. 
- Standard allows 50 `user` snapshots and Pro allows 200; `fork` and `backup` snapshots do not count. A snapshot create that answers 409 `snapshot_limit` creates nothing. 
- A snapshot holds at most 50 GiB of disk; `logical_bytes` counts the used part. 
- A snapshot that any VM reads (listed in `used_by`) cannot be deleted. 
- A fork snapshot is deleted with the last VM that reads it; a minute sweep removes one that no VM reads and is older than 10 minutes. 
- `stored_bytes` counts the compressed bytes uploaded at capture; a chunk the shared store already held counts 0, so it is not the current storage cost.

The full list is in [Limits](https://slashinfra.com/docs/reference/limits).

## Next

- [VMs](https://slashinfra.com/docs/platform/vms): create a VM, choose its size, and delete the VMs that read a snapshot. 
- [Schedules](https://slashinfra.com/docs/platform/schedules): take `backup` snapshots on a cron. 
- [Control API snapshots](https://slashinfra.com/docs/api-reference/control/snapshots): every operation, field and status code.
