gcloud_beta_compute_disks_snapshot (1)
NAME
- gcloud beta compute disks snapshot - create snapshots of Google Compute Engine persistent disks
SYNOPSIS
-
gcloud beta compute disks snapshot DISK_NAME [DISK_NAME ...] [--async] [--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
(BETA) gcloud beta compute disks snapshot creates snapshots of
For best practices regarding managing snapshots, refer to this guide: cloud.google.com/compute/docs/disks/create-snapshots#best_practices
gcloud beta 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.
POSITIONAL ARGUMENTS
-
- DISK_NAME [DISK_NAME ...]
-
Names of the disks to operate on.
FLAGS
-
- --async
-
Display information about the operation in progress, without waiting for the
operation to complete.
- --csek-key-file=FILE
-
Path to a Customer-Supplied Encryption Key (CSEK) key file, mapping Google
Compute Engine resources to user managed keys to be used when creating,
mounting, or snapshotting disks.
If you pass - as value of the flag the CSEK will be read from stdin. See cloud.google.com/compute/docs/disks/customer-supplied-encryption for 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 the
snapshot process. Currently only supported on Windows instances using the Volume
Shadow Copy Service (VSS).
- --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, and numbers. 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 each
snapshot will be a random 12-character alphanumeric string that starts with a
letter. The values of this option run parallel to the disks specified. For
example,
- gcloud beta 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.
- --storage-location=LOCATION
-
Google Cloud Storage location, either regional or multi-regional, where
snapshot content is to be stored. If absent, a nearby regional or
multi-regional location is chosen automatically.
-
At most one of these may be specified:
-
- --region=REGION
-
Region of the disks to operate on. If not specified, you may be prompted to
select a region.
To avoid prompting when this flag is omitted, you can set the compute/region property:
- $ 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
-
Zone of the disks to operate on. If not specified and the
compute/zone property isn't set, you may be prompted to select a
zone.
To avoid prompting when this flag is omitted, you can set the compute/zone property:
- $ 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.
-
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
To create a snapshot named snapshot-test of a persistent disk named test in zone us-central1-a, run:
-
$ gcloud beta compute disks snapshot test --zone=us-central1-a \
--snapshot-names=snapshot-test \
--description="This is an example snapshot"
NOTES
This command is currently in BETA and may change without notice. These variants are also available:
- $ gcloud compute disks snapshot $ gcloud alpha compute disks snapshot