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

Exam Professional Cloud Architect All Questions

View all questions & answers for the Professional Cloud Architect exam

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 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Eroc
Highly Voted 5 years ago
https://cloud.google.com/compute/docs/shutdownscript ... So C
upvoted 38 times
nitinz
3 years, 8 months ago
C, statup/shutdown script = metadata
upvoted 4 times
VishalB
3 years, 3 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 11 times
...
...
...
Gini
Highly Voted 4 years, 6 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 27 times
[Removed]
11 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 2 times
...
NG123
2 years, 5 months ago
I also feel so because the virtual machines are already created.
upvoted 2 times
...
dsnaghxhinwtsvvmip
1 year, 7 months ago
xinetd. Xinet makes the D answer be nonsense
upvoted 5 times
...
pepYash
4 years 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 4 times
pepYash
4 years ago
changed my mind. preemptible vms can be stopped and started anytime. with that flexibility, C is ok.
upvoted 6 times
...
...
...
Ekramy_Elnaggar
Most Recent 2 days, 20 hours ago
Selected Answer: C
1. Preemptible instances and shutdown scripts: Google Cloud Platform's preemptible instances are cost-effective but can be terminated with short notice. To gracefully handle this, you need a shutdown script that runs before the instance is preempted. 2. Metadata and shutdown-script: Google Cloud allows you to add custom metadata to your instances. When you create a preemptible instance, you can include a shutdown-script metadata entry. The value of this entry should be your script, which will be executed automatically before the instance is preempted.
upvoted 1 times
...
Barry123456
1 month ago
Selected Answer: D
It's not C. C says "when you create the new virtual machine instance". But in the question, the instances have already been created. Thus, D. In D, "service URL" obviously means cloud storage.
upvoted 1 times
...
snehaso
3 months, 1 week ago
Among Option C & D, option D uses shutdown-script-url but shutdown-script-url should be a Cloud storage url and not a linux service URL. That brings us to option C
upvoted 1 times
...
Hungdv
3 months, 2 weeks ago
Choose C
upvoted 1 times
...
nicksb19
4 months, 3 weeks ago
C is correct since xinetd does not make sense.
upvoted 1 times
...
lisabisa
9 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 2 times
...
ashishdwi007
10 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
10 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 2 times
...
kip21
10 months, 1 week ago
C https://cloud.google.com/compute/docs/shutdownscript
upvoted 1 times
...
Terryhsieh
11 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
1 year ago
Selected Answer: D
I believe the answer should be D since the VMs are already created
upvoted 1 times
...
Arun_m_123
1 year, 1 month 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
1 year, 1 month 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
1 year, 1 month ago
Selected Answer: D
Reference: https://cloud.google.com/compute/docs/shutdownscript#apply_a_shutdown_script_to_running_instances
upvoted 1 times
...
AdityaGupta
1 year, 1 month ago
Selected Answer: C
I agreed with Eroc for Option C https://cloud.google.com/compute/docs/shutdownscript
upvoted 1 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 ...