A cloud engineer needs to deploy stateless, fault-tolerant Compute Engine virtual machine instances for a batch processing workload using the gcloud CLI. The instances must minimize compute costs and automatically execute a setup script stored in a Google Cloud Storage bucket (gs://my-app-scripts/setup.sh) during boot. Which TWO gcloud compute instances create flag configurations should the engineer use? (Select TWO)
- --provisioning-model=SPOTAnswer
- --metadata=startup-script-url=gs://my-app-scripts/setup.shAnswer
- C--metadata-from-file=startup-script=gs://my-app-scripts/setup.sh
- D--maintenance-policy=MIGRATE
Answer
To achieve minimum compute costs for fault-tolerant workloads while executing a startup script from a Cloud Storage bucket, the engineer must specify '--provisioning-model=SPOT' to request Spot VM pricing and '--metadata=startup-script-url=gs://my-app-scripts/setup.sh' to point to the remote script path.
The combination of using '--provisioning-model=SPOT' and '--metadata=startup-script-url=gs://my-app-scripts/setup.sh' correctly provisions a low-cost Spot VM and instructs Compute Engine to fetch and execute the startup script directly from the designated Cloud Storage bucket.
Step-by-Step Solution
Key Concept
Compute Engine Instance Deployment and Metadata Configuration