> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1256a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Take a snapshot of your file system

export const MethodSection = ({children}) => children ?? null;

export const MethodSwitch = ({children}) => {
  const tabs = React.Children.toArray(children).filter(c => c && c.props && c.props.id);
  const firstId = tabs.length > 0 ? tabs[0].props.id : "";
  const [active, setActive] = React.useState(firstId);
  React.useEffect(() => {
    try {
      const saved = localStorage.getItem("gcore_docs_method");
      if (saved && tabs.find(t => t.props.id === saved)) {
        setActive(saved);
      }
    } catch (_) {}
  }, []);
  React.useEffect(() => {
    try {
      document.querySelectorAll("h2[id], h3[id]").forEach(heading => {
        const visible = heading.offsetParent !== null;
        document.querySelectorAll(`a[href="#${heading.id}"]`).forEach(link => {
          if (link.closest("h1,h2,h3,h4,h5,h6")) return;
          const li = link.closest("li");
          if (li) li.style.display = visible ? "" : "none";
        });
      });
    } catch (_) {}
  }, [active]);
  const handleClick = id => {
    setActive(id);
    try {
      localStorage.setItem("gcore_docs_method", id);
    } catch (_) {}
  };
  return <div>
      <div className="not-prose flex gap-0 border-b border-zinc-200 dark:border-zinc-800 mb-8 mt-2" role="tablist">
        {tabs.map(tab => {
    const isActive = active === tab.props.id;
    return <button key={tab.props.id} role="tab" aria-selected={isActive} onClick={() => handleClick(tab.props.id)} className={["px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors cursor-pointer", isActive ? "border-primary text-primary" : "border-transparent text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"].join(" ")}>
              {tab.props.label}
            </button>;
  })}
      </div>

      {tabs.map(tab => <div key={tab.props.id} style={{
    display: active === tab.props.id ? "" : "none"
  }}>
          {tab.props.children}
        </div>)}
    </div>;
};

<MethodSwitch>
  <MethodSection id="portal" label="Customer Portal">
    A snapshot captures the full state of a volume at a point in time. It can be used for backup and recovery, or to deploy new Virtual Machines from a snapshot of a system volume.

    ## Difference between system and regular volume snapshots

    Snapshots can be taken from both system (boot) volumes and regular data volumes.

    The system volume holds the operating system and everything it needs to run. A regular volume contains all other data, separate from the OS.

    ## Create a snapshot

    A snapshot can be initiated from three places: the Snapshots page, the Volumes page, or directly from a Virtual Machine's overview.

    ### From the snapshots page

    To make a snapshot of the volume, go to the "Snapshots" section inside the project.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=77fd984b12d3d829abf0e6ef0f5b0c3f" alt="_______________.png" width="1839" height="647" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________.png" />
    </Frame>

    In the "Take snapshot" section, select the volume to create the snapshot. **System volumes** will have the "\_bootvolume" Postfix -> Enter a name for the snapshot in the "Name" field and click "Create snapshot".

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=66a8f1a9812662c4457f978633c1e432" alt="_______________________________.png" width="1618" height="553" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________________________.png" />
    </Frame>

    ### From the volumes page

    Inside the project, in the "Volumes" section, select the volume to create a snapshot -> on the selector on the right from the selected volume -> select the "Take snapshot" option

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/______________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=da1dc49bd4f2a0129947db013daf3e86" alt="______________________.png" width="1836" height="392" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/______________________.png" />
    </Frame>

    In the drop-down window, enter a name for the snapshot and click "Take snapshot".

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=4434365b7595bd68ac58ab2476dab7cb" alt="_______________________.png" width="640" height="335" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________________.png" />
    </Frame>

    ### From the Virtual Machine

    1\. Open the project and go to the **Instances** page and select the Virtual Machine you want to take a snapshot from.

    2\. Click the three-dot icon and select **Overview**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/__________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=b35875d3ab7a0d157e884af0b483f15a" alt="__________.png" width="1825" height="348" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/__________.png" />
    </Frame>

    3\. Go to the **Volumes** tab, select the volume to create a snapshot, and click **Take snapshot**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=66a8f1a9812662c4457f978633c1e432" alt="_______________________________.png" width="1618" height="553" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______________________________.png" />
    </Frame>

    4\. In the window that opens, enter a name for the snapshot and click **Take snapshot**.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/__________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=5a633e82eb5bbcc4a7381f079400fb70" alt="__________________.png" width="1618" height="839" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/__________________.png" />
    </Frame>

    5\. In the **Snapshots** section, you can view a list of created snapshots from VM volumes.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/__________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=5a633e82eb5bbcc4a7381f079400fb70" alt="__________________.png" width="1618" height="839" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/__________________.png" />
    </Frame>

    ## Snapshot management

    A list of all created snapshots can be found in the "Snapshots" section, inside the project.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_____________________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=8b7cb003abeeb3e1b5a3cecb57a97314" alt="_____________________________.png" width="1837" height="786" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_____________________________.png" />
    </Frame>

    You can select the necessary option on the selector on the right from the snapshot:

    ### Create a VM from a snapshot of the system volume

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_________________________________.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=792394b60eeaf4ba91ca92d53a933f0e" alt="_________________________________.png" width="1615" height="545" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_________________________________.png" />
    </Frame>

    ### Delete a snapshot

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=f5c511ae048058693c52d1221d683b7f" alt="_______.png" width="1621" height="535" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/_______.png" />
    </Frame>

    **Also, you can revert a volume to the latest snapshot**. Open the "Volumes" section, detach the volume from your Virtual Machine and select the reverting option on the selector.

    Please note: if you have just resized the volume you will not be able to use the function because the last snapshot is designed for the old size. You can only create a new volume from it. For the new size volume, you need to create a new snapshot.

    <Frame>
      <img src="https://mintcdn.com/gcore-doc-1256a/OVY0oVOQXvzV_lPN/images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/mceclip1.png?fit=max&auto=format&n=OVY0oVOQXvzV_lPN&q=85&s=41c8c1006e524b9e87f9616a49b01e37" alt="mceclip1.png" width="1761" height="818" data-path="images/docs/cloud/virtual-instances/snapshots/take-a-snapshot-of-your-file-system/mceclip1.png" />
    </Frame>
  </MethodSection>

  <MethodSection id="api" label="REST API">
    The Gcore REST API lets you create and delete volume snapshots programmatically. A snapshot captures the full state of a volume at a point in time and can later be used to restore data or create new volumes.

    <Info>
      A permanent [API token](/account-settings/api-tokens) is required, along with a [project ID](https://api.gcore.com/docs/cloud#tag/Projects/operation/ProjectsListV1.get) and [region ID](https://api.gcore.com/docs/cloud#tag/Regions/operation/RegionListV1.get).
    </Info>

    Set environment variables before running the examples:

    ```bash theme={null}
    export GCORE_API_KEY="{YOUR_API_KEY}"
    export GCORE_CLOUD_PROJECT_ID="{YOUR_PROJECT_ID}"
    export GCORE_CLOUD_REGION_ID="{YOUR_REGION_ID}"
    export VOLUME_ID="{YOUR_VOLUME_ID}"
    ```

    <Info>
      **VOLUME\_ID** is the UUID of an existing volume to snapshot. To create a volume or find its ID, see [Create and configure volumes](/cloud/virtual-instances/volumes/create-and-configure-volumes).
    </Info>

    ## Quickstart

    The scripts below create a snapshot from an existing volume, print the snapshot details, then delete the snapshot.

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        import os
        from gcore import Gcore

        client = Gcore()

        volume_id = os.environ["VOLUME_ID"]

        # Step 1. Create a snapshot from the volume.
        snapshot = client.cloud.volume_snapshots.create_and_poll(
            volume_id=volume_id,
            name="my-snapshot",
        )
        print(f"Snapshot ID: {snapshot.id}  status: {snapshot.status}  size: {snapshot.size} GiB")

        # Step 2. Retrieve snapshot details.
        snap = client.cloud.volume_snapshots.get(snapshot.id)
        print(f"Name: {snap.name}  volume_id: {snap.volume_id}  created_at: {snap.created_at}")

        # Step 3. Delete the snapshot when it is no longer needed.
        client.cloud.volume_snapshots.delete_and_poll(snapshot.id)
        print(f"Deleted snapshot {snapshot.id}")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        package main

        import (
            "context"
            "fmt"
            "log"
            "os"

            gcore "github.com/G-Core/gcore-go"
            "github.com/G-Core/gcore-go/cloud"
        )

        func main() {
            client := gcore.NewClient()
            ctx := context.Background()
            volumeID := os.Getenv("VOLUME_ID")

            // Step 1. Create a snapshot from the volume.
            snapshot, err := client.Cloud.VolumeSnapshots.NewAndPoll(ctx, cloud.VolumeSnapshotNewParams{
                VolumeID: volumeID,
                Name:     "my-snapshot",
            })
            if err != nil {
                log.Fatalf("create snapshot: %v", err)
            }
            fmt.Printf("Snapshot ID: %s  status: %s  size: %d GiB\n", snapshot.ID, snapshot.Status, snapshot.Size)

            // Step 2. Retrieve snapshot details.
            snap, err := client.Cloud.VolumeSnapshots.Get(ctx, snapshot.ID, cloud.VolumeSnapshotGetParams{})
            if err != nil {
                log.Fatalf("get snapshot: %v", err)
            }
            fmt.Printf("Name: %s  volume_id: %s  created_at: %s\n", snap.Name, snap.VolumeID, snap.CreatedAt)

            // Step 3. Delete the snapshot when it is no longer needed.
            if err = client.Cloud.VolumeSnapshots.DeleteAndPoll(ctx, snapshot.ID, cloud.VolumeSnapshotDeleteParams{}); err != nil {
                log.Fatalf("delete snapshot: %v", err)
            }
            fmt.Printf("Deleted snapshot %s\n", snapshot.ID)
        }

        ```
      </Tab>
    </Tabs>

    ## Step-by-step

    <p>Each step below explains what the call does, which parameters matter, and what the response looks like. Use this section to understand the flow or to debug a specific step.</p>

    <Accordion title="Show all steps">
      ### Step 1. Find the volume ID

      The snapshot API requires the UUID of the volume to snapshot. List volumes to find the right one — boot volumes have `is_root_volume: true`.

      <Tabs>
        <Tab title="Python SDK">
          ```python theme={null}
          import os
          from gcore import Gcore

          client = Gcore()

          for volume in client.cloud.volumes.list():
              label = "boot" if volume.is_root_volume else "data"
              print(f"[{label}] {volume.id}  {volume.name}  {volume.size} GiB  {volume.status}")
          ```
        </Tab>

        <Tab title="Go SDK">
          ```go theme={null}
          page, err := client.Cloud.Volumes.List(ctx, cloud.VolumeListParams{})
          if err != nil {
              log.Fatalf("list volumes: %v", err)
          }
          for _, v := range page.Results {
              label := "data"
              if v.IsRootVolume {
                  label = "boot"
              }
              fmt.Printf("[%s] %s  %s  %d GiB  %s\n", label, v.ID, v.Name, v.Size, v.Status)
          }
          ```
        </Tab>

        <Tab title="curl">
          ```bash theme={null}
          curl -X GET "https://api.gcore.com/cloud/v1/volumes/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID" \
            -H "Authorization: APIKey $GCORE_API_KEY"
          ```

          Response:

          ```json theme={null}
          {
            "count": 1,
            "results": [
              {
                "id": "2e222e06-2faa-4e80-ab2a-61463c992193",
                "name": "my-volume",
                "size": 10,
                "status": "available",
                "volume_type": "standard",
                "is_root_volume": false,
                "bootable": false,
                "attachments": []
              }
            ]
          }
          ```
        </Tab>
      </Tabs>

      Copy the `id` of the volume to use as `VOLUME_ID` in the next step.

      ### Step 2. Create a snapshot

      The [snapshot](https://api.gcore.com/docs/cloud#tag/Snapshots/operation/SnapshotViewSet.post) is created asynchronously — the API returns a task ID immediately, and the actual snapshot becomes available after the task finishes.

      | Parameter     | Required | Description                                     |
      | ------------- | -------- | ----------------------------------------------- |
      | `volume_id`   | Yes      | UUID of the volume to snapshot                  |
      | `name`        | Yes      | Display name for the snapshot (3–63 characters) |
      | `description` | No       | Optional human-readable note                    |

      <Tabs>
        <Tab title="Python SDK">
          ```python theme={null}
          snapshot = client.cloud.volume_snapshots.create_and_poll(
              volume_id=os.environ["VOLUME_ID"],
              name="my-snapshot",
          )
          print(f"Snapshot ID: {snapshot.id}  status: {snapshot.status}")
          ```
        </Tab>

        <Tab title="Go SDK">
          ```go theme={null}
          snapshot, err := client.Cloud.VolumeSnapshots.NewAndPoll(ctx, cloud.VolumeSnapshotNewParams{
              VolumeID: os.Getenv("VOLUME_ID"),
              Name:     "my-snapshot",
          })
          if err != nil {
              log.Fatalf("create snapshot: %v", err)
          }
          fmt.Printf("Snapshot ID: %s  status: %s\n", snapshot.ID, snapshot.Status)
          ```
        </Tab>

        <Tab title="curl">
          ```bash theme={null}
          curl -X POST "https://api.gcore.com/cloud/v1/snapshots/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID" \
            -H "Authorization: APIKey $GCORE_API_KEY" \
            -H "Content-Type: application/json" \
            -d "{\"name\": \"my-snapshot\", \"volume_id\": \"$VOLUME_ID\"}"
          ```

          Response:

          ```json theme={null}
          {
            "tasks": ["90dc1f93-c2cf-438f-b196-f2569c396b6d"]
          }
          ```
        </Tab>
      </Tabs>

      ### Step 3. Poll the task

      Creating a snapshot is asynchronous — the API returns a task ID immediately, and the snapshot becomes available only after the task finishes. Both SDK methods handle this automatically: `create_and_poll` and `NewAndPoll` block the program until the task completes and then return a fully populated snapshot object. No manual polling loop is needed. The returned object has `id`, `status`, `size`, `volume_id`, and `created_at` available immediately — use `snapshot.id` in all subsequent calls.

      When using curl, there is no built-in polling, so the GET request below must be repeated every 5 seconds until `state` changes to `FINISHED`.

      <Tabs>
        <Tab title="Python SDK">
          ```python theme={null}
          # create_and_poll returned only after the snapshot reached "available" status.
          # The snapshot object is fully populated — print key fields to confirm.
          print(f"Snapshot ready.")
          print(f"  ID:         {snapshot.id}")
          print(f"  Status:     {snapshot.status}")
          print(f"  Size:       {snapshot.size} GiB")
          print(f"  Volume ID:  {snapshot.volume_id}")
          print(f"  Created at: {snapshot.created_at}")
          ```
        </Tab>

        <Tab title="Go SDK">
          ```go theme={null}
          // NewAndPoll returned only after the snapshot reached "available" status.
          // The *cloud.Snapshot is fully populated — print key fields to confirm.
          fmt.Println("Snapshot ready.")
          fmt.Printf("  ID:         %s\n", snapshot.ID)
          fmt.Printf("  Status:     %s\n", snapshot.Status)
          fmt.Printf("  Size:       %d GiB\n", snapshot.Size)
          fmt.Printf("  Volume ID:  %s\n", snapshot.VolumeID)
          fmt.Printf("  Created at: %s\n", snapshot.CreatedAt)
          ```
        </Tab>

        <Tab title="curl">
          ```bash theme={null}
          curl -X GET "https://api.gcore.com/cloud/v1/tasks/$TASK_ID" \
            -H "Authorization: APIKey $GCORE_API_KEY"
          ```

          While provisioning:

          ```json theme={null}
          {
            "id": "90dc1f93-c2cf-438f-b196-f2569c396b6d",
            "state": "RUNNING",
            "task_type": "create_snapshot"
          }
          ```

          When complete:

          ```json theme={null}
          {
            "id": "90dc1f93-c2cf-438f-b196-f2569c396b6d",
            "state": "FINISHED",
            "task_type": "create_snapshot",
            "created_resources": {
              "snapshots": ["5ed275b8-7eed-4722-8c98-777191d4e003"]
            }
          }
          ```
        </Tab>
      </Tabs>

      ### Step 4. Get snapshot details

      Retrieve the [snapshot](https://api.gcore.com/docs/cloud#tag/Snapshots/operation/SnapshotInstanceViewSet.get) to confirm its status and record its properties.

      <Tabs>
        <Tab title="Python SDK">
          ```python theme={null}
          snap = client.cloud.volume_snapshots.get(snapshot.id)
          print(f"Name: {snap.name}  volume_id: {snap.volume_id}  size: {snap.size} GiB")
          ```
        </Tab>

        <Tab title="Go SDK">
          ```go theme={null}
          snap, err := client.Cloud.VolumeSnapshots.Get(ctx, snapshot.ID, cloud.VolumeSnapshotGetParams{})
          if err != nil {
              log.Fatalf("get snapshot: %v", err)
          }
          fmt.Printf("Name: %s  volume_id: %s  size: %d GiB\n", snap.Name, snap.VolumeID, snap.Size)
          ```
        </Tab>

        <Tab title="curl">
          ```bash theme={null}
          curl -X GET "https://api.gcore.com/cloud/v1/snapshots/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/$SNAPSHOT_ID" \
            -H "Authorization: APIKey $GCORE_API_KEY"
          ```

          Response:

          ```json theme={null}
          {
            "id": "5ed275b8-7eed-4722-8c98-777191d4e003",
            "name": "my-snapshot",
            "status": "available",
            "size": 10,
            "volume_id": "6ca09383-85d2-4bb3-8d2d-214a2436fa4f",
            "created_at": "2026-05-30T05:34:14+0000",
            "updated_at": "2026-05-30T05:34:15+0000",
            "region": "Luxembourg-3",
            "project_id": 1186668,
            "region_id": 148
          }
          ```
        </Tab>
      </Tabs>
    </Accordion>

    ## Clean up

    Delete a snapshot with the [delete snapshot](https://api.gcore.com/docs/cloud#tag/Snapshots/operation/SnapshotInstanceViewSet.delete) endpoint when it is no longer needed.

    <Tabs>
      <Tab title="Python SDK">
        ```python theme={null}
        client.cloud.volume_snapshots.delete_and_poll(snapshot_id)
        print(f"Deleted snapshot {snapshot_id}")
        ```
      </Tab>

      <Tab title="Go SDK">
        ```go theme={null}
        if err = client.Cloud.VolumeSnapshots.DeleteAndPoll(ctx, snapshotID, cloud.VolumeSnapshotDeleteParams{}); err != nil {
            log.Fatalf("delete snapshot: %v", err)
        }
        fmt.Printf("Deleted snapshot %s\n", snapshotID)
        ```
      </Tab>

      <Tab title="curl">
        ```bash theme={null}
        curl -X DELETE "https://api.gcore.com/cloud/v1/snapshots/$GCORE_CLOUD_PROJECT_ID/$GCORE_CLOUD_REGION_ID/$SNAPSHOT_ID" \
          -H "Authorization: APIKey $GCORE_API_KEY"
        ```

        Response:

        ```json theme={null}
        {
          "tasks": ["22d8a306-46f0-4e77-a5b7-c1f232b5f1c4"]
        }
        ```
      </Tab>
    </Tabs>

    Poll the returned task ID until `state` is `FINISHED` to confirm the snapshot is gone.
  </MethodSection>
</MethodSwitch>
