gcloud alpha compute disks snapshot

NAME
gcloud alpha compute disks snapshot - create snapshots of Compute Engine persistent disks
SYNOPSIS
gcloud alpha compute disks snapshotDISK_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]
DESCRIPTION
(ALPHA)gcloud alpha compute disks snapshot createssnapshots of persistent disks. Snapshots are useful for backing up data, copyinga persistent disk, and even, creating a custom image. Snapshots can be createdfrom persistent disks even while they are attached to running instances. Oncecreated, snapshots may be managed (listed, deleted, etc.) viagcloud computesnapshots.

Refer to the Snapshot best practices guide.https://cloud.google.com/compute/docs/disks/snapshot-best-practices

gcloud alpha compute disks snapshot waits until the operation returns a statusofREADY orFAILED, or reaches the maximum timeout,and returns the last known details of the snapshot.

Note: To create snapshots, the following IAM permissions are necessarycompute.disks.createSnapshot,compute.snapshots.create,compute.snapshots.get, andcompute.zoneOperations.get.

EXAMPLES
To create a snapshot namedsnapshot-test of a persistent disk namedtest in zoneus-central1-a, run:
gcloudalphacomputediskssnapshottest--zone=us-central1-a--snapshot-names=snapshot-test--description="This is an example snapshot"
POSITIONAL ARGUMENTS
DISK_NAME [DISK_NAME …]
Names of the disks to operate on.
FLAGS
--async
Return immediately, without waiting for the operation in progress to complete.
--chain-name=CHAIN_NAME
Create the new snapshot in the snapshot chain labeled with the specified name.The chain name must be 1-63 characters long and comply with RFC1035. Use thisflag only if you are an advanced service owner who needs to create separatesnapshot chains, for example, for chargeback tracking. When you describe yoursnapshot resource, this field is visible only if it has a non-empty value.
--csek-key-file=FILE
Path to a Customer-Supplied Encryption Key (CSEK) key file that maps ComputeEngine resources to user managed keys to be used when creating, mounting, ortaking snapshots of disks.

If you pass- as value of the flag, the CSEK is read from stdin.Seehttps://cloud.google.com/compute/docs/disks/customer-supplied-encryptionfor more details.

--description=DESCRIPTION
Text to describe the snapshots being created.
--guest-flush
Create an application-consistent snapshot by informing the OS to prepare for thesnapshot process.
--labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add.

Keys must start with a lowercase character and contain only hyphens(-), underscores (_), lowercase characters, andnumbers. Values must contain only hyphens (-), underscores(_), lowercase characters, and numbers.

--snapshot-names=SNAPSHOT_NAME,[…]
Names to assign to the created snapshots. Without this option, the name of eachsnapshot will be a random 12-character alphanumeric string that starts with aletter. The values of this option run parallel to the disks specified. Forexample,
gcloudalphacomputediskssnapshotmy-disk-1my-disk-2my-disk-3--snapshot-namessnapshot-1,snapshot-2,snapshot-3

will result inmy-disk-1 being snapshotted assnapshot-1,my-disk-2 assnapshot-2, andso on. The name must match the(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?) regular expression, whichmeans it must start with an alphabetic character followed by one or morealphanumeric characters or dashes. The name must not exceed 63 characters andmust not contain special symbols. All characters must be lowercase.

--storage-location=LOCATION
Google Cloud Storage location, either regional or multi-regional, where snapshotcontent is to be stored. If absent, a nearby regional or multi-regional locationis chosen automatically.
At most one of these can be specified:
--region=REGION
Region of the disks to operate on. If not specified, you might be prompted toselect a region (interactive mode only).

To avoid prompting when this flag is omitted, you can set thecompute/region property:

gcloudconfigsetcompute/regionREGION

A list of regions can be fetched by running:

gcloudcomputeregionslist

To unset the property, run:

gcloudconfigunsetcompute/region

Alternatively, the region can be stored in the environment variableCLOUDSDK_COMPUTE_REGION.

--zone=ZONE
Zone of the disks to operate on. If not specified and thecompute/zone property isn't set, you mightbe prompted to select a zone (interactive mode only).

To avoid prompting when this flag is omitted, you can set thecompute/zone property:

gcloudconfigsetcompute/zoneZONE

A list of zones can be fetched by running:

gcloudcomputezoneslist

To unset the property, run:

gcloudconfigunsetcompute/zone

Alternatively, the zone can be stored in the environment variableCLOUDSDK_COMPUTE_ZONE.

GCLOUD WIDE FLAGS
These flags are available to all commands:--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.

NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudcomputediskssnapshot
gcloudbetacomputediskssnapshot

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-07-22 UTC.