- gcloud alpha compute resource-policies create snapshot-schedule - create a Compute Engine Snapshot Schedule Resource Policy
gcloud alpha compute resource-policies create snapshot-schedule
(ALPHA)Create a Compute Engine Snapshot Schedule Resource Policy.
- POSITIONAL ARGUMENTS
- Name of the resource policy to operate on.
- REQUIRED FLAGS
- Maximum number of days snapshot can be retained.
Cycle Frequency Group. Exactly one of these must be specified:
A JSON/YAML file which specifies a weekly schedule. It should be a list of
objects with the following fields:
day: Day of the week with the same choices as
--weekly-schedule. startTime: Start time of the snapshot schedule with the same format as --start-time.
Start time for the disk snapshot schedule in UTC. For example,
--start-time="15:00". This flag must be specified if any of the other arguments in this group are specified.
Exactly one of these must be specified:
- Snapshot schedule starts daily at START_TIME.
- Snapshot schedule occurs every n hours starting at START_TIME.
Snapshot schedule occurs weekly on WEEKLY_SCHEDULE at START_TIME.
WEEKLY_CYCLEmust be one of:
- From file:
- OPTIONAL FLAGS
- An optional, textual description for the backend.
Retention behavior of automatic snapshots in the event of source disk deletion.
ON_SOURCE_DISK_DELETEmust be one of:
- Continue to apply the retention window to automatically-created snapshots when the source disk is deleted.
- Keep automatically-created snapshots when the source disk is deleted. This is the default behavior.
Region of the resource policy to operate on. If not specified, you may be
prompted to select a region (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
gcloud config set compute/region REGION
A list of regions can be fetched by running:
To unset the property, run:
gcloud config unset compute/region
Alternatively, the region can be stored in the environment variable
- Create an application consistent snapshot by informing the OS to prepare for the snapshot process.
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.
These will be added to the disk snapshots on creation.
- 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.
- GCLOUD WIDE FLAGS
These flags are available to all commands:
$ gcloud helpfor details.
The following command creates a Compute Engine Snapshot Schedule Resource Policy
with a daily snapshot taken at 13:00Z and a one day snapshot retention policy.
gcloud alpha compute resource-policies create snapshot-schedule my-resource-policy --region=REGION --start-time=13:00 --daily-schedule --max-retention-days=1
- This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you may be trying to access an API with an invitation-only early access allowlist. These variants are also available:
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 2020-12-15 UTC.