Your organization is deploying a fault-tolerant batch processing workload on Google Cloud Compute Engine. The operational requirements state that the Virtual Machine (VM) instance must be provisioned using the lowest possible compute cost model, execute an automated initialization script stored in a Cloud Storage bucket at gs://company-scripts-bucket/init.sh upon booting, and run under the identity of a pre-created custom IAM service account named [email protected] with the standard cloud-platform scope. Which gcloud command correctly provisions this VM instance with all required configurations?
- gcloud compute instances create batch-worker-vm --zone=us-central1-a --provisioning-model=SPOT --service-account=batch-worker@app-project.iam.gserviceaccount.com --scopes=cloud-platform --metadata=startup-script-url=gs://company-scripts-bucket/init.shCevap
- Bgcloud compute instances create batch-worker-vm --zone=us-central1-a --provisioning-model=SPOT [email protected] --metadata=startup-script=gs://company-scripts-bucket/init.sh
- Cgcloud compute instances create batch-worker-vm --zone=us-central1-a --provisioning-model=STANDARD --service-account=batch-worker@app-project.iam.gserviceaccount.com --scopes=roles/editor --metadata=startup-script-url=gs://company-scripts-bucket/init.sh
- Dgcloud compute instances create batch-worker-vm --zone=us-central1-a --maintenance-policy=MIGRATE --service-account=batch-worker@app-project.iam.gserviceaccount.com --scopes=cloud-platform --metadata=startup-script-url=gs://company-scripts-bucket/init.sh
Cevap
The command that uses --provisioning-model=SPOT, --service-account=batch-worker@app-project.iam.gserviceaccount.com, --scopes=cloud-platform, and --metadata=startup-script-url=gs://company-scripts-bucket/init.sh correctly meets all deployment requirements.
The command specifying --provisioning-model=SPOT configures the VM as a Spot instance for maximum cost savings on fault-tolerant tasks. The --service-account flag attaches the custom service account email, --scopes=cloud-platform grants full Cloud API access managed by IAM, and --metadata=startup-script-url=gs://... instructs Compute Engine to retrieve and run the script from Cloud Storage at boot time.
Adım Adım Çözüm
Anahtar Kavram
Compute Engine VM Provisioning with gcloud CLI, Custom Metadata, Service Accounts, and Spot VMs