6.1 Launching Compute Engine Instances: Disks, SSH Keys & Availability Policies
Key Takeaways
- Hyperdisk Balanced supports up to 160,000 IOPS and 2,400 MiB/s of independently provisioned throughput on a single volume
- Regional Persistent Disks synchronously replicate across two zones and cost roughly double a zonal disk of the same type
- Spot VMs, preemptible VMs, and GPU-attached instances cannot live-migrate and must use onHostMaintenance=TERMINATE
- Instance-level metadata with block-project-ssh-keys=TRUE overrides project-wide SSH keys for that instance only
- Custom machine types let you set an exact vCPU-to-memory ratio when no predefined machine type fits the workload
Why This Topic Matters
The Associate Cloud Engineer (ACE) exam guide lists "Launching a compute instance (e.g., assign disks, availability policy, SSH keys)" as the very first bullet under Deploying and implementing a cloud solution, the single heaviest-weighted domain on the exam at 25%. This is not abstract theory -- ACE is a hands-on, scenario-based exam, and this bullet alone maps to several concrete gcloud compute instances create decisions you must get right: which machine type, which disk type and mode, how SSH access is granted, and what happens to the instance during a host maintenance event. Expect scenario questions that describe a workload (a stateless web tier, a batch job, a GPU training job) and ask you to pick the disk type, SSH mechanism, or availability policy that fits.
Choosing a Machine Type and Family
Every Compute Engine instance is built from a machine type, which bundles a vCPU count and a fixed amount of memory. Machine types are grouped into machine families tuned for different workloads:
| Family | Examples | Best For |
|---|---|---|
| General-purpose | E2, N4, N2, N2D, N1 | Web servers, dev/test, most everyday workloads |
| Compute-optimized | C3, C3D, C4, C4A | High-performance computing, gaming servers, ad serving |
| Memory-optimized | M1, M2, M3 | In-memory databases (SAP HANA), large caches |
| Accelerator-optimized | A2, A3, G2 | ML training/inference, GPU-heavy rendering |
E2 is the lowest-cost general-purpose family and the default recommendation for standard workloads where you do not need a specific CPU platform. When a predefined shape does not fit -- for example, a workload that needs 16 vCPUs but only 8 GB of RAM -- you can define a custom machine type, specifying the exact vCPU and memory combination so you stop paying for unused capacity. This is a recurring exam trap: predefined types are convenient, but the "cost-conscious, unusual ratio" scenario is the custom-machine-type signal.
Assigning Disks
Every instance needs a boot disk (built from a public image, a custom image, or a Marketplace image) and may attach additional persistent disks for data. Disk choice is tested along two axes: disk type (performance tier) and disk mode/scope (zonal vs. regional).
| Disk Type | Performance Profile | Typical Use |
|---|---|---|
pd-standard | HDD-backed, lowest cost | Infrequent access, large sequential I/O |
pd-balanced | Default SSD-backed | General-purpose boot and data disks |
pd-ssd | Higher IOPS SSD | Databases, latency-sensitive apps |
pd-extreme | Provisioned IOPS, no throughput cap | Very high-performance databases |
| Hyperdisk Balanced | Independently provisioned IOPS + throughput, up to 160,000 IOPS / 2,400 MiB/s | Best overall price/performance for most modern workloads |
| Hyperdisk Extreme | Provisioned IOPS drives throughput | Mission-critical, latency-sensitive databases |
| Hyperdisk Throughput | Provisioned throughput drives IOPS | Big data, analytics, cost-efficient bulk I/O |
| Hyperdisk ML | Up to 2 TiB/s throughput | Reading large, immutable ML training/inference datasets |
Beyond disk type, every persistent disk is either zonal (replicated within a single zone, cheaper, lower latency) or regional (synchronously replicated across two zones in the same region). A Regional Persistent Disk costs roughly double a zonal disk of the same type but survives a single zone outage without manual failover -- the correct answer whenever a scenario says "must tolerate a zone failure without data loss" for a disk that isn't already covered by application-level replication.
SSH Access: Metadata Keys vs. OS Login
Google Cloud offers two SSH access mechanisms, and precedence between them is a favorite exam trap (OS Login is covered in depth in section 6.3, but you must know the basic metadata mechanism here):
- Project-wide metadata SSH keys -- keys stored on the
sshKeysproject metadata field, valid for every instance in the project unless a specific instance blocks them. - Instance-level metadata SSH keys -- keys attached only to one instance's metadata; an instance can also set
block-project-ssh-keys=TRUEto ignore project-wide keys and accept only its own. - OS Login -- ties SSH access to IAM identity instead of any metadata key (full detail in 6.3).
When you run gcloud compute ssh, the CLI automatically generates a key pair and propagates the public key for you -- useful for quick access, but in an enterprise fleet this is exactly the unaudited pattern OS Login is meant to replace.
Availability Policies
An instance's availability policy controls what happens when the underlying host needs maintenance or the instance stops responding. Two settings matter most for the exam:
- On-host maintenance:
MIGRATE(default) live-migrates the running instance to another host with no reboot and no downtime;TERMINATEstops the instance instead. Certain instance types cannot live-migrate and must useTERMINATE: Spot VMs, preemptible VMs, GPU-attached instances, and instances on sole-tenant nodes with certain configurations. - Automatic restart: if
TRUE(default for standard VMs), Compute Engine restarts the instance automatically after a host failure or software crash; Spot and preemptible VMs cannot use automatic restart in the same way because Google may reclaim the capacity outright. - Termination action (Spot VMs only):
STOP(preserve the disk, restart later) orDELETE(discard the instance) when Google reclaims the capacity.
Worked Scenario
A team needs (1) a production PostgreSQL primary that must never silently disappear during host maintenance, and (2) a fleet of batch-rendering workers that only need to run when spare capacity is cheap. For (1): a standard VM, pd-ssd or Hyperdisk Balanced disk, onHostMaintenance=MIGRATE, automaticRestart=TRUE, and OS Login for auditable SSH. For (2): Spot VMs (provisioning-model=SPOT), onHostMaintenance=TERMINATE (required), terminationAction=STOP so partially completed work resumes, and pd-standard disks since raw throughput matters more than IOPS.
A batch-processing fleet runs on Spot VMs to minimize cost. Which on-host maintenance setting must these instances use?
A workload needs the highest available throughput for reading a large, immutable dataset during ML inference. Which disk type is the best fit?
An instance has its own instance-level SSH key in metadata and also sets block-project-ssh-keys=TRUE. What is the result?