gcloud compute snapshots create

NAME
gcloud compute snapshots create - create Compute Engine snapshots
SYNOPSIS
gcloud compute snapshots createNAME[--async][--chain-name=CHAIN_NAME][--csek-key-file=FILE][--description=DESCRIPTION][--guest-flush][--labels=[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][--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
gcloud compute snapshots create creates snapshot of persistentdisk. Snapshots are useful for backing up persistent disk data and for creatingcustom 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:
gcloudcomputesnapshotscreatemy-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.

--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.
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
These variants are also available:
gcloudalphacomputesnapshotscreate
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 2025-05-07 UTC.