> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ns.rocks/llms.txt
> Use this file to discover all available pages before exploring further.

# Hibernate

> Snapshot a running machine and stop its active VM.

Hibernate captures paused machine state for a running machine and stops the
active VM. Use reusable snapshots when the source should keep running and the
captured state should start many future machines.

## What state changes

* The running machine stops accepting new work.
* A paused-machine snapshot ID is created and returned for `Machine.resume(...)`.
* Shared volume attachments are preserved as remount intent, not as VM memory.

## Usage

<CodeGroup>
  ```python Python SDK theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  from nullspace import Machine

  machine = Machine.create(template="base", timeout=600)
  machine.files.write("/workspace/state.txt", "before hibernate\n")
  snapshot = machine.hibernate()
  print(snapshot.id)
  ```

  ```bash CLI theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  nullspace machine pause mch_123
  ```

  ```bash HTTP API theme={"theme":{"light":"one-light","dark":"one-dark-pro"}}
  curl -fsS -X POST \
    -H "Authorization: Bearer ${NULLSPACE_API_KEY}" \
    "${NULLSPACE_API_URL}/v1/machines/${MACHINE_ID}/hibernate"
  ```
</CodeGroup>

API reference: [hibernateMachine](../api-reference)
(`POST /v1/machines/{id}/hibernate`). Reusable snapshot API:
[Snapshots](../machines/snapshots).

Guide: [Machine lifecycle](../guides/machine-lifecycle). Example:
[Examples](../examples).
