easyMultiple ChoiceObjective-mapped
Google ACE Practice Question: Which gcloud command creates a Compute Engine VM…
Which gcloud command creates a Compute Engine VM named 'web-01' using the e2-medium machine type in zone us-central1-a?
⚠ Common exam trap
Google Cloud often tests the exact command syntax, and the trap here is that candidates confuse the `gcloud compute instances create` command with shorter, non-existent variants like `gcloud vm create` or `gcloud instances create`, or they use incorrect flag names like `--machine` or `--size` instead of the correct `--machine-type`.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud compute instances create web-01 --zone=us-central1-a --machine-type=e2-medium
The `gcloud compute instances create` command is the proper syntax for creating a Compute Engine VM, and it requires the `--machine-type` flag (not `--machine`) to specify the machine type. The zone is specified with `--zone`, and the VM name is provided as a positional argument.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gcloud vm create web-01 --zone=us-central1-a --machine=e2-medium
Why it's wrong here
This command fails because 'gcloud vm' is not a recognized resource group; the CLI organizes services as 'gcloud compute', so the correct path is 'gcloud compute instances create'. Additionally, the machine type is set with the '--machine-type' flag, not '--machine'. Even though the name and zone are valid, the incorrect group and flag make this invalid.
- ✓
gcloud compute instances create web-01 --zone=us-central1-a --machine-type=e2-medium
Why this is correct
This is the correct syntax. 'gcloud compute instances create' targets the Compute Engine service's 'instances' resource and the 'create' verb. The '--zone' flag designates the zonal location for the VM (required if no region-level default), and '--machine-type' specifies the predefined machine type (e.g., 'e2-medium'). This creates an instance in the current project with the given configuration.
- ✗
gcloud instances create web-01 --region=us-central1 --type=e2-medium
Why it's wrong here
This is invalid because 'gcloud instances' is not a valid command path; the resource must be nested under 'compute' (i.e., 'gcloud compute instances'). Also, an individual VM is a zonal resource, so you must specify '--zone' rather than '--region', and the machine type flag is '--machine-type', not '--type'. The verb placement is correct but the group and flags are wrong.
- ✗
gcloud compute create-instance web-01 --zone=us-central1-a --size=e2-medium
Why it's wrong here
This command fails because there is no 'create-instance' subcommand; the correct verb structure is 'instances create' (resource first, then action). Additionally, '--size' is not a recognized flag for instance creation—the machine type is selected with '--machine-type'. While 'gcloud compute' is correct and the zone flag is present, the subcommand order and wrong flag make it invalid.
Go deeper
Related to this question
Learn chapter
Google Compute Engine
Key term
Compute Engine
Compute Engine is Google Cloud's Infrastructure-as-a-Service (IaaS) offering that lets you create and run virtual machines on Google's infrastructure.
Key term
Machine type
A machine type defines the virtual hardware resources (vCPU, memory, and sometimes GPU) assigned to a virtual machine instance in a cloud computing environment.
About these practice questions
One of 769 original ACE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.