Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Professional Cloud Architect topic 1 question 32 discussion

Actual exam question from Google's Professional Cloud Architect
Question #: 32
Topic #: 1
[All Professional Cloud Architect Questions]

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?

  • 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
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
A startup script, or a shutdown script, is specified through the metadata server, using startup script metadata keys.
Reference:
https://cloud.google.com/compute/docs/startupscript

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Eroc
Highly Voted 4 years, 6 months ago
https://cloud.google.com/compute/docs/shutdownscript ... So C
upvoted 36 times
nitinz
3 years, 1 month ago
C, statup/shutdown script = metadata
upvoted 4 times
VishalB
2 years, 8 months ago
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"
upvoted 7 times
...
...
...
Gini
Highly Voted 3 years, 11 months ago
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
upvoted 23 times
[Removed]
4 months ago
I think C should be correct over D, because https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances
upvoted 1 times
...
NG123
1 year, 10 months ago
I also feel so because the virtual machines are already created.
upvoted 1 times
...
xinetd. Xinet makes the D answer be nonsense
upvoted 4 times
...
pepYash
3 years, 5 months ago
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.
upvoted 3 times
pepYash
3 years, 5 months ago
changed my mind. preemptible vms can be stopped and started anytime. with that flexibility, C is ok.
upvoted 6 times
...
...
...
lisabisa
Most Recent 2 months ago
Selected Answer: C
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.
upvoted 1 times
...
ashishdwi007
3 months ago
Selected Answer: C
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.
upvoted 1 times
...
Mo7y
3 months, 1 week ago
Selected Answer: C
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.
upvoted 1 times
...
kip21
3 months, 1 week ago
C https://cloud.google.com/compute/docs/shutdownscript
upvoted 1 times
...
Terryhsieh
4 months ago
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.
upvoted 2 times
...
RLsh
5 months, 3 weeks ago
Selected Answer: D
I believe the answer should be D since the VMs are already created
upvoted 1 times
...
Arun_m_123
6 months, 2 weeks ago
Selected Answer: C
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
upvoted 1 times
...
wukoon
6 months, 2 weeks ago
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.
upvoted 1 times
...
vc1011
6 months, 2 weeks ago
Selected Answer: D
Reference: https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances
upvoted 1 times
...
AdityaGupta
6 months, 3 weeks ago
Selected Answer: C
I agreed with Eroc for Option C https://cloud.google.com/compute/docs/shutdownscript
upvoted 1 times
...
heretolearnazure
8 months ago
C seems to be more reasonable answer....i am also leaning towards D but C is definitely correct in my opinion.
upvoted 1 times
...
CloudWars
8 months, 3 weeks ago
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\
upvoted 1 times
...
JohnWick2020
10 months, 3 weeks ago
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.
upvoted 1 times
...
irmingard_examtopics
10 months, 3 weeks ago
Selected Answer: D
C will only be an option for new VMs, thus D is the only option!
upvoted 1 times
...
h7m
1 year ago
Selected Answer: C
Option C works fine. you might want to save the shutdown-script in a file in cloud storage or another static place and provide it's url so that you can reuse and version it. But option D is much to complicated and impractical to first set up a service to provide a static file to shut down the server on which the file is served, where you cannot modify it while the server is down .. try to explain that to the new developer kid 10 years later.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...