Soru

Zorluk: ZorDeploying and Managing Compute Engine Virtual Machines

An infrastructure administrator needs to deploy a Compute Engine virtual machine instance named `db-proxy-01` in the `us-central1-a` zone to handle sensitive internal database proxying. The virtual machine must reside in an existing custom subnetwork named `prod-db-subnet`, must not be exposed to the public internet, must attach an existing secondary persistent disk named `data-disk-01` in read-only mode, and must run using a dedicated service account `[email protected]` instead of the default Compute Engine service account. Which `gcloud` command accurately provisions this virtual machine according to all technical requirements?

  1. gcloud compute instances create db-proxy-01 --zone=us-central1-a --subnet=prod-db-subnet --no-address --disk=name=data-disk-01,mode=ro [email protected]Cevap
  2. B
    gcloud compute instances create db-proxy-01 --zone=us-central1-a --subnetwork=prod-db-subnet --network-interface=no-address --attach-disk=name=data-disk-01,read-only=true [email protected]
  3. C
    gcloud compute instances create db-proxy-01 --zone=us-central1-a --subnet=prod-db-subnet --no-address --disk=name=data-disk-01,mode=ro [email protected] --provisioning-model=SPOT
  4. D
    gcloud compute instances create db-proxy-01 --zone=us-central1-a --subnet=prod-db-subnet --no-address --disk=name=data-disk-01,mode=ro --scopes=https://www.googleapis.com/auth/cloud-platform

Cevap

The command that uses '--subnet=prod-db-subnet', '--no-address', '--disk=name=data-disk-01,mode=ro', and '[email protected]' correctly provisions the instance.
The correct command combines the required flags accurately: '--subnet=prod-db-subnet' places the instance in the specified subnetwork, '--no-address' prevents external public IP allocation, '--disk=name=data-disk-01,mode=ro' attaches the existing disk in read-only mode, and '[email protected]' enforces the custom identity.

Adım Adım Çözüm

1
Identify network deployment flags for Compute Engine instances
Use '--subnet=prod-db-subnet' to assign the subnetwork and '--no-address' to disable public IPv4 allocation.
gcloud CLI requires explicit subnetwork flags and uses '--no-address' to prevent external IP provisioning.
2
Determine disk attachment parameters during VM creation
Use '--disk=name=data-disk-01,mode=ro' to attach an existing disk in read-only mode.
The '--disk' flag accepts key-value sub-fields where 'mode=ro' configures read-only attachment.
3
Specify custom service account identity
Use '[email protected]' to associate the dedicated service account.
Without '--service-account', Compute Engine assigns the default Compute Engine service account.

Anahtar Kavram

gcloud Compute Engine VM creation flag syntax and identity configuration
Bu soruyu puanla