Snapshot functionality requires S3 configuration. Set the
HATCH_S3_BUCKET, HATCH_S3_ENDPOINT, HATCH_S3_ACCESS_KEY, and HATCH_S3_SECRET_KEY environment variables.Create Snapshot
Create a snapshot of a running VM. The VM’s memory, disk, and CPU state are captured and uploaded to S3 storage.Path Parameters
The VM ID to snapshot.
Response
Unique snapshot identifier (e.g.,
snap_abc123).The ID of the VM that was snapshotted.
S3 key for the VM state file.
S3 key for the memory snapshot file.
S3 key for the disk snapshot file.
JSON-encoded VM configuration at the time of snapshot.
Total size of the snapshot in bytes.
ISO 8601 timestamp when the snapshot was created.
Example Request
Example Response
Restore Snapshot
Restore a VM from its most recent snapshot. The VM must be in asnapshotted state. This operation downloads the snapshot files from S3 and restarts the VM with the restored state.
Path Parameters
The VM ID to restore.
Response
Returns the restored VM object with state set torunning.
The VM ID.
The image ID used for this VM.
VM state after restoration (typically
running).Number of virtual CPUs.
Memory size in MiB.
The guest IP address.
The guest MAC address.
The TAP network interface name.
The host port forwarded to the VM’s SSH port.
Whether networking is enabled.
Original VM creation timestamp.
Timestamp when the VM was last updated (restore time).
Example Request
Example Response
List Snapshots
Retrieve all snapshots for a specific VM.Path Parameters
The VM ID.
Response
Returns an array of snapshot objects, ordered by creation date (most recent first).Example Request
Example Response
Snapshot Workflow
Create a running VM
Use the Create VM endpoint to start a new VM.
Create a snapshot
When the VM is in a desired state, create a snapshot. The VM state is
snapshotted after this operation.