nerdexam
Google

PROFESSIONAL-CLOUD-ARCHITECT · Question #273

You have a Compute Engine managed instance group that adds and removes Compute Engine instances from the group in response to the load on your application. The instances have a shutdown script that…

The correct answer is C. Set up a Cloud Monitoring sink that triggers the Cloud Function after an instance removal log. https://cloud.google.com/compute/docs/shutdownscript#limitations Compute Engine executes shutdown scripts only on a best-effort basis. In rare cases, Compute Engine cannot guarantee that the shutdown script will complete.

Submitted by jakub_pl· Mar 30, 2026Ensuring solution and operations reliability

Question

You have a Compute Engine managed instance group that adds and removes Compute Engine instances from the group in response to the load on your application. The instances have a shutdown script that removes REDIS database entries associated with the instance. You see that many database entries have not been removed, and you suspect that the shutdown script is the problem. You need to ensure that the commands in the shutdown script are run reliably every time an instance is shut down. You create a Cloud Function to remove the database entries. What should you do next?

Options

  • AModify the shutdown script to wait for 30 seconds before triggering the Cloud Function.
  • BDo not use the Cloud Function. Modify the shutdown script to restart if it has not completed in 30
  • CSet up a Cloud Monitoring sink that triggers the Cloud Function after an instance removal log
  • DModify the shutdown script to wait for 30 seconds and then publish a message to a Pub/Sub

How the community answered

(27 responses)
  • A
    26% (7)
  • B
    15% (4)
  • C
    52% (14)
  • D
    7% (2)

Explanation

https://cloud.google.com/compute/docs/shutdownscript#limitations Compute Engine executes shutdown scripts only on a best-effort basis. In rare cases, Compute Engine cannot guarantee that the shutdown script will complete.

Topics

#managed instance groups#shutdown script#Cloud Monitoring#event-driven automation

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-ARCHITECT Practice