A Compute Engine VM serves files from a 2 TB zonal persistent disk. Operations wants a backup of that disk taken every day, with each backup kept for 14 days and then removed. The solution must need the least ongoing operational effort. What should you do?
Choose one.
Snapshot schedules are Compute Engine resource policies that create incremental snapshots of a disk on a fixed cadence and delete them after a retention window.
All four options produce daily backups with 14-day expiry; the constraint is the least ongoing effort. A snapshot schedule attached to the disk does both halves natively: Compute Engine takes the snapshot and deletes copies past the retention window, with no code. A cron job and a Cloud Scheduler-triggered function both work but leave scripts, credentials and infrastructure to maintain. Machine images have no schedule or retention policy, so they would be created and deleted by hand.
- Create the policy: gcloud compute resource-policies create snapshot-schedule daily-backup --daily-schedule --start-time=03:00 --max-retention-days=14 --region=REGION.
- Attach it: gcloud compute disks add-resource-policies DISK --resource-policies=daily-backup --zone=ZONE.
- Check that snapshots appear daily with gcloud compute snapshots list and that older ones expire.
Exam tip: Scheduled disk backups with automatic expiry = a snapshot schedule resource policy attached to the disk.
Managing Compute Engine, GKE, and Cloud Run: Day-2 Operations — the lesson that teaches this.