A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/compute/docs/disks/manage-snapshots below:

Manage disk snapshots | Compute Engine Documentation

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

You can view, list, and delete disk snapshots. You can also share 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, see Manage 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 the Required permissions section:

Required permissions

The following permissions are required to manage standard snapshots:

You might also be able to get these permissions with custom roles or other predefined roles.

View the standard snapshots in a project or location

You can view or list the standard snapshots in a project or location by using the gcloud CLI, Google Cloud console, or the REST.

Console
  1. In the Google Cloud console, go to the Snapshots page.

    Go to the Snapshots page

  2. On the Snapshots tab, you can see the standard snapshots for the current project.

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

gcloud

Replace the following:

REST

Replace the following:

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 the Snapshots page.

    Go to the Snapshots page

  2. On the Snapshots tab, a list of all the standard snapshots in the project appears.

  3. Narrow the results by source disk:

    1. Enter Source disk: in the filter_list Filter field, or click the Filter field and then choose the value Source disk from the Properties list.

    2. Select the name of the disk from the Values list that appears next to Source disk: in the Filter field.

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

      If you don't see the name of a disk in the Values list, then in the Filter field next to Source disk:, type in the first few letters of the source disk's name to change the list of values that you see.

gcloud

List the standard snapshots for a disk with the gcloud compute snapshots list command and the --filter argument.

Replace the following:

REST

List the standard snapshots for a zonal or regional disk with a GET request to the snapshots.list method.

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

Replace the following:

View information about a standard snapshot

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

Console
  1. In the Google Cloud console, go to the Snapshots page.

    Go to the Snapshots page

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

  3. In the Name column, click the name of the standard snapshot. The Snapshot details page for the selected snapshot appears, showing its properties.

gcloud

Replace the following:

REST

Replace the following:

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

Compute Engine uses differential snapshots so that each snapshot contains only the data that has changed since the previous snapshot. Because subsequent snapshots might require information stored in a previous snapshot, keep in mind that deleting a snapshot does not necessarily delete all the data on the snapshot.

To learn more about snapshot deletion, see Snapshot deletion.

Console
  1. Go to the Snapshots 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 the Snapshots page, click Delete.

gcloud

Replace the following:

Go Java Node.js Python REST

Replace the following:

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 snapshot contains only the data that has changed since the previous snapshot. Because subsequent snapshots might require information stored in a previous snapshot, deleting a snapshot does not necessarily delete all the data on the snapshot.

To learn more about snapshot deletion, see Snapshot deletion.

You can delete a number of snapshots based on a given filter. For more information on how to use filters with the gcloud CLI, see gcloud CLI topic filters.

To delete the snapshots, use a combination of the gcloud compute snapshots list command with a given filter, and the gcloud compute snapshots delete command with xargs.

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

Replace EXPRESSION with a gcloud CLI topic filter.

For example, --filter="creationTimestamp<'2023-12-31'" deletes all snapshots created 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 disk in a different project within the same organization.

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

    gcloud compute snapshots create SNAPSHOT_NAME \
     --source-disk https://www.googleapis.com/compute/v1/projects/SOURCE_PROJECT_ID/zones/ZONE/disks/SOURCE_DISK_NAME \
     --project DESTINATION_PROJECT_ID
    

    Replace the following:

  2. In the destination project, create a zonal or regional disk that's based on the snapshot by using the gcloud compute disks create command:

    gcloud compute disks create DISK_NAME \
     --source-snapshot SNAPSHOT_NAME \
     --project DESTINATION_PROJECT_ID
    

    Replace the following:

REST
  1. Create a standard snapshot in the destination project by calling the snapshots.insert method. For example, to take a snapshot of a zonal Persistent Disk or Hyperdisk, 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:

  2. In the destination project, create a zonal or regional disk that's based on the snapshot by using the zonal disks.insert method or the regional regionDisks.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:

To get a list of snapshots available to you, see View 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 one organization with a different project in another organization.

gcloud
  1. In the source project, create a disk that's based on the snapshot by using the gcloud compute disks create command.

    gcloud compute disks create DISK_NAME \
     --source-snapshot SNAPSHOT_NAME \
     --project SOURCE_PROJECT_ID \
     --zone ZONE
    

    Replace the following:

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

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

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

    gcloud compute snapshots create SNAPSHOT_NAME \
     --source-disk https://www.googleapis.com/compute/v1/projects/SOURCE_PROJECT_ID/zones/ZONE/disks/DISK_NAME \
     --project DESTINATION_PROJECT_ID
    

    Replace the following:

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

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

    gcloud compute disks delete DISK_NAME \
     --project SOURCE_PROJECT_ID --zone ZONE
    

    Replace the following:

REST
  1. In the source project, create a zonal or regional disk that's based on the snapshot by using the zonal disks.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:

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

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

    For example, to create a snapshot using the zonal disk created in the first 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:

  3. Delete the temporary disk created in the first step using the disks.delete method.

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

    Replace the following:

What's next

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4