A DevOps engineer needs to schedule automated nightly snapshots of a 2 TB Persistent Disk attached to a GCE instance running a stateful database. The snapshots must be retained for 14 days and then automatically deleted. What is the SIMPLEST GCP-native approach?
- A. Use
gcloud compute disks snapshotin a startup script on a separate management VM that runs nightly via an instance schedule. - B. Enable automatic backups on the Cloud SQL instance associated with the Persistent Disk and set the backup retention to 14 days.
- C. Create a snapshot schedule resource in Compute Engine, attach it to the Persistent Disk, and set the retention policy to 14 days. Compute Engine will automatically create and delete snapshots according to the schedule.✓ Correct
- D. Write a Cloud Scheduler job that triggers a Cloud Run service, which calls the Compute Engine API to create a snapshot, and a separate Cloud Scheduler job that calls a Cloud Function to list and delete snapshots older than 14 days.
Explanation
Option C is correct: Compute Engine Snapshot Schedules are a native, fully managed feature that automates both creation and deletion of disk snapshots on a configurable schedule with a built-in retention policy — exactly what is needed with zero custom code. Option D (Cloud Scheduler + Cloud Run + Cloud Functions) achieves the same result but requires building and maintaining custom application code, IAM bindings, and multiple resources — far more operational overhead than a snapshot schedule. Option B is wrong: Cloud SQL automated backups apply only to Cloud SQL instances and their managed storage, not to arbitrary Persistent Disks. Option A (startup script on a management VM) is fragile, requires managing the VM lifecycle, and introduces unnecessary complexity compared to the native snapshot schedule feature.