You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Storage is a critical component of every Compute Engine VM. Google Cloud offers two primary disk types: Persistent Disks (network-attached, durable storage) and Local SSDs (physically attached, high-performance ephemeral storage). Understanding the differences, performance characteristics, and use cases for each is essential for designing reliable and performant architectures.
Persistent Disks (PDs) are durable, network-attached block storage devices. They are independent of the VM lifecycle — you can detach, reattach, resize, and snapshot them at any time. Data on a Persistent Disk is automatically encrypted at rest and replicated across multiple physical disks within the zone or region for durability.
| Type | Description | Max IOPS (read) | Max Throughput (read) | Use Case |
|---|---|---|---|---|
| pd-standard | Standard HDD | 7,500 | 180 MB/s | Bulk storage, cold data, backups |
| pd-balanced | Balanced SSD | 80,000 | 1,200 MB/s | General-purpose boot and data disks |
| pd-ssd | Performance SSD | 100,000 | 1,200 MB/s | Databases, high-IOPS workloads |
| pd-extreme | Extreme performance SSD | 120,000 | 2,400 MB/s | Tier-1 databases (Oracle, SAP HANA) |
| Hyperdisk Extreme | Next-gen extreme | 350,000 | 5,000 MB/s | Highest-performance workloads |
| Hyperdisk Balanced | Next-gen balanced | 160,000 | 2,400 MB/s | General workloads with predictable performance |
| Hyperdisk Throughput | Next-gen throughput | N/A | 2,400 MB/s | Large sequential reads (data analytics) |
# Create a standalone Persistent Disk
gcloud compute disks create data-disk-1 \
--zone=europe-west2-a \
--size=500GB \
--type=pd-ssd
# Attach the disk to a running VM
gcloud compute instances attach-disk web-server-1 \
--zone=europe-west2-a \
--disk=data-disk-1 \
--mode=rw
# Inside the VM: format and mount the disk
sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0 /dev/sdb
sudo mkdir -p /mnt/data
sudo mount -o discard,defaults /dev/sdb /mnt/data
Persistent Disk performance scales with disk size. Larger disks provide higher IOPS and throughput, up to the per-VM limits of the machine type. For example, a 1 TB pd-ssd provides roughly 30,000 read IOPS and 30,000 write IOPS, while a 500 GB pd-ssd provides roughly 15,000 each.
Important: Each machine type has maximum disk IOPS and throughput limits. Even with a very large disk, the VM itself may be the bottleneck. Check the machine type documentation for per-VM disk performance limits.
You can increase the size of a Persistent Disk without stopping the VM:
gcloud compute disks resize data-disk-1 \
--zone=europe-west2-a \
--size=1000GB
After resizing, extend the filesystem from within the VM:
sudo resize2fs /dev/sdb
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.