Skip to main content

Compute Engine

Exam guide§2.1

VMs on Google's infrastructure. You choose a machine type (vCPU + memory), a region/zone, a boot disk image, and access controls.

Machine rightsizing• Recommendation engine for sizing• Cloud Monitoring statistics• New rec 24h after create/resizePreemptible & Spot VMs• Up to 91% discount• No SLAAvailability policies• Live migrate• Auto restartGlobal load balancing• Multiple regions for availabilityOS patch management• Patch approvals + scheduling• Advanced patch config settingsBilling & discounts• Per-second billing• Sustained use discounts• Committed use discounts
Compute Engine at a glance - six built-in capability areas around the VM platform.

Where each capability is covered:

GotchaLet the Console write the gcloud for you

The Create VM form has an Equivalent command line (and Equivalent REST) button that emits the exact gcloud command for the options you picked. Fast way to learn the CLI or grab a reproducible command instead of hand-writing flags.

CommandsCommon VM operations
gcloud compute instances create vm1 \
--machine-type=e2-standard-4 --zone=us-central1-a
 
# Custom machine type: 6 vCPU, 20 GB
gcloud compute instances create vm2 \
--custom-cpu=6 --custom-memory=20GB
 
# Spot VM
gcloud compute instances create batch1 \
--provisioning-model=SPOT --instance-termination-action=STOP
 
# Enable OS Login project-wide
gcloud compute project-info add-metadata \
--metadata enable-oslogin=TRUE
 
# IAM-based SSH
gcloud compute ssh vm1 --zone=us-central1-a
0%0 of 147 pages studied