Stay organized with collections Save and categorize content based on your preferences.
gcloud compute disks snapshot
DISK_NAME
[DISK_NAME
…] [--async
] [--chain-name
=CHAIN_NAME
] [--csek-key-file
=FILE
] [--description
=DESCRIPTION
] [--guest-flush
] [--labels
=[KEY
=VALUE
,…]] [--snapshot-names
=SNAPSHOT_NAME
,[…]] [--storage-location
=LOCATION
] [--region
=REGION
| --zone
=ZONE
] [GCLOUD_WIDE_FLAG …
]
gcloud compute disks snapshot
creates snapshots of persistent disks. Snapshots are useful for backing up data, copying a persistent disk, and even, creating a custom image. Snapshots can be created from persistent disks even while they are attached to running instances. Once created, snapshots may be managed (listed, deleted, etc.) via gcloud compute snapshots
.
Refer to the Snapshot best practices guide. https://cloud.google.com/compute/docs/disks/snapshot-best-practices
gcloud compute disks snapshot waits until the operation returns a status of READY
or FAILED
, or reaches the maximum timeout, and returns the last known details of the snapshot.
Note: To create snapshots, the following IAM permissions are necessary
, compute.disks.createSnapshot
, compute.snapshots.create
, and compute.snapshots.get
.compute.zoneOperations.get
snapshot-test
of a persistent disk named test
in zone us-central1-a
, run:
gcloud compute disks snapshot test --zone=us-central1-a --snapshot-names=snapshot-test --description="This is an example snapshot"
DISK_NAME
[DISK_NAME
…]
--async
--chain-name
=CHAIN_NAME
--csek-key-file
=FILE
If you pass -
as value of the flag, the CSEK is read from stdin. See https://cloud.google.com/compute/docs/disks/customer-supplied-encryption for more details.
--description
=DESCRIPTION
--guest-flush
--labels
=[KEY
=VALUE
,…]
Keys must start with a lowercase character and contain only hyphens (-
), underscores (_
), lowercase characters, and numbers. Values must contain only hyphens (-
), underscores (_
), lowercase characters, and numbers.
--snapshot-names
=SNAPSHOT_NAME
,[…]
gcloud compute disks snapshot my-disk-1 my-disk-2 my-disk-3 --snapshot-names snapshot-1,snapshot-2,snapshot-3
will result in my-disk-1
being snapshotted as snapshot-1
, my-disk-2
as snapshot-2
, and so on. The name must match the (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)
regular expression, which means it must start with an alphabetic character followed by one or more alphanumeric characters or dashes. The name must not exceed 63 characters and must not contain special symbols. All characters must be lowercase.
--storage-location
=LOCATION
--region
=REGION
To avoid prompting when this flag is omitted, you can set the
property:compute/region
gcloud config set compute/region REGION
A list of regions can be fetched by running:
gcloud compute regions list
To unset the property, run:
gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable
.CLOUDSDK_COMPUTE_REGION
--zone
=ZONE
compute/zone
property isn't set, you might be prompted to select a zone (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:compute/zone
gcloud config set compute/zone ZONE
A list of zones can be fetched by running:
gcloud compute zones list
To unset the property, run:
gcloud config unset compute/zone
Alternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE
--access-token-file
, --account
, --billing-project
, --configuration
, --flags-file
, --flatten
, --format
, --help
, --impersonate-service-account
, --log-http
, --project
, --quiet
, --trace-token
, --user-output-enabled
, --verbosity
.
Run $ gcloud help
for details.
gcloud alpha compute disks snapshot
gcloud beta compute disks snapshot
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-07-22 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-07-22 UTC."],[],[]]
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