Professional Cloud Architect Exam QuestionsBrowse all questions from this exam

Professional Cloud Architect Exam - Question 32


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?

Show Answer
Correct Answer: C

Discussion

17 comments
Sign in to comment
ErocOption: C
Oct 25, 2019

https://cloud.google.com/compute/docs/shutdownscript ... So C

nitinz
Mar 4, 2021

C, statup/shutdown script = metadata

VishalB
Jul 30, 2021

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"

GiniOption: D
May 11, 2020

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

pepYash
Nov 8, 2020

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.

pepYash
Nov 8, 2020

changed my mind. preemptible vms can be stopped and started anytime. with that flexibility, C is ok.

NG123
Jun 18, 2022

I also feel so because the virtual machines are already created.

dsnaghxhinwtsvvmip
Apr 13, 2023

xinetd. Xinet makes the D answer be nonsense

[Removed]
Dec 25, 2023

I think C should be correct over D, because https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances

TerryhsiehOption: C
Dec 26, 2023

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.

irmingard_examtopicsOption: D
Jun 2, 2023

C will only be an option for new VMs, thus D is the only option!

JohnWick2020Option: C
Jun 2, 2023

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.

CloudWarsOption: C
Aug 3, 2023

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\

heretolearnazureOption: C
Aug 22, 2023

C seems to be more reasonable answer....i am also leaning towards D but C is definitely correct in my opinion.

AdityaGuptaOption: C
Oct 5, 2023

I agreed with Eroc for Option C https://cloud.google.com/compute/docs/shutdownscript

vc1011Option: D
Oct 9, 2023

Reference: https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances

wukoonOption: C
Oct 11, 2023

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.

Arun_m_123Option: C
Oct 11, 2023

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

RLshOption: D
Nov 2, 2023

I believe the answer should be D since the VMs are already created

kip21Option: C
Jan 14, 2024

C https://cloud.google.com/compute/docs/shutdownscript

Mo7yOption: C
Jan 14, 2024

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.

ashishdwi007Option: C
Jan 22, 2024

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.

lisabisaOption: C
Feb 24, 2024

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.

nicksb19Option: C
Jun 28, 2024

C is correct since xinetd does not make sense.