Google Cloud
Updated: May 22, 2026Categories: Virtualization, Cloud
Printed from:
Google Cloud Compute Engine Cheatsheet: Cloud Computing Platform
Overview
Google Cloud Compute Engine provides scalable, on-demand virtual machine instances running on Google's global infrastructure, offering flexible, high-performance compute resources with deep integration into the broader Google Cloud ecosystem.
Core Concepts
- Infrastructure as a Service (IaaS)
- Scalable Compute Resources
- Global, Regional, and Zonal Resources
- Sustained-use and Committed-use Pricing Models
Key Components
-
Virtual Machine Instances
- Compute resources with customizable machine types
- Predefined and custom machine configurations
-
Resource Manager and Deployment Manager
- Project, folder, and organization hierarchy
- Infrastructure as Code via Terraform or Config Connector
-
Virtual Private Cloud (VPC)
- Global VPC networks
- Subnet configuration per region
- Firewall rules and Cloud Armor
Machine Families and Types
-
General Purpose (E2, N2, N2D, N4, C4, T2D, T2A)
- Balanced price/performance
- Web servers, small-to-medium databases, dev/test
-
Compute Optimized (C3, C3D, C4, H3)
- High per-core performance
- HPC, gaming servers, ad serving
-
Memory Optimized (M1, M2, M3, X4)
- Large in-memory workloads
- SAP HANA, in-memory databases, analytics
-
Storage Optimized (Z3)
- High local SSD throughput
- Scale-out databases, analytics workloads
-
Accelerator Optimized (A2, A3, G2)
- NVIDIA GPUs (H100, A100, L4) and TPUs via separate services
- Machine learning, training, inference, HPC
Provisioning Workflow
Bash
123456789101112131415161718192021# gcloud CLI VM creation
gcloud compute instances create my-vm \
--zone=us-central1-a \
--machine-type=e2-medium \
--image-family=debian-12 \
--image-project=debian-cloud
# Terraform example
resource "google_compute_instance" "my_vm" {
name = "my-vm"
machine_type = "e2-medium"
zone = "us-central1-a"
boot_disk {
initialize_params { image = "debian-cloud/debian-12" }
}
network_interface {
network = "default"
access_config {}
}
}
Key Management Commands
Bash
1234567891011# Instance management
gcloud compute instances list
gcloud compute instances start my-vm --zone=us-central1-a
gcloud compute instances stop my-vm --zone=us-central1-a
gcloud compute instances delete my-vm --zone=us-central1-a
# Network configuration
gcloud compute networks create my-vpc --subnet-mode=custom
gcloud compute firewall-rules create allow-ssh \
--network=my-vpc --allow=tcp:22
Networking Configurations
- Global Virtual Private Cloud (VPC) networks
- Regional subnets with secondary IP ranges
- VPC firewall rules and hierarchical firewall policies
- Cloud Load Balancing (Global, Regional, Internal)
- Cloud VPN, Cloud Interconnect, Cross-Cloud Interconnect
- External, internal, and IPv6 addresses
- Private Service Connect
Storage Options
-
Persistent Disk and Hyperdisk
- Network-attached block storage
- Balanced, SSD, Extreme, and Hyperdisk (Balanced, Throughput, Extreme, ML)
- Snapshots and asynchronous replication
-
Local SSD
- High-IOPS, low-latency local NVMe storage
- Ephemeral; data lost on stop or migration
-
Cloud Storage / Filestore
- Object and managed NFS storage for shared workloads
Security Best Practices
- Use Cloud IAM with least privilege
- Apply organization policies and IAM Conditions
- Enable Confidential VMs and disk encryption (CMEK/CSEK)
- Use OS Login with 2-Step Verification instead of project SSH keys
- Configure VPC firewall rules and Cloud Armor
- Monitor with Security Command Center and Cloud Audit Logs
Cost Optimization Strategies
- Committed Use Discounts (resource-based and flexible)
- Spot VMs (successor to Preemptible VMs)
- Sustained Use Discounts (automatic)
- Autoscaling and right-sizing recommendations
- Custom machine types to match workload
- Active Assist and Recommender insights
Performance Optimization
- Choose the appropriate machine family (e.g., C3 for compute, M3 for memory)
- Use Hyperdisk or SSD persistent disks
- Tune disk performance independently of VM size (Hyperdisk)
- Apply global or regional load balancing
- Monitor with Cloud Monitoring and Ops Agent
Scaling Techniques
-
Horizontal Scaling
- Managed Instance Groups (MIGs)
- Regional MIGs with autohealing and autoscaling
-
Vertical Scaling
- Change machine type while stopped
- Move between predefined and custom types
Monitoring and Logging
- Cloud Monitoring
- Cloud Logging
- Cloud Trace and Cloud Profiler
- Ops Agent (unified metrics + logs)
- Error Reporting
Backup and Disaster Recovery
- Backup and DR Service
- Persistent Disk snapshots and snapshot schedules
- Machine images
- Regional persistent disks and multi-region deployments
Compliance and Governance
- Organization Policy Service
- Resource hierarchy and folders
- Assured Workloads for regulated industries
- Labels and resource tags
Integration Ecosystem
- Google Kubernetes Engine (GKE)
- Cloud Run and Cloud Run Functions
- Cloud Build and Artifact Registry
- BigQuery and Vertex AI
- Cloud Deployment Manager / Terraform / Config Connector
Hybrid and Multi-Cloud Scenarios
- Google Distributed Cloud
- Anthos / GKE Enterprise
- Cloud Interconnect and Cross-Cloud Interconnect
- Migrate to Virtual Machines for workload migration
Licensing Models
- On-demand (per-second billing, 1-minute minimum)
- Committed Use Discounts (1- and 3-year)
- Spot VMs
- Bring Your Own License (BYOL) and sole-tenant nodes
Operating System Support
- Public images: Debian, Ubuntu, Rocky Linux, RHEL, SUSE, Windows Server
- Container-Optimized OS (COS)
- Custom and imported images
- Cloud Marketplace solutions
Recommended Learning Resources
- Google Cloud Documentation
- Google Cloud Skills Boost
- Google Cloud Certification Paths
- Qwiklabs hands-on labs
- Google Cloud Community
Recommended Learning Path
- Cloud computing fundamentals
- Google Cloud core services
- Compute Engine deep dive
- Architecture design with the Well-Architected Framework
- Security, IAM, and compliance
- Hands-on implementation
- Advanced configuration and automation techniques
Continue Learning
Discover more cheatsheets to boost your productivity