Question

Difficulty: MediumDeploying and Managing Compute Engine Virtual Machines

A cloud engineer needs to deploy a fault-tolerant batch processing workload on Compute Engine using the Google Cloud CLI (`gcloud`). The application runs short-lived jobs and must be provisioned on highly discounted, temporary compute capacity that can be reclaimed by Google Cloud at any time. Which `gcloud compute instances create` command correctly provisions the virtual machine instance with this capability?

  1. gcloud compute instances create batch-worker-1 --zone=us-central1-a --provisioning-model=SPOTAnswer
  2. B
    gcloud compute instances create batch-worker-1 --zone=us-central1-a --type=spot-instance
  3. C
    gcloud compute instances create batch-worker-1 --zone=us-central1-a --maintenance-policy=TERMINATE --no-restart
  4. D
    gcloud compute instances create batch-worker-1 --zone=us-central1-a --scheduling-type=PREEMPTIBLE

Answer

The command using `gcloud compute instances create batch-worker-1 --zone=us-central1-a --provisioning-model=SPOT` is correct because `--provisioning-model=SPOT` is the standard gcloud CLI flag to request Spot VM capacity on Compute Engine.
The correct command specifies `--provisioning-model=SPOT`. Spot VMs are highly discounted compute instances that can be reclaimed by Compute Engine when resources are needed elsewhere, making them ideal for fault-tolerant batch workloads.

Step-by-Step Solution

1
Identify the workload requirements
The workload is fault-tolerant and requires temporary, discounted capacity that can be preempted.
Spot VMs provide lower-cost compute capacity suitable for batch and fault-tolerant jobs.
2
Determine the proper Google Cloud CLI flag for Spot VM provisioning
The `--provisioning-model=SPOT` flag explicitly instructs Compute Engine to create a Spot VM.
Compute Engine uses the `--provisioning-model` flag (or legacy `--preemptible`) to specify instance scheduling behavior.

Key Concept

Provisioning Spot Compute Engine Virtual Machines via gcloud
Rate this question