Manage disk snapshots

Standard disk snapshots help you toperiodically back up data from your Persistent Disk and Google Cloud Hyperdisk.

You can view, list, and delete disk snapshots. You can alsoshare snapshots across projects.

Before you begin

Required roles and permissions

To get the permissions that you need to manage standard snapshots, ask your administrator to grant you the following IAM roles on the project:

For more information about granting roles, seeManage access to projects, folders, and organizations.

These predefined roles contain the permissions required to manage standard snapshots. To see the exact permissions that are required, expand theRequired permissions section:

Required permissions

The following permissions are required to manage standard snapshots:

  • To list snapshots: compute.snapshots.list on the project
  • To view information about a snapshot: compute.snapshots.get on the snapshot
  • To delete a snapshot: compute.snapshots.delete on the snapshot
  • To delete snapshots based on a filter:
    • compute.snapshots.delete on the snapshot
    • compute.snapshots.list on the project
  • To share snapshot data across projects:
    • compute.storageAdmin on the project (for accessing all standard snapshots)
    • compute.disks.create on the project to share with
    • compute.snapshots.create on the source project
    • compute.disks.createSnapshot on the source disk

You might also be able to get these permissions withcustom roles or otherpredefined roles.

View the standard snapshots in a project or location

You can view or list the standard snapshots in a project or location byusing the gcloud CLI, Google Cloud console, or theREST.

Console

  1. In the Google Cloud console, go to theSnapshots page.

    Go to the Snapshots page

  2. On theSnapshots tab, you can see the standard snapshots for thecurrent project.

  3. Optional. Narrow your results with thefilter_listFilter field. Enter a property name or value in theFilter field,or choose from the available properties.

gcloud

Replace the following:

  • PROJECT_ID: Optional. Replace with the projectID. If you omit this flag, then the current project is used. You can setthe default project for your session by using the gcloud CLIcommandgcloud config set projectPROJECT_ID.
  • REGION_NAME: The name of the region that youwant to view snapshots for.

REST

  • To see a list of all snapshots available to you in a particular project,make aGET request to thesnapshots.list methodand specify "aggregated".

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/aggregated/snapshots
  • (Preview) To see a list ofregionally scoped snapshots available to you in aparticular project, make aGET request to thesnapshots.list methodand specify the region.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION_NAME/snapshots
  • To see a list of globally scoped snapshots available to you in aparticular project, make aGET request to thesnapshots.list methodand specify "global".

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots

Replace the following:

  • PROJECT_ID: The project ID.
  • REGION_NAME: The name of the region that youwant to view snapshots for.

View the standard snapshots for a disk

You can view the list of standard snapshots for a disk by using the Google Cloud console, gcloud CLI,or REST.

Console

  1. In the Google Cloud console, go to theSnapshots page.

    Go to the Snapshots page

  2. On theSnapshots tab, a list of all the standard snapshots in theproject appears.

  3. Narrow the results by source disk:

    1. EnterSource disk: in thefilter_listFilter field, or click theFilter field and then choose thevalueSource disk from theProperties list.

    2. Select the name of the disk from theValues list that appears nexttoSource disk: in theFilter field.

      The snapshots displayed in the console now shows all standardsnapshots for the specified disk.

      If you don't see the name of a disk in theValues list, then in theFilter field next toSource disk:, type in the first fewletters of the source disk's name to change the list of values thatyou see.

gcloud

List the standard snapshots for a disk with thegcloud compute snapshots list commandand the--filter argument.

  • List the standard snapshots for a zonal disk:

    gcloud compute snapshots list --filter="sourceDisk:projects/PROJECT_ID/zones/SOURCE_ZONE/disks/DISK_NAME
  • List the standard snapshots for a regional disk:

    gcloud compute snapshots list --filter=sourceDisk:projects/PROJECT_ID/regions/SOURCE_REGION/disks/DISK_NAME

Replace the following:

  • PROJECT_ID: the ID of the project.
  • SOURCE_ZONE: (Zonal disks only) the name of the zonefor the disk, for example,us-west1-a.
  • SOURCE_REGION: (Regional disks only) the nameof the region for the disk, for example,us-west1.
  • DISK_NAME: the name of the disk, for example,disk-1.

REST

List the standard snapshots for a zonal or regional disk with aGET requestto thesnapshots.list method.

Use thefilter=sourceDisk query parameter to specify the name of the disk.

  • List the standard snapshots for a zonal disk:

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots?filter=sourceDisk:'https://www.googleapis.com/compute/v1/projects/PROJECT_ID/zones/SOURCE_ZONE/disks/DISK_NAME'
  • List the standard snapshots for a regional disk:

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots?filter=sourceDisk:'https://www.googleapis.com/compute/v1/projects/PROJECT_ID/regions/SOURCE_REGION/disks/DISK_NAME'

Replace the following:

  • PROJECT_ID: the ID of the project.
  • SOURCE_ZONE: (Zonal disks only) the name of the zonefor the disk, for example,us-west1-a.
  • SOURCE_REGION: (Regional disks only) the nameof the region for the disk, for example,us-west1.
  • DISK_NAME: the name of the source disk, forexampledisk-1.

View information about a standard snapshot

Retrieve detailed information about a standard snapshot, such as its creationtime, source disk, and size by using the Google Cloud console,Google Cloud CLI, or REST.

Console

  1. In the Google Cloud console, go to theSnapshots page.

    Go to the Snapshots page

  2. On theSnapshots tab, view the list of snapshots in the project.

  3. In theName column, click the name of the standard snapshot. TheSnapshot details page for the selected snapshot appears,showing its properties.

gcloud

Replace the following:

  • SNAPSHOT_NAME: The name of thestandard snapshot.
  • REGION_NAME: The name of the region that yoursnapshot is scoped to.

REST

  • To view information about a globally scoped standard snapshot, make aGET request to thesnapshots.get method.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots/SNAPSHOT_NAME
  • (Preview) To view information abouta regionally scoped standard snapshot, make aGET request to thesnapshots.get methodand specify the region.

    GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION_NAME/snapshots/SNAPSHOT_NAME

Replace the following:

  • PROJECT_ID: The name of the project containingthe standard snapshot.
  • SNAPSHOT_NAME: The name of the standardsnapshot.
  • REGION_NAME: The name of the region that yoursnapshot is scoped to.

Delete a snapshot

Warning: Deleting a snapshot is irreversible. You can't recover a deleted snapshot.

Compute Engine uses differential snapshots so that each snapshotcontains only the data that has changed since the previous snapshot. Becausesubsequent snapshots might require information stored in a previoussnapshot, keep in mind that deleting a snapshot does not necessarily deleteall the data on the snapshot.

To learn more about snapshot deletion, seeSnapshot deletion.

Console

  1. Go to theSnapshots page in the Google Cloud console.

    Go to the Snapshots page

  2. Select one or more snapshots that you want to delete.

  3. At the top of theSnapshots page, clickDelete.

gcloud

Replace the following:

  • SNAPSHOT_NAME: The name of the snapshotthat you want to delete.
  • REGION_NAME: The region that the snapshot isscoped to.

Go

import("context""fmt""io"compute"cloud.google.com/go/compute/apiv1"computepb"cloud.google.com/go/compute/apiv1/computepb")// deleteSnapshot deletes a snapshot of a disk.funcdeleteSnapshot(wio.Writer,projectID,snapshotNamestring)error{// projectID := "your_project_id"// snapshotName := "your_snapshot_name"ctx:=context.Background()snapshotsClient,err:=compute.NewSnapshotsRESTClient(ctx)iferr!=nil{returnfmt.Errorf("NewSnapshotsRESTClient: %w",err)}defersnapshotsClient.Close()req:=&computepb.DeleteSnapshotRequest{Project:projectID,Snapshot:snapshotName,}op,err:=snapshotsClient.Delete(ctx,req)iferr!=nil{returnfmt.Errorf("unable to delete snapshot: %w",err)}iferr=op.Wait(ctx);err!=nil{returnfmt.Errorf("unable to wait for the operation: %w",err)}fmt.Fprintf(w,"Snapshot deleted\n")returnnil}

Java

importcom.google.cloud.compute.v1.Operation;importcom.google.cloud.compute.v1.SnapshotsClient;importjava.io.IOException;importjava.util.concurrent.ExecutionException;importjava.util.concurrent.TimeUnit;importjava.util.concurrent.TimeoutException;publicclassDeleteSnapshot{publicstaticvoidmain(String[]args)throwsIOException,ExecutionException,InterruptedException,TimeoutException{// TODO(developer): Replace these variables before running the sample.// Project ID or project number of the Cloud project you want to use.StringprojectId="YOUR_PROJECT_ID";// Name of the snapshot to be deleted.StringsnapshotName="YOUR_SNAPSHOT_NAME";deleteSnapshot(projectId,snapshotName);}// Delete a snapshot of a disk.publicstaticvoiddeleteSnapshot(StringprojectId,StringsnapshotName)throwsIOException,ExecutionException,InterruptedException,TimeoutException{// Initialize client that will be used to send requests. This client only needs to be created// once, and can be reused for multiple requests. After completing all of your requests, call// the `snapshotsClient.close()` method on the client to safely// clean up any remaining background resources.try(SnapshotsClientsnapshotsClient=SnapshotsClient.create()){Operationoperation=snapshotsClient.deleteAsync(projectId,snapshotName).get(3,TimeUnit.MINUTES);if(operation.hasError()){System.out.println("Snapshot deletion failed!"+operation);return;}System.out.println("Snapshot deleted!");}}}

Node.js

/** * TODO(developer): Uncomment and replace these variables before running the sample. */// const projectId = 'YOUR_PROJECT_ID';// const snapshotName = 'YOUR_SNAPSHOT_NAME';constcompute=require('@google-cloud/compute');asyncfunctiondeleteSnapshot(){constsnapshotsClient=newcompute.SnapshotsClient();const[response]=awaitsnapshotsClient.delete({project:projectId,snapshot:snapshotName,});letoperation=response.latestResponse;constoperationsClient=newcompute.GlobalOperationsClient();// Wait for the create disk operation to complete.while(operation.status!=='DONE'){[operation]=awaitoperationsClient.wait({operation:operation.name,project:projectId,});}console.log('Snapshot deleted.');}deleteSnapshot();

Python

from__future__importannotationsimportsysfromtypingimportAnyfromgoogle.api_core.extended_operationimportExtendedOperationfromgoogle.cloudimportcompute_v1defwait_for_extended_operation(operation:ExtendedOperation,verbose_name:str="operation",timeout:int=300)->Any:"""    Waits for the extended (long-running) operation to complete.    If the operation is successful, it will return its result.    If the operation ends with an error, an exception will be raised.    If there were any warnings during the execution of the operation    they will be printed to sys.stderr.    Args:        operation: a long-running operation you want to wait on.        verbose_name: (optional) a more verbose name of the operation,            used only during error and warning reporting.        timeout: how long (in seconds) to wait for operation to finish.            If None, wait indefinitely.    Returns:        Whatever the operation.result() returns.    Raises:        This method will raise the exception received from `operation.exception()`        or RuntimeError if there is no exception set, but there is an `error_code`        set for the `operation`.        In case of an operation taking longer than `timeout` seconds to complete,        a `concurrent.futures.TimeoutError` will be raised.    """result=operation.result(timeout=timeout)ifoperation.error_code:print(f"Error during{verbose_name}: [Code:{operation.error_code}]:{operation.error_message}",file=sys.stderr,flush=True,)print(f"Operation ID:{operation.name}",file=sys.stderr,flush=True)raiseoperation.exception()orRuntimeError(operation.error_message)ifoperation.warnings:print(f"Warnings during{verbose_name}:\n",file=sys.stderr,flush=True)forwarninginoperation.warnings:print(f" -{warning.code}:{warning.message}",file=sys.stderr,flush=True)returnresultdefdelete_snapshot(project_id:str,snapshot_name:str)->None:"""    Delete a snapshot of a disk.    Args:        project_id: project ID or project number of the Cloud project you want to use.        snapshot_name: name of the snapshot to delete.    """snapshot_client=compute_v1.SnapshotsClient()operation=snapshot_client.delete(project=project_id,snapshot=snapshot_name)wait_for_extended_operation(operation,"snapshot deletion")

REST

  • To delete a globally scoped snapshot, make aDELETE request to thesnapshots.delete method.

    DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots/SNAPSHOT_NAME
  • (Preview) To delete a regionallyscoped snapshot, make aDELETE request to thesnapshots.delete methodand specify the region.

    DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION_NAME/snapshots/SNAPSHOT_NAME

Replace the following:

  • PROJECT_ID: The name of your project.
  • SNAPSHOT_NAME: The name of the snapshot to delete.
  • REGION_NAME: The region that the snapshot isscoped to.

Delete multiple snapshots based on a filter

Warning: Deleting a snapshot is irreversible. You can't recover a deleted snapshot.

Compute Engine uses differential snapshots so that each snapshotcontains only the data that has changed since the previous snapshot. Becausesubsequent snapshots might require information stored in a previoussnapshot, deleting a snapshot does not necessarily deleteall the data on the snapshot.

To learn more about snapshot deletion, seeSnapshot deletion.

You can delete a number of snapshots based on agiven filter. For more information on how to use filters with thegcloud CLI, seegcloud CLI topic filters.

To delete the snapshots, use a combination of thegcloud compute snapshots list commandwith a given filter, and thegcloud compute snapshots delete commandwithxargs.

  gcloud compute snapshots list --filter="EXPRESSION" --uri |  xargs gcloud compute snapshots delete

ReplaceEXPRESSION with a gcloud CLI topicfilter.

For example,--filter="creationTimestamp<'2023-12-31'" deletes all snapshotscreated before December 31, 2023.

Share snapshot data across projects in the same organization

You can use this procedure to move data from a disk in one project to a diskin a different project within the same organization.

gcloud

  1. Create a standard snapshot in the destination project by using thegcloud compute snapshots create command.For example, to create a snapshot of a zonal Persistent Disk orHyperdisk, use the following command:

    gcloud compute snapshots createSNAPSHOT_NAME \ --source-disk https://www.googleapis.com/compute/v1/projects/SOURCE_PROJECT_ID/zones/ZONE/disks/SOURCE_DISK_NAME \ --projectDESTINATION_PROJECT_ID

    Replace the following:

    • SNAPSHOT_NAME: A name for the new snapshot.
    • SOURCE_PROJECT_ID: The ID of the project for the sourcedisk.
    • ZONE: The zone of the source disk.
    • SOURCE_DISK_NAME: The name of the source disk.
    • DESTINATION_PROJECT_ID: The ID of the destination projectfor the new snapshot.
  2. In the destination project, create a zonal or regional disk that'sbased on the snapshot by using thegcloud compute disks create command:

    gcloud compute disks createDISK_NAME \ --source-snapshotSNAPSHOT_NAME \ --projectDESTINATION_PROJECT_ID

    Replace the following:

    • DISK_NAME: A name for the new disk.
    • SNAPSHOT_NAME: The name of the snapshot.
    • DESTINATION_PROJECT_ID: The ID of the destination project forthe new disk.

REST

  1. Create a standard snapshot in the destination project by calling thesnapshots.insert method.For example, to take a snapshot of a zonal Persistent Disk orHyperdisk, make the following request:

    POST https://compute.googleapis.com/compute/v1/projects/DESTINATION_PROJECT_ID/global/snapshots{ "name":SNAPSHOT_NAME "sourceDisk": "projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks/SOURCE_DISK_NAME}

    Replace the following:

    • DESTINATION_PROJECT_ID: The ID of the destination project forthe new snapshot.
    • SNAPSHOT_NAME: A name for the snapshot.
    • SOURCE_PROJECT_ID: The ID of the source disk project.
    • SOURCE_ZONE: The zone of the source disk.
    • SOURCE_DISK_NAME: The name of the source disk.
  2. In the destination project, create a zonal or regional disk that'sbased on the snapshot by using the zonaldisks.insert methodor the regionalregionDisks.insert method.

    For example, to create a zonal disk, make the following request:

    POST https://compute.googleapis.com/compute/v1/projects/DESTINATION_PROJECT_ID/zones/DESTINATION_ZONE/disks{ "name":DISK_NAME "sourceSnapshot":SNAPSHOT_NAME}

    Replace the following:

    • DESTINATION_PROJECT_ID: The ID of the destination project forthe new disk.
    • DESTINATION_ZONE: The zone in the destination project forthe new disk.
    • DISK_NAME: A name for the new disk.
    • SNAPSHOT_NAME: The name of the snapshot.

To get a list of snapshots available to you, seeView the standard snapshots in a project or location.

Share a snapshot across projects in different organizations

You can use this procedure to share a standard snapshot in a project in oneorganization with a different project in another organization.

gcloud

  1. In the source project, create a disk that's based on the snapshot byusing thegcloud compute disks create command.

    gcloud compute disks createDISK_NAME \ --source-snapshotSNAPSHOT_NAME \ --projectSOURCE_PROJECT_ID \ --zoneZONE

    Replace the following:

    • DISK_NAME: A name for the new disk.
    • SNAPSHOT_NAME: The name of the snapshot.
    • SOURCE_PROJECT_ID: The ID of the source project.
    • ZONE: The zone to create the new disk in.

    This disk is a temporary disk that is created only to copy the snapshotacross organizations.

  2. In the destination project, create a snapshot by using thegcloud compute snapshots create command.

    For example, to create a snapshot using the zonal disk created in the firststep, use the following command:

    gcloud compute snapshots createSNAPSHOT_NAME \ --source-disk https://www.googleapis.com/compute/v1/projects/SOURCE_PROJECT_ID/zones/ZONE/disks/DISK_NAME \ --projectDESTINATION_PROJECT_ID

    Replace the following:

    • SNAPSHOT_NAME: A name for the snapshot.
    • SOURCE_PROJECT_ID: The ID of the project that contains thesource disk.
    • ZONE: The zone of the source disk.
    • DISK_NAME: The name of the disk created in step 1.
    • DESTINATION_PROJECT_ID: The ID of the destination projectfor the new snapshot.

    To get a list of snapshots available to you, seeView the standard snapshots in a project or location.

  3. Delete the temporary disk created in the first step using thegcloud compute disks delete command.

    gcloud compute disks deleteDISK_NAME \ --projectSOURCE_PROJECT_ID --zoneZONE

    Replace the following:

    • DISK_NAME: The name of the disk created in step 1.
    • SOURCE_PROJECT_ID: The ID of the project that contains thesource disk.
    • ZONE: The zone of the disk.

REST

  1. In the source project, create a zonal or regional disk that'sbased on the snapshot by using the zonaldisks.insert method.

    For example, to create a zonal disk, make the following request:

    POST https://compute.googleapis.com/compute/v1/projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks{ "name":DISK_NAME "sourceSnapshot":SNAPSHOT_NAME}

    Replace the following:

    • SOURCE_PROJECT_ID: The ID of the source project for thenew disk.
    • SOURCE_ZONE: The zone for new disk.
    • DISK_NAME: A name for the new disk.
    • SNAPSHOT_NAME: The name of the snapshot.

    This disk is a temporary disk that is created only to copy the snapshotacross organizations.

  2. Create a snapshot in the destination project by calling thesnapshots.insert method.

    For example, to create a snapshot using the zonal disk created in thefirst step, use the following command:

    POST https://compute.googleapis.com/compute/v1/projects/DESTINATION_PROJECT_ID/global/snapshots{   "name":SNAPSHOT_NAME   "sourceDisk": "projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks/DISK_NAME}

    Replace the following:

    • DESTINATION_PROJECT_ID: The ID of the destination projectfor the new snapshot.
    • SNAPSHOT_NAME: A name for the snapshot.
    • SOURCE_PROJECT_ID: The ID of the project that containsthe source disk.
    • SOURCE_ZONE: The zone of the source disk.
    • DISK_NAME: The name of the source disk.
  3. Delete the temporary disk created in the first step using thedisks.delete method.

    DELETE https://compute.googleapis.com/compute/v1/projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks/DISK_NAME

    Replace the following:

    • SOURCE_PROJECT_ID: The ID of the project that containsthe temporary disk.
    • SOURCE_ZONE: The zone of the disk.
    • DISK_NAME: The name of the temporary disk created in step 1.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.