Soru

Zorluk: OrtaDeploying and Managing Compute Engine Virtual Machines

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?

  1. gcloud compute instances create analytics-db-tool --zone=us-central1-a --subnet=analytics-subnet --tags=db-client --on-host-maintenance=TERMINATECevap
  2. B
    gcloud compute instances create analytics-db-tool --zone=us-central1-a --subnet=analytics-subnet --tags=db-client --maintenance-policy=TERMINATE
  3. C
    gcloud compute instances create analytics-db-tool --zone=us-central1-a --network=analytics-subnet --tags=db-client --on-host-maintenance=TERMINATE
  4. D
    gcloud 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

1
Identify the proper gcloud command flag for placing a VM into a specific subnet.
Use '--subnet=analytics-subnet' instead of '--network' when targeting a custom subnet.
The '--network' flag expects the VPC network name, whereas specific subnets require the '--subnet' flag.
2
Identify the flag controlling instance behavior during infrastructure maintenance.
Use '--on-host-maintenance=TERMINATE' (valid choices are MIGRATE or TERMINATE).
The flag '--maintenance-policy' is not a valid gcloud flag for instance creation.
3
Verify network tag and provisioning settings.
Apply '--tags=db-client' on a standard provisioned instance.
Spot VMs are designed for fault-tolerant batch workloads, not dedicated utility instances that require standard maintenance policy configuration.

Anahtar Kavram

Deploying Compute Engine instances with custom subnets and host maintenance policies using gcloud CLI
Tahmini Süre:1m 30s
Bu soruyu puanla