
Ultimate access to all questions.
You have created several pre-emptible Linux virtual machine instances using Google Compute Engine. Pre-emptible instances can be stopped at any time with little notice. To ensure your application is properly shut down before these virtual machines are preempted, what should you do?
A
Create a shutdown script named k99.shutdown in the /etc/rc.6.d/ directory
B
Create a shutdown script registered as a xinetd service in Linux and configure a Stackdriver endpoint check to call the service
C
Create a shutdown script and use it as the value for a new metadata entry with the key shutdown-script in the Cloud Platform Console when you create the new virtual machine instance
D
Create a shutdown script, registered as a xinetd service in Linux, and use the gcloud compute instances add-metadata command to specify the service URL as the value for a new metadata entry with the key shutdown-script-url
Explanation:
The correct answer is C. In Google Compute Engine, you can specify a shutdown script using the metadata server. To properly shut down your application before the virtual machines are preempted, you should create a shutdown script and use it as the value for a new metadata entry with the key 'shutdown-script' in the Cloud Platform Console. This method ensures that the script executes when the instance is shutting down, providing a graceful shutdown process. This approach is more straightforward compared to other options and leverages the built-in functionality of Google Cloud Platform for managing instance metadata.