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 beginSelect the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
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
.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:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
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:
roles/compute.instanceAdmin.v1
)roles/iam.serviceAccountUser
)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 permissionsThe following permissions are required to create a disk from an instant snapshot:
compute.disks.create
on the destination project for the new disk compute.instantSnapshots.useReadOnly
on the source instant snapshotYou might also be able to get these permissions with custom roles or other predefined roles.
RestrictionsThe following restrictions apply:
When you create a disk from an instant snapshot, the new disk always has the same type, storage location, and encryption as the source disk of the snapshot.
You can't create a VM directly from an instant snapshot. You must create a disk from the instant snapshot and then use the new disk to create a VM.
If the source disk of the instant snapshot uses customer-managed or customer-supplied encryption keys, you must provide the same encryption key when you create a new disk from the instant snapshot.
Consider this example. Imagine you have a disk, DISK-1
encrypted with a customer-supplied encryption key (CSEK), KEY-1
. You also have an instant snapshot, IS-1
, created from DISK-1
. To create a new disk from IS-1
, you must provide the same key, KEY-1
, when you create the new disk.
If the disk is encrypted with customer-managed encryption keys (CMEK), you only have to provide the key if you use the REST or the gcloud CLI to create the disk. If you use the Google Cloud console, you don't need to specify the encryption key.
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 encryptionYou can create a disk from an instant snapshot with the gcloud CLI, the Google Cloud console, or the REST.
ConsoleFind the instant snapshot that you want to restore:
In the Google Cloud console, go to the Snapshots page.
Click the Instant snapshots tab.
In the Name column, click the name of the instant snapshot you want to restore.
Click Create disk.
In the Name field, enter a new name for the disk.
Optional: In the Description field, enter additional details.
Verify that the Disk source type is Instant snapshot.
In the Source instant snapshot list, choose the instant snapshot.
Optional: Configure additional customizations for the disk.
Optional: To organize your project, add one or more labels.
To create the disk, click Create.
Use the gcloud compute disks create
command. The arguments you specify depend on whether you're creating a zonal or regional 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:
DISK_NAME
: the name of the new disk.ZONE
: the zone for the new disk, for example, europe-west1-a
.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.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:
DISK_NAME
: the name of the new disk.REGION
: the region for the regional disk to reside in, for example: europe-west1
.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.ZONE1,ZONE2
: the zones within the region where the two disk replicas are located, for example: europe-west1-b,europe-west1-c
.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.
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:
PROJECT
: the project in which to create the new disk.SOURCE_ZONE
: the zone where the instant snapshot is located, for example, us-central1-a
. The disk is created in this zone.NEW_DISK_NAME
: a unique name for the new disk.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.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:
PROJECT
: the project in which to create the new disk.SOURCE_REGION
: the region where the instant snapshot is located. The disk is created in this region.NEW_DISK_NAME
: a unique name for the new disk.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.ZONE1,ZONE2
: the zones within the region for the two disk replicas, for example, europe-west1-b
,europe-west1-c
.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.
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:
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.
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:
NEW_DISK_NAME
: the name of the new disk.SOURCE_ZONE
: the zone where the instant snapshot is stored, for example, europe-west1-a
.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.KMS_PROJECT_NAME
: the project containing the key.KEYRING_LOCATION
: the location of the key ring that the key belongs to. If the key ring is global, specify global
. Otherwise, specify the name of the region where the key ring is located, for example, us-west1
.KEY_RING_NAME
: the name of the key ring that includes the key, for example, key-ring-1
.KEY_NAME
: the name of the key used to encrypt the disk.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:
NEW_DISK_NAME
: the name of the new disk.SOURCE_ZONE
: the zone where the instant snapshot is stored, for example, europe-west1-a
.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.CSEK_JSON_FILE
: Path to a JSON file containing the key. See an example of the CSEK file format.To create a regional disk, replace the --zone
flag in the preceding example with the following flags:
--region
: the region for the new disk--replica-zones
: the zones within the region for the two disk replicas.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.
CMEKIn 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:
NEW_DISK_NAME
: a unique name for the new disk.PROJECT
: the project in which to create the new disk.SOURCE_ZONE
: the zone where the instant snapshot is located, for example, us-central1-a
. The disk is created in this zone.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.KMS_PROJECT
: the project containing the key.LOCATION
: the location of the key ring that the key belongs to. If the key ring is global, specify global
. Otherwise, specify the name of the region where the key ring is located, for example, us-west1
.KEY_RING
: the name of the key ring that includes the key, for example, key-ring-1
.KEY
: the name of the key used to encrypt the disk.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:
PROJECT
: the project in which to create the new disk.SOURCE_ZONE
: the zone where the instant snapshot is located, for example, us-central1-a
. The disk is created in this zone.NEW_DISK_NAME
: a unique name for the new disk.SOURCE_INSTANT_SNAPSHOT_NAME
: the name of the source instant snapshot.RAW_ENCRYPTION_KEY
: The key used to encrypt the instant snapshot and its source disk, for example, SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0=
.To use an RSA-encrypted key, modify the preceding example as follows:
Make a POST
request to the disks.insert
method:
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/disks/insert
Specify the key in the diskEncryptionKey.rsaEncryptedKey
property of the request body:
"diskEncryptionKey": { "rsaEncryptedKey": "RSA_ENCRYPTED_KEY" }
Replace RSA_ENCRYPTED_KEY
with your encrypted key.
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