Manage disk snapshots Stay organized with collections Save and categorize content based on your preferences.
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
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- Set a default region and zone.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
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:
- Compute Instance Admin (v1) (
roles/compute.instanceAdmin.v1) - To connect to a VM that can run as a service account:Service Account User (v1) (
roles/iam.serviceAccountUser)
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.liston the project - To view information about a snapshot:
compute.snapshots.geton the snapshot - To delete a snapshot:
compute.snapshots.deleteon the snapshot - To delete snapshots based on a filter:
compute.snapshots.deleteon the snapshotcompute.snapshots.liston the project
- To share snapshot data across projects:
compute.storageAdminon the project (for accessing all standard snapshots)compute.disks.createon the project to share withcompute.snapshots.createon the source projectcompute.disks.createSnapshoton 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
In the Google Cloud console, go to theSnapshots page.
On theSnapshots tab, you can see the standard snapshots for thecurrent project.
Optional. Narrow your results with thefilter_listFilter field. Enter a property name or value in theFilter field,or choose from the available properties.
gcloud
To see a list of all snapshots available to you in aparticular project, use the
gcloud compute snapshots listcommand.gcloud compute snapshots list --project=PROJECT_ID
(Preview) To see a list ofregionally scoped snapshots available to you in aparticular project, use the
gcloud compute snapshots listcommandand specify the region.gcloud compute snapshots list --region=REGION_NAME
To see a list of globally scoped snapshots available to you in aparticular project, use the
gcloud compute snapshots listcommandand include the--globalflag.gcloud compute snapshots list --global
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 a
GETrequest to thesnapshots.listmethodand 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 a
GETrequest to thesnapshots.listmethodand 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 a
GETrequest to thesnapshots.listmethodand 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
In the Google Cloud console, go to theSnapshots page.
On theSnapshots tab, a list of all the standard snapshots in theproject appears.
Narrow the results by source disk:
Enter
Source disk:in thefilter_listFilter field, or click theFilter field and then choose thevalueSource diskfrom theProperties list.Select the name of the disk from theValues list that appears nextto
Source 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 to
Source 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
In the Google Cloud console, go to theSnapshots page.
On theSnapshots tab, view the list of snapshots in the project.
In theName column, click the name of the standard snapshot. TheSnapshot details page for the selected snapshot appears,showing its properties.
gcloud
To view information about a globally scoped standard snapshot, use the
gcloud compute snapshots describecommand.gcloud compute snapshots describeSNAPSHOT_NAME
(Preview) To view information abouta regionally scoped standard snapshot, usethe
gcloud compute snapshots describecommandand specify the region.gcloud compute snapshots describeSNAPSHOT_NAME --regions=REGION_NAME
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 a
GETrequest to thesnapshots.getmethod.GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots/SNAPSHOT_NAME
(Preview) To view information abouta regionally scoped standard snapshot, make a
GETrequest to thesnapshots.getmethodand 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
Go to theSnapshots page in the Google Cloud console.
Select one or more snapshots that you want to delete.
At the top of theSnapshots page, clickDelete.
gcloud
To delete a globally scoped snapshot, use the
gcloud compute snapshots deletecommand.gcloud compute snapshots deleteSNAPSHOT_NAME(Preview) To delete a regionallyscoped snapshot, use the
gcloud compute snapshots deletecommandand specify the region name.gcloud compute snapshots deleteSNAPSHOT_NAME --regions=REGION_NAME
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 a
DELETErequest to thesnapshots.deletemethod.DELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/snapshots/SNAPSHOT_NAME
(Preview) To delete a regionallyscoped snapshot, make a
DELETErequest to thesnapshots.deletemethodand 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
Create a standard snapshot in the destination project by using the
gcloud compute snapshots createcommand.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.
In the destination project, create a zonal or regional disk that'sbased on the snapshot by using the
gcloud compute disks createcommand: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
Create a standard snapshot in the destination project by calling the
snapshots.insertmethod.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.
In the destination project, create a zonal or regional disk that'sbased on the snapshot by using the zonal
disks.insertmethodor the regionalregionDisks.insertmethod.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
In the source project, create a disk that's based on the snapshot byusing the
gcloud compute disks createcommand.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.
In the destination project, create a snapshot by using the
gcloud compute snapshots createcommand.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.
Delete the temporary disk created in the first step using the
gcloud compute disks deletecommand.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
In the source project, create a zonal or regional disk that'sbased on the snapshot by using the zonal
disks.insertmethod.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.
Create a snapshot in the destination project by calling the
snapshots.insertmethod.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.
Delete the temporary disk created in the first step using the
disks.deletemethod.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
- Learn how tocreate scheduled snapshots for disks.
- Learn how tocreate a disk image from your snapshot.
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.