If you haven't already, set up authentication.
Authentication verifies your identity for access to Google Cloud services and APIs. To run
code or samples from a local development environment, you can authenticate to
Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI.
After installation,
initialize the Google Cloud CLI by running the following command:
To use the Go samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Java samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Node.js samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Python samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
These predefined roles contain
the permissions required to create a snapshot schedule. To see the exact permissions that are
required, expand the Required permissions section:
Required permissions
The following permissions are required to create a snapshot schedule:
To view snapshot schedules:
compute.resourcePolicies.list
on the project or organization
To update a snapshot schedule:
compute.resourcePolicies.update
on the resource policy
compute.resourcePolicies.get
on the resource policy
To replace a snapshot schedule:
compute.resourcePolicies.use
on the resource policy
compute.disks.addResourcePolicies
on the disk
compute.disks.removeResourcePolicies
on the disk
To delete a snapshot schedule:
compute.resourcePolicies.delete
on the resource policy
To get a list of snapshot schedules, use the console, gcloud command,
or the Compute Engine API method.
This request displays the name, description, and region of all
snapshot schedules within a project.
After you create a snapshot schedule, you can modify the following fields
dynamically, using the Update a snapshot schedule
procedure:
Description
Snapshot schedule
Labels applied to the generated snapshots
Source disk deletion policy for handling auto-generated snapshots if the
source disk is deleted
Retention policy to define how long to keep snapshots that are generated
from the snapshot schedule
To update other values for a snapshot schedule, you must delete the snapshot
schedule and create a new one, as described in
Replace a snapshot schedule.
The snapshot schedule updates take effect in the first snapshot after the
updates. If a snapshot is running while you update the snapshot schedule, the
changes take effect in the following snapshot.
Update a snapshot schedule
You can use Google Cloud CLI or the Compute Engine API
to change some of the properties of your snapshot schedule, as described in
Change a snapshot schedule.
To change other properties of your snapshot schedule, use the
method described in
Replace a snapshot schedule.
Follow these steps to delete the snapshot schedule and create a new one. Use
this method to modify snapshot schedule properties that can't be
changed by using the
update a snapshot schedule procedure.
If you are replacing a snapshot schedule that is already attached to a disk, you
must first detach the schedule from the disk and delete it. Then you can create
a new schedule, and attach it to the disk.
Snapshots that are generated from the detached snapshot schedule won't be
managed by the new policy. Those snapshots will be retained indefinitely until
you delete them.
Use the Google Cloud console, gcloud CLI, or REST
to remove and replace your snapshot schedule.
If you delete a snapshot schedule, all auto-generated snapshots associated
with the snapshot schedule are kept permanently. However, after the schedule
is deleted, it can no longer generate snapshots.
Your retention policy is part of your snapshot schedule. After the schedule
is deleted, your retention policy no longer applies. Snapshots that have
already been generated are kept permanently until you manually delete them.
To delete an existing snapshot schedule, use the
Google Cloud console, Google Cloud CLI, or the Compute Engine API method. If the
schedule is already attached to a disk,
detach the schedule from the disk first,
then delete the schedule. You cannot delete a snapshot schedule that is
attached to a disk.
Every scheduled snapshot associated with a disk is continuously creating
a system event,
which is monitored and logged at all times. The system event audit logs are
always enabled.
These logs provide behavioral information about your
scheduled snapshots for each associated disk. You can view your logs from the
Logging menu in the Google Cloud console.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-17 UTC."],[],[]]