Skip to content
arvm
Docs menu

Snapshots

A snapshot is a saved copy of a machine’s disk at one moment. Take one before a risky change, or use one as the starting disk for new machines. Snapshot storage is a paid add-on: $0.10 per GB a month, for what the snapshot stores.

The examples use a machine named calm-river-otter, and the curl examples read the API key from ARVM_API_KEY. Where the CLI has a command for the task, the command comes first.

Take a snapshot

Terminal
$ arvm snapshot create calm-river-otter --name before-upgrade

The command waits until the snapshot is ready. The same through the API:

Terminal
$ curl -s -X POST "https://api.arvm.dev/v1/snapshots" \
    -H "Authorization: Bearer $ARVM_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{"machine": "calm-river-otter", "name": "before-upgrade"}'

The machine keeps running. The snapshot starts in the state creating and becomes ready when the copy is complete.

A snapshot holds the disk and nothing else. Memory is not saved, so a machine made from a snapshot boots like a computer whose power was cut at that moment. For a clean copy of a database, stop the database or the machine first.

Wait until it is ready

Terminal
$ curl -s "https://api.arvm.dev/v1/snapshots/before-upgrade" \
    -H "Authorization: Bearer $ARVM_API_KEY"
State Meaning
creating The copy is being made.
ready The snapshot can be used. size_bytes shows what it stores.
failed The copy did not succeed. failure says why.
deleting The snapshot is being removed.
deleted The snapshot is gone.

Create a machine from a snapshot

Terminal
$ arvm new --from-snapshot before-upgrade
Terminal
$ curl -s -X POST "https://api.arvm.dev/v1/machines?wait=running" \
    -H "Authorization: Bearer $ARVM_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{"from_snapshot": "before-upgrade", "size": "default"}'

The new machine’s disk starts as a copy of the snapshot. The new machine has its own name, its own ID and its own address. The snapshot is not changed and can start any number of machines. A snapshot that is not ready refuses with snapshot_not_ready.

To go back to an earlier state of a machine, create a new machine from the snapshot and delete the old machine. A machine cannot be rolled back in place.

List snapshots

Newest first:

Terminal
$ arvm snapshot ls
Terminal
$ curl -s "https://api.arvm.dev/v1/snapshots" \
    -H "Authorization: Bearer $ARVM_API_KEY"

Only the snapshots of one machine:

Terminal
$ curl -s "https://api.arvm.dev/v1/snapshots?machine=calm-river-otter" \
    -H "Authorization: Bearer $ARVM_API_KEY"

Delete a snapshot

Terminal
$ arvm snapshot rm before-upgrade --yes

Without --yes, the command asks you to confirm first.

Terminal
$ curl -s -X DELETE "https://api.arvm.dev/v1/snapshots/before-upgrade" \
    -H "Authorization: Bearer $ARVM_API_KEY"

Billing for the snapshot’s storage ends at the request. Machines that were created from the snapshot are not affected. Deleting a machine does not delete its snapshots, so delete the ones you no longer need. After your subscription ends, your snapshots stay on their server. They are not archived with your machines’ disks. While the subscription stays ended, arvm deletes them with your machines on the deletion date, after the same three warnings. A subscription that starts again before that date keeps them. See billing.

What a snapshot costs

A snapshot is billed on size_bytes, which is what the snapshot stores, at $0.10 per GB a month. The charge is counted by the second and draws from the same balance as machine time.

A snapshot that arvm records as lost is not charged while it is lost. A lost snapshot has the state failed and the failure.code snapshot_lost. arvm records a snapshot as lost in one of two ways:

  • Its server reports that the copy is missing from a drive the server can read. The charge stops at the time the server found the copy missing.
  • arvm retires a drive that failed for good. The charge for each snapshot on that drive stops at the time the drive is retired.

If the server reads the copy again later, the snapshot is ready again and the charge starts again from that time. The time between is not charged.

While a drive cannot be reached and is not yet retired, its snapshots stay ready and are still charged. For example, if a drive stops working at the start of day 0 and arvm retires it at the start of day 4, its snapshots are charged in full for days 0, 1, 2 and 3.

Each day’s storage is charged after the day ends, in UTC. A server’s report of a lost snapshot normally reaches arvm within seconds. If the server cannot reach arvm when it finds the loss, the report arrives later. Storage that arvm charged before the report arrived stays charged. This can be at most the time from the loss to the report. For example, if a server is out of contact for two days and then reports that it lost a snapshot two days ago, up to two days of storage stay charged.

Snapshot stores Cost for 30 days
6 GB $0.60
25 GB $2.50
50 GB $5.00

Snapshot storage uses your balance while every machine is stopped. The plan allows 20 snapshots. GET /v1/billing returns the rate and the limit in force, as snapshot_rate_micros_per_gib_month and max_snapshots.

What a snapshot protects against

A snapshot protects you from a change to the disk: a bad upgrade, a deleted directory, a script that went wrong. You can create a new machine from the state you saved.

A snapshot does not protect you from a hardware failure. A snapshot is stored on the drive that held the machine’s disk when the snapshot was taken, and it stays there. If that drive or its server fails, the snapshot is lost, and so is the disk if it is still on that drive. arvm keeps no backup of either, and off-host backups are not available yet. Regions and uptime says what is and is not protected.

Keep a copy of anything you cannot lose somewhere outside arvm: a Git remote, object storage, or your own computer. arvm takes no snapshot for you.

The snapshots reference lists every operation and field.