A cloud engineer needs to deploy a new Compute Engine virtual machine instance named analytics-db-tool in zone us-central1-a to host a dedicated database management utility. The business requirements specify that the instance must be placed in a custom subnet named analytics-subnet, assigned the network tag db-client, and explicitly configured to terminate rather than live-migrate during Google Cloud host maintenance events. Which gcloud command should the engineer execute to meet these requirements?
- gcloud compute instances create analytics-db-tool --zone=us-central1-a --subnet=analytics-subnet --tags=db-client --on-host-maintenance=TERMINATECevap
- Bgcloud compute instances create analytics-db-tool --zone=us-central1-a --subnet=analytics-subnet --tags=db-client --maintenance-policy=TERMINATE
- Cgcloud compute instances create analytics-db-tool --zone=us-central1-a --network=analytics-subnet --tags=db-client --on-host-maintenance=TERMINATE
- Dgcloud compute instances create analytics-db-tool --zone=us-central1-a --subnet=analytics-subnet --tags=db-client --provisioning-model=SPOT
Cevap
The command 'gcloud compute instances create analytics-db-tool --zone=us-central1-a --subnet=analytics-subnet --tags=db-client --on-host-maintenance=TERMINATE' correctly deploys the VM with all requested network and maintenance specifications.
The correct command uses '--subnet=analytics-subnet' to target the custom subnet, '--tags=db-client' to attach the required network tag, and '--on-host-maintenance=TERMINATE' to specify that the VM should be stopped rather than live-migrated when maintenance occurs on the underlying host hardware.
Adım Adım Çözüm
Anahtar Kavram
Deploying Compute Engine instances with custom subnets and host maintenance policies using gcloud CLI
Tahmini Süre:1m 30s