gcloud alpha compute snapshots create

NAME
gcloud alpha compute snapshots create - create Compute Engine snapshots
SYNOPSIS
gcloud alpha compute snapshots createNAME[--async][--chain-name=CHAIN_NAME][--csek-key-file=FILE][--description=DESCRIPTION][--guest-flush][--labels=[KEY=VALUE,…]][--max-retention-days=MAX_RETENTION_DAYS][--resource-manager-tags=[KEY=VALUE,…]][--snapshot-type=SNAPSHOT_TYPE][--source-disk=SOURCE_DISK][--source-disk-for-recovery-checkpoint=SOURCE_DISK_FOR_RECOVERY_CHECKPOINT][--source-disk-for-recovery-checkpoint-region=SOURCE_DISK_FOR_RECOVERY_CHECKPOINT_REGION][--source-disk-key-file=FILE][--source-instant-snapshot=SOURCE_INSTANT_SNAPSHOT][--source-instant-snapshot-key-file=FILE][--storage-location=LOCATION][--global    |--region=REGION][--kms-key=KMS_KEY :--kms-keyring=KMS_KEYRING--kms-location=KMS_LOCATION--kms-project=KMS_PROJECT][--source-disk-region=SOURCE_DISK_REGION    |--source-disk-zone=SOURCE_DISK_ZONE][--source-instant-snapshot-region=SOURCE_INSTANT_SNAPSHOT_REGION    |--source-instant-snapshot-zone=SOURCE_INSTANT_SNAPSHOT_ZONE][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA)gcloud alpha compute snapshots create createssnapshot of persistent disk. Snapshots are useful for backing up persistent diskdata and for creating custom images. For more information, seehttps://cloud.google.com/compute/docs/disks/create-snapshots.
EXAMPLES
To create a snapshot 'my-snap' from a disk 'my-disk' in zone 'us-east1-a', run:
gcloudalphacomputesnapshotscreatemy-snap--source-disk=my-disk--source-disk-zone=us-east1-a
POSITIONAL ARGUMENTS
NAME
The name of the snapshot.
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 new snapshot.
--guest-flush
Create an application-consistent snapshot by informing the OS to prepare for thesnapshot process. Currently only supported for creating snapshots of disksattached to Windows instances.
--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.

--max-retention-days=MAX_RETENTION_DAYS
Days for snapshot to live before being automatically deleted. If unspecified,the snapshot will live until manually deleted.
--resource-manager-tags=[KEY=VALUE,…]
A comma-separated list of Resource Manager tags to apply to the snapshot.
--snapshot-type=SNAPSHOT_TYPE
Type of snapshot. If a snapshot type is not specified, a STANDARD snapshot willbe created.SNAPSHOT_TYPE must be one of:ARCHIVE,STANDARD.
--source-disk=SOURCE_DISK
Source disk used to create the snapshot. To create a snapshot from a source diskin a different project, specify the full path to the source disk. For example:https://www.googleapis.com/compute/v1/projects/MY-PROJECT/zones/MY-ZONE/disks/MY-DISK
--source-disk-for-recovery-checkpoint=SOURCE_DISK_FOR_RECOVERY_CHECKPOINT
Source disk whose recovery checkpoint used to create the snapshot. To create asnapshot from the recovery checkpoint of a source disk in a different project,specify the full path to the source disk. For example:projects/MY-PROJECT/regions/MY-REGION/disks/MY-DISK
--source-disk-for-recovery-checkpoint-region=SOURCE_DISK_FOR_RECOVERY_CHECKPOINT_REGION
Region of the source disk for recovery checkpoint to operate on. Overrides thedefaultcompute/region property value for this command invocation.
--source-disk-key-file=FILE
Path to the customer-supplied encryption key of the source disk. Required if thesource disk is protected by a customer-supplied encryption key.
--source-instant-snapshot=SOURCE_INSTANT_SNAPSHOT
The name or URL of the source instant snapshot. If the name is provided, theinstant snapshot's zone or region must be specified with--source-instant-snapshot-zone or --source-instant-snapshot-region accordingly.To create a snapshot from an instant snapshot in a different project, specifythe full path to the instant snapshot. If the URL is provided, format should be:https://www.googleapis.com/compute/v1/projects/MY-PROJECT/zones/MY-ZONE/instantSnapshots/MY-INSTANT-SNAPSHOT
--source-instant-snapshot-key-file=FILE
Path to the customer-supplied encryption key of the source instant snapshot.Required if the source instant snapshot is protected by a customer-suppliedencryption key.
--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.
Scope for snapshot.

At most one of these can be specified:

--global
If set, the snapshot will be created in the global scope
--region=REGION
If set, the snapshot will be created in the regional scope
Key resource - The Cloud KMS (Key Management Service) cryptokey that will beused to protect the snapshot. The 'Compute Engine Service Agent' service accountmust hold permission 'Cloud KMS CryptoKey Encrypter/Decrypter'. The arguments inthis group can be used to specify the attributes of this resource.
--kms-key=KMS_KEY
ID of the key or fully qualified identifier for the key.

To set thekms-key attribute:

  • provide the argument--kms-key on the command line.

This flag argument must be specified if any of the other arguments in this groupare specified.

--kms-keyring=KMS_KEYRING
The KMS keyring of the key.

To set thekms-keyring attribute:

  • provide the argument--kms-key on the command line with a fullyspecified name;
  • provide the argument--kms-keyring on the command line.
--kms-location=KMS_LOCATION
The Google Cloud location for the key.

To set thekms-location attribute:

  • provide the argument--kms-key on the command line with a fullyspecified name;
  • provide the argument--kms-location on the command line;
  • provide the argument--region on the command line.
--kms-project=KMS_PROJECT
The Google Cloud project for the key.

To set thekms-project attribute:

  • provide the argument--kms-key on the command line with a fullyspecified name;
  • provide the argument--kms-project on the command line;
  • set the propertycore/project.
At most one of these can be specified:
--source-disk-region=SOURCE_DISK_REGION
Region of the source disk to operate on. Overrides the defaultcompute/region property value for this command invocation.
--source-disk-zone=SOURCE_DISK_ZONE
Zone of the source disk to operate on. Overrides the defaultcompute/zone property value for this command invocation.
At most one of these can be specified:
--source-instant-snapshot-region=SOURCE_INSTANT_SNAPSHOT_REGION
Region of the source instant snapshot to operate on. Overrides the defaultcompute/region property value for this command invocation.
--source-instant-snapshot-zone=SOURCE_INSTANT_SNAPSHOT_ZONE
Zone of the source instant snapshot to operate on. Overrides the defaultcompute/zone property value for this command invocation.
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:
gcloudcomputesnapshotscreate
gcloudbetacomputesnapshotscreate

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 2026-01-21 UTC.