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?
- Specify `--on-host-maintenance=TERMINATE` to stop the instance during host maintenance events.Answer
- BSpecify `--on-host-maintenance=MIGRATE` to enable live migration while preserving GPU memory state.
- CSpecify `--maintenance-policy=LIVE_MIGRATION` to allow Google Cloud to migrate the GPU workload automatically.
- DSpecify `--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
Key Concept
Compute Engine Host Maintenance Policies for GPU Workloads