Question

Difficulty: MediumDeploying and Managing Compute Engine Virtual Machines

A cloud engineer is deploying a Compute Engine virtual machine instance named `gpu-worker-1` with an attached NVIDIA GPU in zone `us-central1-a` using the `gcloud` CLI. The initial deployment command fails because the default host maintenance behavior is incompatible with GPU-attached instances. Which `gcloud compute instances create` flag configuration must the engineer specify to deploy the instance successfully?

  1. Specify `--on-host-maintenance=TERMINATE` to stop the instance during host maintenance events.Answer
  2. B
    Specify `--on-host-maintenance=MIGRATE` to enable live migration while preserving GPU memory state.
  3. C
    Specify `--maintenance-policy=LIVE_MIGRATION` to allow Google Cloud to migrate the GPU workload automatically.
  4. D
    Specify `--preemptible` to bypass host maintenance checks for GPU-attached instances.

Answer

Specify `--on-host-maintenance=TERMINATE` to stop the instance during host maintenance events.
Compute Engine instances equipped with GPUs cannot be live-migrated to another host during physical host maintenance. Therefore, Google Cloud requires setting `--on-host-maintenance=TERMINATE` during instance creation so the VM is stopped rather than migrated.

Step-by-Step Solution

1
Identify host maintenance limitations for hardware accelerators in Compute Engine.
NVIDIA GPUs attached to Compute Engine VM instances do not support live migration during host maintenance events.
Hardware state in GPUs cannot be moved transparently across physical hypervisor hosts.
2
Determine the required host maintenance flag for `gcloud compute instances create`.
The `--on-host-maintenance` flag must be set explicitly to `TERMINATE`.
Compute Engine defaults to `MIGRATE` for standard VM instances, which causes creation failure when GPUs are attached unless overridden.

Key Concept

Compute Engine Host Maintenance Policies for GPU Workloads
Rate this question