Google Professional Cloud DevOps Engineer Question 265
Select 2Google Cloud PlatformYour team is running a batch data processing pipeline on Google Cloud that is cost-sensitive but can tolerate interruptions. You decide to use Spot VMs to reduce costs. However, during testing, you notice that the pipeline fails when the Spot VMs are preempted. What should you do to ensure the pipeline completes successfully while still taking advantage of cost savings from Spot VMs?
- A
Implement a checkpointing mechanism in the pipeline to save progress periodically.
- B
Use a managed instance group (MIG) with Spot VMs and enable automatic instance replacement.
- C
Switch to regular on-demand VMs to avoid preemptions entirely.
- D
Use a combination of Spot VMs and on-demand VMs in a managed instance group with a priority configuration.
Show answer and explanation
Correct answers: A, D
Explanation
Spot VMs are cost-effective but can be preempted at any time, which may disrupt workloads. To ensure the batch data processing pipeline completes while minimizing costs, you can implement checkpointing to save progress and configure a managed instance group to use both Spot and on-demand VMs. This way, the pipeline can continue running on on-demand VMs if Spot VMs are preempted, and the checkpointing mechanism ensures no significant progress is lost.
- A. Correct.
Implementing a checkpointing mechanism ensures that progress is saved periodically, allowing the pipeline to resume from the last saved state if a Spot VM is preempted. This reduces the risk of losing work during preemptions.
- B. Incorrect.
Using a managed instance group (MIG) with Spot VMs and enabling automatic instance replacement ensures that preempted instances are replaced, but it does not address the issue of progress being lost in the pipeline.
- C. Incorrect.
Switching to regular on-demand VMs avoids preemptions but sacrifices the cost savings advantage, which is contrary to the team's goal of optimizing costs.
- D. Correct.
Using a combination of Spot VMs and on-demand VMs with a priority configuration allows the pipeline to continue running on on-demand VMs if Spot VMs are preempted. This approach balances cost savings and reliability.