A RetroSearch Logo

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

Search Query:

Showing content from https://cloud.google.com/compute/docs/disks/restore-instant-snapshot below:

Restore a disk from an instant snapshot | Compute Engine Documentation

Restore a disk from an instant snapshot

Stay organized with collections Save and categorize content based on your preferences.

To access data captured in an instant snapshot, you must restore, or create a new disk from the instant snapshot.

This page explains how to create a disk from an instant snapshot. After you create the disk, you can use it by attaching it to a virtual machine (VM).

Before you begin Required roles and permissions

To get the permissions that you need to create a disk from an instant snapshot, 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 create a disk from an instant snapshot. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to create a disk from an instant snapshot:

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

Restrictions

The following restrictions apply:

Create a disk from an instant snapshot

An instant snapshot is encrypted with the same encryption as its source disk. The steps to create a disk from an instant snapshot depend on how the instant snapshot's source disk is encrypted.

Each source disk is encrypted with one of the following methods:

To find out how a particular disk is encrypted, see View information about a disk's encryption.

Create a disk from an instant snapshot encrypted with default encryption

You can create a disk from an instant snapshot with the gcloud CLI, the Google Cloud console, or the REST.

Console
  1. Find the instant snapshot that you want to restore:

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

      Go to Snapshots

    2. Click the Instant snapshots tab.

    3. In the Name column, click the name of the instant snapshot you want to restore.

  2. Click Create disk.

  3. In the Name field, enter a new name for the disk.

  4. Optional: In the Description field, enter additional details.

  5. Verify that the Disk source type is Instant snapshot.

  6. In the Source instant snapshot list, choose the instant snapshot.

  7. Optional: Configure additional customizations for the disk.

  8. Optional: To organize your project, add one or more labels.

  9. To create the disk, click Create.

gcloud

Use the gcloud compute disks create command. The arguments you specify depend on whether you're creating a zonal or regional disk.

Create a zonal disk

Specify the zone with the --zone flag:

gcloud compute disks create DISK_NAME --zone=ZONE \
  --source-instant-snapshot=SOURCE_INSTANT_SNAPSHOT_NAME

Replace the following:

Create a regional disk

Specify the region with --region and the new disk's target replication zones zones with --replica-zones.

gcloud compute disks create DISK_NAME \
 --region=REGION \
 --source-instant-snapshot=SOURCE_INSTANT_SNAPSHOT_NAME \
 --replica-zones=ZONE1,ZONE2

Replace the following:

REST

To create a zonal or regional disk from an instant snapshot, use the disks.insert method. The new disk must be the same type as that of the source disk of the instant snapshot. For example, you can't create a regional disk from a snapshot of a zonal disk.

Create a zonal disk

Make a POST request, specifying the source instant snapshot.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/SOURCE_ZONE/disks/insert
{
"name": "NEW_DISK_NAME",
"sourceInstantSnapshot": "projects/PROJECT/zones/SOURCE_ZONE/instantSnapshots/SOURCE_INSTANT_SNAPSHOT_NAME"
}

Replace the following:

Create a regional disk

Make a POST request, specifying the source instant snapshot and the zones where the disk should be replicated to.

POST https://compute.googleapis.com/compute/v1/projects/PROJECT/region/SOURCE_REGION/disks/insert

{
"name": "NEW_DISK_NAME",
"sourceInstantSnapshot": "projects/PROJECT/regions/SOURCE_REGION/instantSnapshots/SOURCE_INSTANT_SNAPSHOT_NAME",
"replicaZones": [
  "projects/PROJECT/zones/ZONE1",
  "projects/PROJECT/zones/ZONE2"
]
}

Replace the following:

API request response

If the POST request is successful, the response body will be an object that you can poll to get the status of the disk's creation. See Handling API responses for more information.

Create a disk from a CMEK- or CSEK-encrypted instant snapshot Console

If the instant snapshot uses Google default or CMEK encryption, Google Cloud console automatically provides the encryption key when you create a disk from the instant snapshot. Otherwise, if the instant snapshot is CSEK-encrypted, you must provide the encryption key to create a disk.

Follow the steps in the Google-managed encryption section, specifying the encryption key using these instructions:

  1. In the Decryption section, enter the encryption key in the Encryption key field.
  2. If the key is wrapped with the public RSA key, select Wrapped key.
gcloud

Use the gcloud compute disks create command.

If the source disk is CMEK-encrypted, use the --kms-key parameter to provide the name of the key.

If the source disk is CSEK-encrypted, use the --csek-key-file parameter to specify the source disk's encryption key.

CMEK

To create a zonal disk from a CMEK encrypted instant snapshot, use the following command:

     gcloud compute disks create NEW_DISK_NAME \
       --zone=SOURCE_ZONE \
       --source-instant-snapshot=SOURCE_INSTANT_SNAPSHOT_NAME \
       --kms-key=projects/KMS_PROJECT_NAME/locations/KEYRING_LOCATION/keyRings/KEY_RING_NAME/cryptoKeys/KEY_NAME

Replace the following:

CSEK

To create a zonal disk from a CSEK-encrypted instant snapshot, use the following command:

     gcloud compute disks create NEW_DISK_NAME \
       --zone=SOURCE_ZONE \
       --source-instant-snapshot=SOURCE_INSTANT_SNAPSHOT_NAME \
       --csek-key-file=PATH_TO_CSEK_JSON_FILE
 

Replace the following:

To create a regional disk, replace the --zone flag in the preceding example with the following flags:

REST

To create a zonal or regional disk from a CMEK- or CSEK-encrypted instant snapshot, make a POST request to the disks.insert method using the properties listed in the Google-managed encryption section.

Additionally, provide the source disk's encryption key with the diskEncryptionKey field. The properties of the diskEncryptionKey field depend on whether or not the disk is CMEK- or CSEK-encrypted.

The following examples show how to create a new zonal disk for each encryption type.

CMEK

In the request body, specify the name of the key with the diskEncryptionKey.kmsKeyName property:

{
"name": "NEW_DISK_NAME",
"sourceInstantSnapshot": "projects/PROJECT/zones/SOURCE_ZONE/instantSnapshots/SOURCE_INSTANT_SNAPSHOT_NAME",
"diskEncryptionKey": {
      "kmsKeyName": "projects/KMS_PROJECT/locations/LOCATION/keyRings/KEYRING_LOCATION/cryptoKeys/KEY_NAME"
  }
}

Replace the following:

CSEK

The request body depends on whether the CSEK used to encrypt the instant snapshot is RSA-encrypted or not.

To use a raw (non-RSA encrypted) key, specify the key in the diskEncryptionKey.rawKey property of the request body:

POST https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/SOURCE_ZONE/disks/insert
{
  "name": "NEW_DISK_NAME",
  "sourceInstantSnapshot": "projects/PROJECT/zones/SOURCE_ZONE/instantSnapshots/INSTANT_SNAPSHOT_NAME,
  "diskEncryptionKey": {
      "rawKey": "RAW_ENCRYPTION_KEY"
  }
}

Replace the following with the corresponding values:

To use an RSA-encrypted key, modify the preceding example as follows:

Replace RSA_ENCRYPTED_KEY with your encrypted key.

API request response

If the POST request is successful, the response body will be an object that you can poll to get the status of the disk's creation. See Handling API responses for more information.

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

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["To utilize data from an instant snapshot, you must create a new disk from it and then attach it to a virtual machine (VM)."],["Creating a disk from an instant snapshot requires specific IAM roles and permissions, including `compute.disks.create` and `compute.instantSnapshots.useReadOnly`."],["New disks created from instant snapshots will inherit the source disk's type, storage location, and encryption method."],["You can create disks from instant snapshots using the Google Cloud console, the `gcloud` command-line tool, or the REST API, with the process varying depending on whether the disk is a zonal or regional disk."],["When creating a disk from an instant snapshot encrypted with customer-managed (CMEK) or customer-supplied (CSEK) encryption keys, you must provide the same encryption key used for the source disk."]]],[]]


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