You have created several pre-emptible Linux virtual machine instances using Google Compute Engine. You want to properly shut down your application before the virtual machines are preempted.
What should you do?
You have created several pre-emptible Linux virtual machine instances using Google Compute Engine. You want to properly shut down your application before the virtual machines are preempted.
What should you do?
https://cloud.google.com/compute/docs/shutdownscript ... So C
C, statup/shutdown script = metadata
Since the instance is already created Option C gets eliminated. "gcloud compute instances addmetadata” command can be used to add or update the metadata of a virtual machine instance"
I have doubts with the answer C because the question states that "You have created the instances" so C works too but the solution cannot apply to the already created instances. D seems correct to me... Reference: https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances
Yes. The correct answer should be D. To add a shutdown script to a running instance, follow the instructions in the Applying a startup script to running instances documentation but replace the metadata keys with one of the following keys: shutdown-script: Supply the shutdown script contents directly with this key. Using the gcloud command-line tool, you can provide the path to a shutdown script file, using the --metadata-from-file flag and the shutdown-script metadata key. shutdown-script-url: Supply a Cloud Storage URL to the shutdown script file with this key.
changed my mind. preemptible vms can be stopped and started anytime. with that flexibility, C is ok.
I also feel so because the virtual machines are already created.
xinetd. Xinet makes the D answer be nonsense
I think C should be correct over D, because https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances
The answer should be C. reference to https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances Regarding the answer D, it is not the option becasue no need to touch xinetd servie inside Linux.
C will only be an option for new VMs, thus D is the only option!
C is the answer. "shutdown-script" metadata to provide a local script. "Shutdown-script-url" to provide a cloud storage URL where script is stored.
c is correct read the documentation it says you must have root access so basically you can do it when the machine is running > https://cloud.google.com/compute/docs/shutdownscript#provide_shutdown_script_contents_directly\
C seems to be more reasonable answer....i am also leaning towards D but C is definitely correct in my opinion.
I agreed with Eroc for Option C https://cloud.google.com/compute/docs/shutdownscript
Reference: https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances
Option D: Creating a shutdown script, registered as a xinetd service in Linux, and using 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 is not as reliable as option C because it requires the gcloud command-line tool to be installed and configured on the virtual machine instance.
C is the right answer. See, there is one tip. In GCP, things like these are given to the customers as a solution - like give a shutdown script. GCP won't trouble the users to know all those geeky linux stuffs. So the answer is simply C
I believe the answer should be D since the VMs are already created
C https://cloud.google.com/compute/docs/shutdownscript
The answer is either C or D I exclude D because shutdown-script-url only works with a shutdown script hosted on a cloud storage. Option D wants you to use shutdown-script-url for a locally hosted shutdown script, thus it's not the correct answer.
All other options are related to play with Linux files or services. With Preemptible VMs ,these operations are overhead. Hence it makes sense to Automate such tasks.
Every virtual machine instance in GCP has access to a metadata server, which provides information about the instance and allows you to configure various settings, including startup and shutdown scripts. Startup and shutdown scripts are specified using special metadata keys in the metadata server. shutdown-script specifies the shutdown script that should be executed when the instance is being shut down.
C is correct since xinetd does not make sense.