A cloud architecture team requires a newly deployed Compute Engine virtual machine instance named analytics-node in zone us-central1-a to connect directly to two isolated Virtual Private Cloud (VPC) subnets: subnet-analytics and subnet-management. Which gcloud command correctly provisions the virtual machine with multiple network interfaces?
- gcloud compute instances create analytics-node --zone=us-central1-a --network-interface=subnet=subnet-analytics --network-interface=subnet=subnet-managementAnswer
- Bgcloud compute instances create analytics-node --zone=us-central1-a --network=vpc-analytics --subnet=subnet-analytics,subnet-management
- Cgcloud compute instances create analytics-node --zone=us-central1-a --network=vpc-analytics --secondary-network=vpc-mgmt
- Dgcloud compute instances create analytics-node --zone=us-central1-a --network-interface=network=vpc-analytics,subnet=subnet-analytics;network=vpc-mgmt,subnet=subnet-management
Answer
The command that repeats the `--network-interface` flag once for `subnet=subnet-analytics` and once for `subnet=subnet-management` correctly provisions the instance with dual network interfaces.
In Google Cloud Compute Engine, creating a virtual machine with multiple network interfaces requires repeating the `--network-interface` flag for each connection. The command passing `--network-interface=subnet=subnet-analytics` followed by `--network-interface=subnet=subnet-management` properly creates nic0 and nic1 on the instance.
Step-by-Step Solution
Key Concept
Deploying Compute Engine instances with multiple network interfaces using repeated gcloud CLI flags.
Estimated Time:1m 30s