Soru

Zorluk: ZorDeploying and Managing Compute Engine Virtual Machines

A financial analytics firm is configuring an automated deployment pipeline to provision Compute Engine instances for evening risk-modeling simulations. The workload consists of fault-tolerant, stateless processing jobs that can sustain abrupt instance terminations. Security policies require adhering to the principle of least privilege, using dedicated service account identities, and executing a boot-time bootstrap script stored in a private Cloud Storage bucket (`gs://finance-scripts-prod/bootstrap.sh`). Which TWO configuration flags must be included in the `gcloud compute instances create` command to satisfy these operational and security requirements?

  1. --provisioning-model=SPOT to leverage excess compute capacity at significantly reduced costs for fault-tolerant batch workloads.Cevap
  2. --metadata=startup-script-url=gs://finance-scripts-prod/bootstrap.sh to direct Compute Engine to download and run the script from Cloud Storage upon booting.Cevap
  3. C
    [email protected] to assign the custom service account identity to the virtual machine instance.
  4. D
    --maintenance-policy=MIGRATE to ensure continuous execution of the risk-modeling batch jobs during host infrastructure maintenance.

Cevap

The correct flags are specifying `--provisioning-model=SPOT` to run cost-effective fault-tolerant workloads, and using `--metadata=startup-script-url=gs://finance-scripts-prod/bootstrap.sh` to execute the startup script hosted in Google Cloud Storage.
Specifying `--provisioning-model=SPOT` is the recommended GCP mechanism for provisioning low-cost, fault-tolerant compute capacity suitable for stateless batch workloads. Additionally, using `--metadata=startup-script-url=gs://finance-scripts-prod/bootstrap.sh` allows Compute Engine instances to automatically fetch and execute the boot script stored in Cloud Storage without requiring custom disk images or manually injected startup script code.

Adım Adım Çözüm

1
Analyze the workload requirements for cost optimization and fault tolerance.
Stateless batch risk-modeling jobs can sustain terminations, making Spot VMs (`--provisioning-model=SPOT`) the ideal deployment choice for cost efficiency.
Spot instances offer up to 60-91% discounts compared to standard pricing for fault-tolerant jobs.
2
Determine the proper `gcloud` flag syntax for bootstrapping instances via a private Cloud Storage script.
The correct metadata key for GCS-hosted startup scripts is `--metadata=startup-script-url=gs://...`.
Compute Engine guest environment reads the `startup-script-url` key from instance metadata to fetch and execute remote scripts.
3
Identify wrong option flags and syntax misconceptions.
Passing a service account email to `--scopes` is invalid syntax (service accounts require `--service-account`), and setting `--maintenance-policy=MIGRATE` violates Spot instance constraints.
Spot VMs cannot be live-migrated and must terminate during host events.

Anahtar Kavram

Deploying Compute Engine Virtual Machines with Spot provisioning models and startup script metadata flags using the `gcloud` CLI.
Bu soruyu puanla