
Answer-first summary for fast verification
Answer: Develop a shutdown script and set it as the value for a new metadata entry with the key ‘shutdown-script’ in the Cloud Platform Console during the creation of the new virtual machine instance.
The correct approach involves creating a shutdown script and assigning it as a metadata entry with the key ‘shutdown-script’ in the Cloud Platform Console when setting up the virtual machine instance. This method ensures the application can shut down gracefully upon pre-emption. Other methods, such as using the CLI, Console, or API for shutdown commands or workload migration, introduce unnecessary complexity and do not guarantee a graceful shutdown. The deployment manager cannot be used to set a shutdown script as a metadata entry, making the Cloud Platform Console the appropriate tool for this purpose. Reference: [Google Cloud Documentation on Shutdown Scripts](https://cloud.google.com/compute/docs/shutdownscript).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have deployed several preemptible Linux virtual machine instances on Google Compute Engine. How can you ensure your application shuts down gracefully before these instances are pre-empted?
A
Utilize the CLI, Console, or API to migrate your workload prior to instance pre-emption.
B
Implement a shutdown script and assign it as the value for a new metadata entry with the key ‘shutdown-script’ in the deployment manager.
C
Employ the CLI, Console, or API to issue shutdown commands before the instances are pre-empted.
D
Develop a shutdown script and set it as the value for a new metadata entry with the key ‘shutdown-script’ in the Cloud Platform Console during the creation of the new virtual machine instance.
No comments yet.