You need to create an autoscaled managed instance group (MIG) that will run a stateless payment-processing service. Requirements are:
Each VM must have 4 vCPUs and 8 GB RAM using an e2 family custom shape.
The boot disk must use the latest Debian image.
Every VM must carry the labels env=prod and team=payments.
A startup script must download the application binary from a Cloud Storage bucket and start the service. Which approach satisfies all requirements while minimizing post-deployment manual steps?
Create the MIG first with the default e2-standard-4 template and Debian image, then run gcloud compute instances update on the group members to add the labels and startup script.
Create an instance template that sets machine type e2-custom-4-8192, uses the debian-11 image family, contains the labels env=prod and team=payments, and includes a metadata key startup-script that downloads and launches the binary; then build the MIG from this template.
Create an empty instance template and rely on the Instance Group Manager overrides to inject labels and the startup script when the MIG is created.
Define an autohealing health check that calls a script which downloads the binary, and attach firewall tags that represent env and team labels instead of setting them in the template.
An instance template is the only place to define properties that every VM in a managed instance group inherits. When you create the template you can:
Specify the machine type as e2-custom-4-8192.
Point the boot disk to the debian-11 image family so the latest image is selected automatically.
Add the key/value pairs env=prod and team=payments in the template's labels field so they are applied to every VM.
Add a metadata entry with the key startup-script whose value contains the bash commands that use gsutil to pull the binary from Cloud Storage and start the service. Because all these settings live in the template, the MIG will automatically instantiate correctly configured VMs and no further per-instance changes are required.
The other options rely on modifying instances after the MIG is created or on settings that cannot be supplied at the MIG level, neither of which is supported for properties like labels and startup scripts.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
Why is an instance template necessary for creating a managed instance group (MIG)?
Open an interactive chat with Bash
What is a startup script, and how does it work in a MIG setup?
Open an interactive chat with Bash
What benefits do labels, like env=prod and team=payments, provide in Google Cloud Platform (GCP)?
Open an interactive chat with Bash
What is an instance template in GCP?
Open an interactive chat with Bash
How does the startup script in a metadata key work?
Open an interactive chat with Bash
What are the advantages of using labels in managed instance groups?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Planning and implementing a cloud solution
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .