You have a Compute Engine instance hosting an application used between 9 AM and 6 PM on weekdays.
You want to back up this instance daily for disaster recovery purposes.
You want to keep the backups for 30 days.
You want the Google-recommended solution with the least management overhead and the least number of services.
What should you do?
Click on the arrows to vote for the correct answer
A. B. C. D.B.
The correct answer is B.
Explanation: In this scenario, we want to back up a Compute Engine instance daily for disaster recovery purposes, and keep the backups for 30 days. Since the application running on the instance is only used between 9 AM and 6 PM on weekdays, we can schedule the backup to run after hours.
Option A suggests updating the instance's metadata to add snapshot schedule and retention values. However, this requires manually triggering the snapshot creation process, and it does not offer a built-in mechanism for autodeleting old snapshots.
Option C suggests creating a Cloud Function that creates a snapshot of the instance's disk and another Cloud Function that deletes snapshots older than 30 days, and using Cloud Scheduler to trigger both functions daily at 1:00 AM. While this solution is automated and can be used to manage backups for multiple instances, it requires more setup than the other options.
Option D suggests creating a bash script in the instance that copies the content of the disk to Cloud Storage and another script that deletes data older than 30 days in the backup Cloud Storage bucket. However, this solution requires more maintenance and manual intervention since it requires a script to be run on the instance and deleting data from Cloud Storage requires additional permissions.
Option B, on the other hand, offers an automated solution that requires minimal setup and management. In the Compute Engine Disks page, we can select the instance's disk and configure a snapshot schedule to run daily at 1:00 AM and autodelete snapshots after 30 days. This solution requires no additional setup or maintenance since it uses built-in features in Google Cloud Platform.
Therefore, Option B is the recommended solution with the least management overhead and the least number of services.