A cloud engineer needs to deploy a high-availability Compute Engine instance named `web-prod-01` in zone `us-central1-a` using the `gcloud` CLI. The application hosted on this instance cannot tolerate unexpected downtime during host infrastructure updates, so the virtual machine must be migrated to another host during maintenance events rather than shut down. Additionally, if the host hardware experiences a failure, the instance must automatically restart. Which `gcloud compute instances create` command should the engineer execute to meet these requirements?
- gcloud compute instances create web-prod-01 --zone=us-central1-a --on-host-maintenance=MIGRATE --automatic-restartCevap
- Bgcloud compute instances create web-prod-01 --zone=us-central1-a --maintenance-policy=LIVE_MIGRATE --auto-restart=true
- Cgcloud compute instances create web-prod-01 --zone=us-central1-a --provisioning-model=SPOT --on-host-maintenance=MIGRATE
- Dgcloud compute instances create web-prod-01 --zone=us-central1-a --on-host-maintenance=TERMINATE --no-automatic-restart
Cevap
The correct command is `gcloud compute instances create web-prod-01 --zone=us-central1-a --on-host-maintenance=MIGRATE --automatic-restart`.
The command containing `--on-host-maintenance=MIGRATE` and `--automatic-restart` correctly applies the standard Compute Engine availability policy flags for live migration during maintenance and automated restart after hardware failure.
Adım Adım Çözüm
Anahtar Kavram
Compute Engine Instance Scheduling & Availability Policies
Tahmini Süre:1m 30s