A Compute Engine VM hosts a file server on a 2 TB persistent disk. Management requires an automatic daily backup of the disk retained for 14 days, with no manual intervention. What is the most appropriate solution?
Choose one.
Snapshot schedules are Compute Engine resource policies that automatically create incremental snapshots of a persistent disk on a defined cadence and delete them after a retention window.
A snapshot schedule attached to the disk takes the daily snapshot and enforces the 14-day retention without any scripts, cron jobs, or human action. Snapshots are incremental, so a 2 TB disk backs up efficiently after the first snapshot. Custom images and machine images are templates for provisioning rather than a rotation-managed backup mechanism, and rsync to Cloud Storage is an unmanaged, file-level workaround.
- Create the policy: gcloud compute resource-policies create snapshot-schedule daily-backup --max-retention-days=14 --daily-schedule --start-time=03:00 --region=REGION.
- Attach it to the disk: gcloud compute disks add-resource-policies DISK_NAME --resource-policies=daily-backup --zone=ZONE.
- Verify snapshots appear daily with gcloud compute snapshots list and that ones older than 14 days are auto-deleted.
Exam tip: For automated periodic disk backups with retention, attach a snapshot schedule resource policy to the disk.
Managing Compute Engine, GKE, and Cloud Run: Day-2 Operations — the lesson that teaches this.