Persistent Disk in Google Cloud
A plain-English guide to the durable network disks that sit behind Compute Engine virtual machines and Kubernetes workloads. Learn how they store your data, how fast they are, how to protect them, and how to avoid paying for more than you need.
Think about the hard drive inside your laptop. It holds your photos, your documents and your operating system. If you spill tea on the laptop and it dies, your data may die with it. Now imagine a hard drive that does not live inside the laptop at all. It lives in a safe building far away, connected by a fast cable, and if the laptop breaks, you simply plug the same drive into another laptop and carry on. That is the big idea behind Persistent Disk.
Persistent Disk is the name Google Cloud gives to its durable network storage for virtual machines. Every time you create a Compute Engine machine, a disk is created for it. Every time you run a database, a file server or a Kubernetes application that must remember things, a disk is almost certainly doing the remembering. In this guide you will learn what Persistent Disk is, how it works inside, which type to choose, how to make it fast, how to back it up, and which mistakes cost real teams real money.
Every new word is explained the first time it appears. You do not need any storage or cloud knowledge before you begin. By the end, you will be able to explain Persistent Disk to a teammate, pick the right disk for a workload, and design a backup plan that actually works.
AWhat Is Persistent Disk?
Start with the big picture: what a Persistent Disk is, and what it is not.
Persistent Disk, often shortened to PD, is a service that gives your virtual machines block storage. Block storage is the same kind of storage a normal computer uses for its internal drive. The disk looks like a raw, empty drive to the operating system. The operating system then puts a file system on it, which is the organised structure of folders and files that you are used to. The word block simply means that the data is stored and read in small, equal-sized pieces, which makes it very fast and flexible.
The word persistent is the important one. It means the data stays safe even when the virtual machine is stopped, restarted or deleted. A virtual machine is a software computer that Google runs for you on its hardware. These machines can come and go, but a Persistent Disk keeps living on its own until you decide to delete it.
Think of a laptop and a portable external drive. The laptop is the virtual machine, and it can be replaced. The external drive is the Persistent Disk, which holds the precious files. If the laptop is stolen, you buy a new laptop, plug in the same drive and everything is still there. The only difference is that Google’s drive is connected through a very fast network instead of a cable on your desk.
Network storage, not a drive inside the machine
A Persistent Disk is not physically inside the computer that runs your virtual machine. It is a network-attached disk, which means the data lives on separate storage machines in the same data centre, and your virtual machine talks to them over Google’s internal network. This design is the secret of its flexibility. Because the disk is separate, you can detach it from one machine and attach it to another, resize it while it is in use, and copy it without turning anything off.
What it is used for
Almost every Compute Engine virtual machine has a boot disk, which holds the operating system. Many also have extra data disks for databases, application files, logs and backups. Kubernetes clusters on Google Cloud use Persistent Disks to give containers a place to keep data that must survive restarts. Managed products such as Cloud SQL are also built on the same family of network block storage, though Google manages those disks for you.
Google Cloud has also introduced a newer family of block storage called Hyperdisk. It follows the same basic idea, with more freedom to choose speed and size separately. This guide focuses on Persistent Disk, and a later chapter compares the two so you can see where each fits.
BThe Problem Persistent Disk Solves
To understand any tool, first feel the pain it was built to remove.
In a traditional data centre, every server had its own disks screwed into its own case. This worked, but it created a long list of troubles. When a server broke, the data trapped inside it was stuck until someone repaired or replaced the hardware. When a server ran out of space, someone had to buy a bigger disk, open the machine, install it and copy everything over, often at night to avoid disturbing users.
Planning capacity was another headache. You had to guess how much storage each server would need for the next three years and buy accordingly. Guess too low and you faced emergency upgrades. Guess too high and money sat idle inside machines that never used it. Backups were manual chores, and moving an application to a better machine meant long, risky copying.
It is like a family where every person must carry their entire wardrobe in their own backpack. If the backpack tears, the clothes are lost. If you outgrow the backpack, you must buy a new one and repack everything. Persistent Disk is a wardrobe kept in a safe, spacious room in the house. Anyone can fetch what they need, and the wardrobe can grow without anyone repacking.
The four big headaches
Data tied to hardware
When data lives inside one machine, a hardware failure can mean data loss or long recovery times.
Guessing future size
Fixed local disks force you to predict needs years ahead and pay for space you may never use.
Painful moves
Moving data to a new server meant copying every byte over the network, with downtime and risk.
Manual backups
Backups required scripts, tapes and discipline. Many teams skipped them until the day they were needed.
Persistent Disk attacks all four. The data is stored redundantly on separate storage machines, so a single hardware failure does not lose it. You can enlarge a disk while it is running. You can detach it and attach it to another machine within the same zone in moments. And you can take snapshots, which are point-in-time backups, with a single request or on an automatic schedule.
Because the disk sits across a network, every read and write travels a short distance. This adds a small delay compared with a drive physically inside the machine. Google offers Local SSD for the fastest possible access, but its data does not survive in the same way. A later chapter explains this choice in detail.
CCore Concepts You Must Know
A handful of words explain almost everything in Persistent Disk. Learn them well and the rest becomes easy.
Block storage, file system and mount
A raw Persistent Disk is like a blank notebook with numbered pages but no table of contents. The operating system must first create a file system, which acts as the table of contents and the filing rules. Common examples are ext4 and XFS on Linux, and NTFS on Windows. This step is called formatting. After that, the disk must be mounted, which means attached to a folder path so that programs can read and write files there.
A new disk is an empty warehouse building. Formatting is installing shelves and a labelling system. Mounting is giving the warehouse a street address so delivery trucks know where to go. Without these steps, the building exists, but nobody can use it.
Zones and regions
Google Cloud is divided into regions, which are geographic areas such as Mumbai, Iowa or Frankfurt. Each region contains several zones, which are separate data-centre areas with their own power and cooling. A normal Persistent Disk is a zonal resource. It lives in one specific zone, and it can only be attached to virtual machines in that same zone. A regional Persistent Disk keeps copies in two zones of one region, which gives extra protection against a zone failure.
Boot disk and data disk
The boot disk holds the operating system and is required for the machine to start. A data disk is an extra disk for your application’s information. Keeping data on a separate disk from the operating system is a wise habit. You can rebuild the machine from a fresh operating system image and simply reattach the data disk.
Attach, detach and auto-delete
Attaching connects a disk to a virtual machine. Detaching disconnects it without destroying it. Each disk also has an auto-delete setting that says whether the disk should be deleted when its virtual machine is deleted. Boot disks commonly default to auto-delete, while extra data disks are commonly kept. Check this setting on important disks, because it decides whether your data survives the machine.
A single wrong setting on auto-delete can erase a disk you wanted to keep. Before deleting any machine that has valuable data, verify the setting and take a snapshot first. A snapshot costs little and can save weeks of work.
IOPS, throughput and latency
Three numbers describe disk speed, and you will see them throughout this guide.
Operations per second
How many separate read or write requests the disk can handle each second. It matters for databases doing many small lookups.
Data per second
How many megabytes can flow each second. It matters for large files, backups and analytics.
Waiting time
How long one request takes to complete. It matters whenever a user is waiting for an answer.
Size
How many gigabytes or terabytes the disk can hold. On Persistent Disk, size often also affects speed.
Picture a motorway. IOPS is how many cars can enter per second, throughput is how many passengers arrive per second, and latency is how long one trip takes. A road with many narrow lanes handles many small cars well, while a wide road with fewer lanes moves big trucks better. Different workloads need different roads.
DDisk Types: Choosing the Right One
Persistent Disk comes in several flavours. Picking the right flavour is the most important decision you will make.
Google offers different Persistent Disk types, each built on different storage technology and priced differently. The names are easy to remember once you know the pattern. The product names below were current at the time of writing, so always confirm the latest list and the machine types that support each one on the official page.
Standard Persistent Disk
Built on spinning hard drives. The cheapest per gigabyte, and best for large, sequential work such as backups, logs and big files read in order. It is weak at many small random operations.
Balanced Persistent Disk
Built on solid-state drives. It offers a good mix of price and performance, and it suits most general workloads, including web servers and small to medium databases.
SSD Persistent Disk
A performance-focused solid-state option with higher speed per gigabyte. It suits busy databases and applications with strict latency needs.
Extreme Persistent Disk
The highest-performance option, where you can choose the number of operations per second yourself. Aimed at very demanding databases on large machines.
Choosing a disk type is like choosing a vehicle. Standard is a slow, cheap goods train that hauls huge loads economically. Balanced is a dependable family car that handles most trips. SSD is a sports car for people in a hurry. Extreme is a racing car with a tuned engine, for tracks where every millisecond counts.
| Question | Standard | Balanced | SSD | Extreme |
|---|---|---|---|---|
| Underlying technology | Hard drives | Solid-state | Solid-state | Solid-state |
| Relative price per gigabyte | Lowest | Medium | Higher | Highest, plus provisioned operations |
| Good at | Large sequential reads and writes | General everyday work | Fast random access and low latency | Extreme database loads |
| Weak at | Many small random operations | The most demanding databases | Cost on big, cold data | Cost and VM requirements |
| Typical use | Backups, archives, logs | Boot disks, web apps, mid-size databases | Busy databases, search indexes | Very large database servers |
Where Hyperdisk and Local SSD fit
Hyperdisk is a newer family of network block storage in which you choose the capacity, the operations per second and the throughput separately, instead of getting speed mainly from size. Newer machine families are increasingly designed around Hyperdisk, and some support it in addition to or instead of Persistent Disk. Local SSD is different in kind. It is physically attached to the host machine and is extremely fast, but it is temporary and its data does not follow the machine in the same protective way. Use it for scratch data, caches and anything you can rebuild.
Start with Balanced for almost everything. Move up to SSD or beyond only when measurements show the disk is the bottleneck, and move down to Standard for big, cold, sequential data. Before settling, check which disk types your chosen machine type supports.
EArchitecture and Components
Let us look at the main pieces that sit between your application and the stored bytes.
When your program saves a file, the request travels through several layers before the data is safely stored. Knowing these layers helps you explain slow disks, strange errors and sizing limits. The diagram below shows a simplified view.
flowchart LR
APP["Application or Database"] --> FS["File System in the Guest OS"]
FS --> BD["Virtual Block Device in the VM"]
BD --> NET["Google Data Centre Network"]
NET --> CTRL["Persistent Disk Storage Service"]
CTRL --> R1[("Storage Replica 1")]
CTRL --> R2[("Storage Replica 2")]
CTRL --> R3[("Storage Replica 3")]
CTRL -.->|"Regional disks only"| Z2["Second Zone Replica Set"]
CTRL -.->|"Snapshots"| GCS[("Cloud Storage Snapshot Store")]
Walking through the diagram
The application asks the file system to save data. The file system turns “save this file” into low-level block requests, such as “write these bytes at this position”. These requests go to a virtual block device inside your virtual machine, which looks like an ordinary disk to the operating system. From there, the request leaves the machine and crosses Google’s internal network to the Persistent Disk storage service.
The storage service is the brain of the system. It decides where the data should live, writes it to several storage replicas on different machines, and only reports success once the data is safely stored. In a regional disk, copies are also kept in a second zone. Snapshots, which are backups taken from the disk, are stored separately in Google’s object storage, so they do not depend on the original disk surviving.
Imagine posting an important document through a courier. The sender (application) hands it to the front desk (file system). The courier van (network) carries it to a secure archive (storage service), where clerks make three certified copies and file them in different cabinets (replicas). Only after all copies are filed does the clerk say “received”.
Key components in plain words
File system and block device
The software inside your VM that organises files and sends block requests. You manage this part.
Storage network path
A fast internal route from your VM to the storage service. It is shared with other traffic, so its limits matter.
Storage service
Google’s managed layer that splits, copies, stores and protects your data. You never touch it directly.
Redundant copies
Multiple copies on separate hardware so a single failure never loses data.
Snapshot storage
Durable, separate storage that holds your point-in-time backups.
Control plane
The Google Cloud systems that create, attach, resize and delete disks when you ask.
One important design idea hides in this picture. Your virtual machine is stateless in spirit, and the disk is the memory. Because the memory lives outside the machine, Google can move, restart or repair the machine without touching your data.
FInternal Working: The Life of a Write
Follow one single save operation from your program to safe storage and back.
Let us trace what happens when a database saves one new order to a Balanced Persistent Disk. The goal is to see where time is spent and where safety is guaranteed.
sequenceDiagram
participant A as Database
participant O as Guest OS and File System
participant V as Virtual Disk Driver
participant S as PD Storage Service
participant R as Storage Replicas
A->>O: Write order record
O->>V: Block write request
V->>S: Send request over network
S->>R: Write to several replicas
R-->>S: Acknowledge each copy
S-->>V: Write confirmed
V-->>O: Complete
O-->>A: Success returned
Step by step
The program asks to write
The database hands data to the operating system. Many databases ask for a flush, which means “do not tell me it is done until it is truly safe”.
The file system converts it to blocks
The file system works out which blocks must change, and may batch several small writes together to be more efficient.
The request travels the network
The virtual disk driver packages the request and sends it to the storage service. This hop adds a small, steady delay.
The service replicates the data
The service writes the data to multiple storage machines. Only when enough copies are safe does it confirm success.
Confirmation flows back
The success message returns up the chain and the database continues. Total time is typically a few milliseconds.
Reads and caching
A read follows a similar path in the opposite direction. The operating system also keeps a page cache, which is a portion of the machine’s memory used to hold recently read file data. If the data you need is already in the cache, the disk is not touched at all, and the answer comes back in microseconds. This is why a machine with generous memory often feels much faster than the raw disk numbers suggest.
The page cache is like keeping your most used books on your desk. You walk to the library shelf (the disk) only for books you have not touched recently. The bigger your desk, the fewer trips you make.
Why the flush matters
A flush, sometimes called a sync, forces buffered data out of memory and onto the disk. Without a flush, a machine crash could lose the last few seconds of work that the program believed was saved. Databases flush carefully on purpose, and this is why disk latency has a direct effect on how many transactions per second a database can commit.
You will sometimes see advice to disable flushing or write protections to gain speed. This trades safety for speed and can corrupt data after a crash. Improve speed by choosing a faster disk or adding memory instead.
GPerformance: Getting the Speed You Pay For
Disk speed is shaped by three things at once: the disk, the machine and the way your software uses it.
It surprises many beginners that the performance of a Persistent Disk is not decided by the disk alone. Three limits work together, and the lowest one wins. This is the single most useful idea in this chapter.
The disk’s own limit
On most Persistent Disk types, speed grows with size. A bigger disk gets more operations per second and more throughput, up to a ceiling for that type. A tiny disk is limited even if you pay for a fast type.
The virtual machine’s limit
Each machine type can push only so much disk traffic. A small machine with a huge fast disk cannot use all that speed, because the machine itself becomes the bottleneck. Machines with more virtual CPUs generally allow more disk traffic.
The workload’s own pattern
If your software sends only one request at a time, it cannot reach the disk’s potential. Fast disks need many requests in flight together, which is called a deep queue.
It is like filling a swimming pool. The tap (disk), the hose (machine) and the person turning the tap on (your software) all matter. A huge tap connected to a thin hose still fills slowly. A thick hose with a barely open tap does the same. The pool fills at the speed of the narrowest part.
Size affects speed
For Standard, Balanced and SSD disks, performance is tied to size. This has a surprising practical effect: sometimes it is sensible to create a larger disk than you need purely to gain performance. A database that needs 200 gigabytes of space but 10,000 operations per second may need a disk several times bigger to unlock that speed. Always compare the cost of a larger disk with the cost of moving to a faster type. Check the current performance tables in the official documentation, because limits are updated as the service evolves.
IOPS or throughput: which one matters?
IOPS-heavy work
Databases, mail servers and busy applications read and write many tiny pieces. The number of operations per second is what limits them.
Throughput-heavy work
Video processing, backups, log shipping and analytics stream big chunks. The megabytes per second is what limits them.
Practical tuning steps
- Measure first. Use a disk benchmarking tool on a test copy to learn the real limits, rather than trusting guesses.
- Check the machine. Confirm that the machine type allows the disk traffic you need.
- Add memory. A bigger page cache reduces how often the disk is touched.
- Keep requests flowing. Configure applications to issue several requests at once so the disk stays busy.
- Separate workloads. Put the busy database on its own disk, apart from logs and backups, so they do not fight for the same limits.
When your workload asks for more than the disk or machine allows, the excess requests are slowed down. This is called throttling. It shows up as rising latency, not as errors, which makes it easy to miss unless you watch the right metrics. A later chapter shows how.
A worked sizing story
Imagine a small online shop whose database holds 150 gigabytes of data. During a festival sale, the database must handle about eight thousand operations per second. The team first creates a 150 gigabyte Balanced disk, because it matches the data size and the budget is tight. On the first sale day, response times climb, and the monitoring dashboard shows throttled operations above zero for most of the afternoon. The disk is not full, and the machine is not busy, but the disk is simply too small to deliver the speed the database wants.
The team now has three choices. They can grow the disk to a much larger size, which raises the allowed operations and costs more in storage. They can move to an SSD disk type, which gives more operations for each gigabyte. Or they can add memory to the machine so that more reads are served from the page cache and the disk is asked fewer questions. They try the memory option first because it is cheapest, then grow the disk modestly, and the throttling disappears. The lesson is to measure, change one thing at a time, and measure again.
Block size and access patterns
The size of each request matters as much as the number of requests. Imagine moving a sandy beach. You can carry it grain by grain, which is slow and tiring, or in big bucketfuls, which is fast. Small requests, such as four kilobytes at a time, are limited mostly by operations per second. Large requests, such as one megabyte at a time, are limited mostly by throughput. A workload with a random pattern jumps around the disk, and a sequential workload reads or writes in order. Hard-drive-based Standard disks do far better with sequential patterns, while solid-state types handle random patterns well.
A random pattern is like a postman delivering letters to houses scattered all over a city, and a sequential pattern is like a postman who delivers to every house on one street in order. The second postman finishes sooner with the same effort, which is why ordered access is so much kinder to slower disks.
Benchmarking with care
Always benchmark on a test copy, never on a live production disk, because a heavy test can fill queues and slow real users. Choose a benchmarking tool that lets you set the request size, the read and write mix and the number of requests in flight. Run each test long enough to move past short bursts, and record the results next to the machine type and disk size so you can compare later. Repeat the test after every change. A single run is an anecdote, and three runs are a measurement.
HZonal vs Regional Persistent Disk
Where your disk lives decides what kind of disaster it can survive.
A zonal Persistent Disk keeps all its copies inside one zone. If that zone has a serious problem, such as a power failure or a network fault, the disk and the machines attached to it may be unavailable until the zone recovers. For many workloads this is acceptable, especially when you also keep good backups.
A regional Persistent Disk keeps copies in two zones of the same region and writes to both at the same time. This is called synchronous replication, which means a write is confirmed only after both zones have stored it. If one zone fails, the data is still in the other zone, and you can start a replacement machine there and attach the same disk.
A zonal disk is like keeping your only copy of an important contract in one office. A regional disk is like keeping an identical signed copy in two offices in the same city. If one building loses power, the other still has the contract and work continues quickly.
flowchart TD
subgraph ZA["Zone A"]
VMA["Primary VM"]
RA[("Regional PD Replica A")]
end
subgraph ZB["Zone B"]
VMB["Standby VM"]
RB[("Regional PD Replica B")]
end
VMA -->|"Reads and writes"| RA
RA |"Synchronous replication"| RB
VMB -.->|"Attaches after failover"| RB
ZA -. "Zone A fails" .-> VMB
How a failover works
Detect the problem
Monitoring notices that the primary machine or its zone is unavailable and raises an alert, or your automation reacts.
Start or wake the standby
A machine in the second zone is started, or it is already running as a warm standby.
Force-attach the disk
Because the original machine cannot be reached to release the disk cleanly, you use a force-attach option to attach the surviving replica to the standby.
Start the application
The application mounts the disk, replays any unfinished work from its own log, and begins serving again.
The price of regional protection
Regional disks cost more, since you pay for storage in two zones, and every write must wait for both zones, so latency for writes is slightly higher than for a zonal disk. Regional disks also support fewer disk types than zonal ones, so verify your choice against the current documentation. For most teams, the best approach is to use regional disks only for data where short downtime is truly costly, and rely on snapshots and good design everywhere else.
A regional disk protects against a zone failure. It does not protect against a mistake. If someone deletes a table or an attacker encrypts your files, both replicas faithfully copy the damage. You still need snapshots and tested restores.
When to choose which
Choose a zonal disk when
- The application replicates its own data across machines.
- A short outage during a zone problem is acceptable.
- You want the lowest price and the lowest write delay.
- The data is a cache, a test copy or easily rebuilt.
Choose a regional disk when
- A single machine holds important data with no replica.
- A zone outage would cost serious money or trust.
- You need a simple failover path for a stateful application.
- You accept double the storage cost and slightly slower writes.
Split-brain: the danger to avoid
During a failover, it is vital that only one machine writes to the disk at any moment. If the old machine in the failed zone is merely unreachable and not truly stopped, and the new machine also begins to write, two writers could damage the data. This dangerous situation is called split-brain. Force-attach is powerful because it breaks the old attachment, so use it with clear rules: confirm that the old machine is stopped or fenced off before the new machine starts writing. Good automation handles this step carefully, and good runbooks make the human steps explicit.
Split-brain is like two managers both believing they are in charge of the same shop and giving different orders to the same staff. Before a new manager takes over, the old manager’s keys must be collected. Only one set of keys may exist.
ICreating, Attaching and Using a Disk
The lifecycle of a data disk, from an empty shell to a working part of your system. No commands are needed to understand the steps.
Using a new data disk always follows the same path. Knowing the order helps you avoid the classic mistake of attaching a disk and then wondering why the machine cannot see any files.
Create the disk
Choose a name, a zone, a type and a size. The zone must match the zone of the virtual machine that will use it. You can also create a disk from a snapshot or an image, in which case it starts with that data already inside.
Attach it to a machine
Attach it in read-write mode for normal use. The machine now sees a new, empty device, similar to plugging in a blank external drive.
Format it, once
Inside the operating system, create a file system on the new device. Do this only for a brand-new disk. Formatting an existing disk erases its contents.
Mount it
Attach the file system to a folder path, such as a data folder, so programs can use it.
Make the mount permanent
Record the mount in the machine’s startup configuration so it returns after every restart. Use the disk’s unique identifier rather than a device name, because device names can change between restarts.
Use it and protect it
Point your application at the folder, set up snapshot schedules and add monitoring.
Setting up a disk is like moving into a new office. First the building is built (create), then you get the keys (attach), then you install desks and cabinets (format), then you put your company name on the door (mount), and finally you make sure the name stays on the door after every renovation (permanent mount).
Two classic traps
Formatting an existing disk
Running the format step on a disk that already holds data wipes it. Always check whether the disk is new before formatting.
Boot hangs from a missing disk
If the startup configuration insists on a disk that is not attached, the machine may fail to finish booting. Use the optional-mount setting so a missing data disk does not block startup.
Detaching safely
Before you detach a disk, stop the application using it and unmount the file system. This makes sure all buffered data is written out. Detaching a disk that is busy is like pulling a USB drive out while files are still copying, and it can leave the file system in a damaged state that needs repair.
Give disks names that say what they hold and where they belong, such as the application, the environment and the purpose. When someone sees an unattached disk months later, a good name tells them whether it is safe to delete.
Choosing a file system
The file system you create on a disk affects speed, safety and tools. On Linux, ext4 is a mature, widely supported choice that works well for most workloads. XFS is popular for very large files and heavy parallel work, and many database vendors recommend it. On Windows, NTFS is the standard. Pick the file system your application vendor recommends, and use the same choice across similar machines so that your team learns one set of habits instead of many.
Some applications can also use a raw disk directly, with no file system at all, but this is rare and specialised. For nearly every beginner, a standard file system is the right starting point. Remember that the file system, not the cloud, decides what happens to your files after a crash, so keep it healthy with updates and occasional checks.
Choosing a file system is like choosing a shelving system for a warehouse. Some systems are great for many small boxes, and others are better for a few huge crates. Your goods decide the best shelves, and changing shelves later means moving every box.
Mount options worth knowing
When you mount a disk, you can add options that change its behaviour. A common option is to skip updating access times on every read, which reduces needless writes. Another is the optional-mount flag mentioned earlier, which prevents a missing disk from blocking startup. Apply options deliberately and document them in your runbook, because a surprising option discovered during an outage is an unpleasant way to learn.
JResizing and Everyday Maintenance
One of the greatest gifts of cloud storage is that you can grow a disk without stopping your system.
A Persistent Disk can be made larger while it is attached and in use. You increase the size in the control plane, and the new space appears to the virtual machine. However, the file system does not know about the extra space until you tell it to grow. So resizing has two stages: first the disk, then the file system on top of it.
Imagine renting a bigger storage unit next door. First the landlord knocks down the wall between the two rooms (resize the disk). But your shelves still stop at the old wall, so you must install new shelves into the new space (grow the file system). Only then can you store more.
Important rules about resizing
- Growing is easy; shrinking is not possible in place. You cannot reduce the size of an existing disk. To get a smaller disk, create a new smaller one and copy the data across.
- Take a snapshot first. Resizing is safe by design, but a fresh snapshot costs little and protects you from human error in the file system step.
- Resizing also raises speed. Since performance is tied to size on most types, a bigger disk may also become faster, which can be a useful side effect.
- Plan growth steps. Grow in sensible chunks and set alerts before the disk is nearly full, because a completely full file system causes application failures.
Changing the disk type
Sometimes you discover that a disk is the wrong type. Changing the type of an existing disk is generally done by taking a snapshot and creating a new disk of the new type from it, then swapping disks. Some newer options allow more direct changes, so check the current documentation. Plan a short maintenance window for the swap, and test the new disk before removing the old one.
Routine health habits
Watch free space
Alert at 80 percent used so you have time to grow the disk calmly instead of during an outage.
Remove old files
Rotate and compress logs, and delete temporary files. Often the cheapest fix for a full disk is housekeeping.
File system health
Schedule occasional file system checks during planned maintenance, especially after unclean shutdowns.
Find orphaned disks
List disks that are not attached to any machine. They still cost money, and many are leftovers nobody remembers.
A disk that reaches one hundred percent full can crash databases, stop logging and even prevent logins. Treat low free space as an urgent alert, not as a chore for later.
KSnapshots, Images and Backups
A disk keeps your data safe from hardware failure. Snapshots keep it safe from everything else.
A snapshot is a saved copy of a disk’s contents at one moment in time. Snapshots are stored separately from the disk, in Google’s durable object storage, so they survive even if the disk is deleted. They are the main tool for backups, for recovery after mistakes, and for copying a disk to another zone or another project.
A snapshot is like taking a photograph of a whiteboard before wiping it. The whiteboard (the disk) keeps changing, but the photograph (the snapshot) always shows exactly what was written at that moment. If someone wipes the board by mistake, you can rewrite everything from the photo.
Incremental by design
Snapshots are incremental. The first snapshot of a disk copies all the used data. Every later snapshot stores only the blocks that changed since the previous one. This makes frequent snapshots fast and keeps the cost low. You can still restore a full disk from any single snapshot, because the system keeps track of how the pieces fit together. Deleting an older snapshot does not break newer ones, since the service preserves any data that later snapshots still need.
flowchart LR
D["Live Disk"] -->|"First snapshot, all used blocks"| S1["Snapshot 1"]
D -->|"Changed blocks only"| S2["Snapshot 2"]
D -->|"Changed blocks only"| S3["Snapshot 3"]
S3 --> N["New disk in any zone"]
S2 --> N2["Restore point after a mistake"]
S1 --> IMG["Custom image for new VMs"]
Snapshot schedules
You do not need to remember to take snapshots. A snapshot schedule is a rule that takes snapshots automatically, for example every six hours, and deletes old ones after a retention period, for example thirty days. Attach the schedule to a disk, and the system does the rest. A good schedule balances two ideas: how much recent data you can afford to lose, and how much you are willing to pay for stored snapshots.
Consistency: crash-consistent or application-consistent
A snapshot taken while the application is busy captures the disk exactly as it was at that instant. This is called a crash-consistent snapshot, because restoring it looks like the machine lost power at that moment. Well-built databases recover from this automatically. For stronger guarantees, take an application-consistent snapshot by briefly pausing writes or flushing the database before the snapshot begins. On Windows, a built-in service can help the applications cooperate. For critical databases, ask your database vendor which method they recommend.
Snapshots, images and machine images
Snapshot
A point-in-time backup of one disk. Best for protection and for copying data between zones.
Image
A prepared boot disk used to create many identical machines. Best for standard server setups.
Machine image
A copy of a machine’s settings plus all its disks. Best for cloning or backing up an entire machine.
Once every quarter, create a disk from your latest snapshot, attach it to a test machine and check that the data opens correctly. A backup you have never restored is only a hope.
Where snapshots are stored
When you create a snapshot, you choose a storage location. A multi-regional location keeps copies across a wide area, which protects against the loss of a whole region. A regional location keeps copies in one region, usually at lower cost and closer to your disks. Pick the location by asking two questions: how bad would it be if an entire region were lost, and where will I most likely restore this data? Regulated data may also be required to stay inside a country or a legal area, so check your rules before choosing.
Snapshot costs in plain words
You pay for the storage that your snapshots occupy. Because they are incremental, a chain of snapshots usually costs far less than the same number of full copies. Costs still grow when your data changes a lot, because every changed block must be stored. A database that rewrites large parts of its files every night produces bigger snapshots than a file server that rarely changes. If snapshot costs surprise you, check how much data changes between snapshots, how long you keep them and whether temporary files or caches are sitting on a disk that you snapshot unnecessarily.
Short retention
Take snapshots often, such as every few hours, but keep them only for a few days. This covers recent mistakes cheaply.
Medium retention
Keep one snapshot per day for a few weeks. This covers problems discovered late.
Long retention
Keep one per month for a year or more where rules require it, perhaps in a cheaper archive style of storage.
Separate copy
Keep at least one set in a different project with tight permissions, so a compromised account cannot erase every backup.
This layered plan works like keeping receipts. You keep this week’s receipts in your wallet, this year’s in a drawer at home, and the important tax records in a bank locker. Each layer is cheaper to keep and harder to reach, and together they cover every need.
LSharing Data Between Machines
A normal disk belongs to one machine at a time. Here is what to do when many machines need the same data.
By default, a Persistent Disk is attached to one virtual machine in read-write mode. This is the safest arrangement, because a normal file system assumes only one computer is changing it. If two machines wrote to the same ordinary file system at once, they would overwrite each other’s changes and quickly corrupt it.
Imagine two clerks writing in the same paper ledger at the same time without talking to each other. They would write on the same line, cross out each other’s entries and leave a mess. A normal file system is a ledger that was designed for exactly one clerk.
Your options for sharing
Read-only attach to many machines
A disk can be attached in read-only mode to several machines at once. This works for shared reference data, such as a model file or a website content copy, that never changes while in use.
Multi-writer mode
Some disk types allow several machines to write together, but only if the software on top knows how to coordinate, such as a clustered database or a cluster file system. It is an advanced feature with strict requirements.
Filestore
A managed network file server that many machines can mount and use like a shared folder. The easiest answer for general shared files.
Cloud Storage
Object storage accessed over the web, ideal for images, videos and downloads that many services need to read.
Which one should you choose?
If the data never changes while machines read it, use read-only attach. If many machines need a normal shared folder that changes, use Filestore. If you serve large files to users or applications, use Cloud Storage. Reserve multi-writer mode for specialised software that explicitly supports it. Beginners who try to share a regular disk by attaching it read-write to two machines usually end up with damaged data.
Do not attach one ordinary read-write disk to two machines hoping it will “just work”. Without a cluster-aware file system, corruption is not a risk but a certainty.
MPersistent Disk with Kubernetes and GKE
Containers are temporary by nature. Persistent Disk gives them a memory that outlives them.
A container is a small, packaged program that runs on a shared machine. When a container restarts, everything written inside it is normally lost. That is perfect for stateless web servers, but terrible for databases and message queues. Kubernetes is the system that runs and manages many containers, and Google Kubernetes Engine, or GKE, is Google’s managed version of it. Kubernetes solves the memory problem with volumes, and on Google Cloud those volumes are very often Persistent Disks.
The three words to learn
StorageClass
A menu entry that describes a kind of storage, such as “fast SSD” or “cheap standard”. Administrators define it once.
PersistentVolumeClaim
A request from an application saying “I need ten gigabytes of fast storage”. It is like placing an order from the menu.
PersistentVolume
The actual disk created to satisfy the request. With the Google storage driver, a real Persistent Disk is created automatically and attached to the right machine.
It is like ordering a hotel room. The room types on the website are StorageClasses. Your booking request is the PersistentVolumeClaim. The actual room that gets prepared and handed to you is the PersistentVolume. You never need to know which floor the room is on.
How it behaves in practice
When a pod, which is one running unit of your application, asks for storage, the Google storage driver creates a disk in a zone where the pod can run and attaches it to the machine hosting the pod. If the pod is rescheduled to another machine in the same zone, the disk follows it. Because a normal disk belongs to a single zone, a pod that uses it must run in that zone. This is why zone planning matters for stateful applications.
Regional disks for stateful workloads
For important stateful applications, a StorageClass can request regional disks. This lets the pod move to the other zone after a failure and still find its data. It costs more but gives much better recovery for databases that run inside the cluster. Many teams combine regional disks with the database’s own replication for an extra layer of safety.
ReadWriteOnce
One node can mount the disk for reading and writing. This is the normal mode for Persistent Disk.
ReadOnlyMany
Many nodes can mount the disk, but only to read. Good for shared reference data.
Need many writers?
Use Filestore for a shared folder that many pods can write to at once.
Reclaim policy
This setting decides whether the disk is deleted or kept when the claim is removed. Check it before deleting an application.
Kubernetes can request volume snapshots through the same storage driver. This lets you back up and clone application data using familiar Kubernetes objects, instead of switching to the cloud console.
NSecurity and Encryption
Google protects the hardware. You decide who may touch the data and who holds the keys.
Cloud security follows a shared responsibility model. Google secures the data centres, the physical drives and the storage service. You are responsible for who can create, attach, copy and delete disks, for the keys you choose to use, and for the data inside the file system.
Think of a bank locker room. The bank guards the building, the vault door and the cameras. You still decide who gets a copy of your key and what you put inside the locker. Both sides must do their part for the valuables to stay safe.
Encryption at rest and in transit
Data on Persistent Disk is encrypted at rest by default, which means the stored bytes are scrambled so that anyone who obtained the physical drive could not read them. You do not need to switch this on, and it does not require extra effort in your applications. Data travelling between your virtual machine and the disk is also protected within Google’s infrastructure.
Choosing who controls the keys
Google-managed keys
Google creates and rotates the keys for you. This is the simplest option and enough for most workloads.
Customer-managed keys
You hold the keys in Cloud Key Management Service. You can disable or rotate them, which gives you control and an audit trail, useful for regulated industries.
Customer-supplied keys
You provide the key yourself with each request. It gives maximum control, but if you lose the key, the data cannot be recovered by anyone.
Controlling access
Identity and Access Management, called IAM, decides which people and programs can do what. A role is a bundle of permissions. Following the principle of least privilege, give each person only what they need. A developer may need to attach disks but not delete them. An automation account may need to take snapshots but not read them. Snapshots can contain the same sensitive data as the disk, so protect them with the same care.
Security habits
- Protect snapshots. Restrict who can create disks from them, and who can copy them to other projects.
- Use dedicated service accounts. Each application gets its own robot identity with narrow permissions.
- Enable audit logs. Record who created, deleted or shared disks so you can investigate incidents.
- Wipe responsibly. Deleting a disk makes its data unavailable, and Google handles the destruction of the underlying storage. For regulated data, follow your own policy and consider key destruction as an additional control.
- Separate environments. Keep test and production disks in different projects so mistakes in one do not touch the other.
With customer-supplied keys, losing the key means permanent data loss. Even with customer-managed keys, disabling a key makes the data unreadable until it is restored. Treat key management as a serious operational process, with owners, backups and reviews.
OMonitoring, Logging and Metrics
A slow disk rarely announces itself. You must watch the right numbers to notice.
Google Cloud collects disk metrics, which are measured numbers over time, and shows them in Cloud Monitoring. The most useful ones tell you how many read and write operations occur, how many bytes move, and how much of the allowed capacity you are using. Operating system tools inside the machine add details such as how long each request waits and how full the file system is.
Disk metrics are like the dashboard of a car. Speed, fuel and engine temperature are separate dials, and each tells you something different. A driver who watches only the speedometer will be surprised by an empty tank.
The signals worth watching
Latency
How long each request waits. Rising latency with steady traffic is the first sign of trouble.
Throttled operations and bytes
Counts of requests slowed because the disk or machine hit its limit. If these are above zero for long, you need a faster disk or a bigger machine.
File system usage
The share of space used. Collected from the operating system, since the disk itself does not know what the file system contains.
Queue depth
How many requests wait at once. A permanently long queue means the disk cannot keep up.
Alerts that help
An alert is a message that wakes a person, so it must be worth waking up for. Good disk alerts include file system usage above eighty percent, sustained throttling, and latency far above normal. Weak alerts, such as a brief spike in operations, create noise and teach people to ignore alarms. Link every alert to a short guide that explains what to check first and how to grow the disk or move to a faster type.
Audit and change history
Cloud Audit Logs record administrative actions such as creating, resizing, attaching, snapshotting and deleting disks. When something disappears, the audit log is the first place to look to learn who did what and when. Make sure these logs are kept long enough for your compliance needs.
Build one dashboard per critical machine showing latency, operations, throttled operations and file system usage on the same screen. During an incident, seeing all four together answers most questions in seconds.
Reading the signals together
A single metric rarely tells the whole story, so learn to read them as a team. The table below shows common combinations and what they usually mean.
| What you see | What it usually means | First thing to try |
|---|---|---|
| High latency and high throttling | The workload asks for more than the disk or machine allows | Grow the disk, change type or use a bigger machine |
| High latency but no throttling | Slow requests from the pattern of access, or a busy queue inside the machine | Check request sizes and random access, and add memory for caching |
| Low operations but a slow application | The disk is not the problem | Look at processor, memory and the application itself |
| Rising file system usage | Data or logs are growing | Clean up, rotate logs or grow the disk |
| Sudden drop to zero operations | The disk may be detached, or the application has stopped | Check the machine, the mount and the application |
Tools inside the machine
Operating system tools show details that cloud metrics cannot. On Linux, standard utilities can show per-device utilisation, average wait time and queue length every few seconds. On Windows, the built-in performance monitor offers similar counters. Learn one such tool well, and use it side by side with the cloud dashboard. When the two agree, you can trust your diagnosis, and when they disagree, you have found something interesting.
Cloud metrics are the view from a helicopter, showing the whole traffic jam. Tools inside the machine are the view from the driver’s seat, showing which lane is blocked. A good investigator looks from both places before deciding what to fix.
PReliability, Failure Scenarios and Recovery
Plan for the bad day before it arrives. Here is what can go wrong and what each protection really covers.
Durability is the likelihood that your data survives and can be read later. Persistent Disk is designed for very high durability, because every write is stored redundantly on separate hardware. But durability against hardware loss is only one kind of safety. Different failures need different defences.
| What goes wrong | Does the disk’s own redundancy help? | What actually protects you |
|---|---|---|
| A storage drive fails | Yes, automatically | Built-in replication |
| The virtual machine crashes | Yes, the disk is separate | Restart or recreate the VM and reattach |
| A whole zone has an outage | Only for regional disks | Regional disk plus standby, or restore from snapshot elsewhere |
| A person deletes data by mistake | No, the deletion is copied | Snapshots and restore practice |
| Ransomware or corruption | No | Immutable or separate-project backups, access controls |
| The disk is deleted by accident | No | Snapshots, auto-delete review, restricted permissions |
Locking your house protects against thieves, a smoke alarm protects against fire, and insurance protects against both. No single item covers every risk. In the same way, replication, snapshots and access control each cover a different danger.
Recovery goals
Two numbers shape every recovery plan. The recovery point objective, or RPO, is how much recent data you can afford to lose. The recovery time objective, or RTO, is how long you can afford to be down. If your RPO is one hour, you need snapshots or replication at least hourly. If your RTO is fifteen minutes, a restore that takes half a day is not good enough, however carefully it was written.
A practical recovery ladder
Application-level replication
The database copies its own data to a second machine. This gives the quickest failover and is the first line of defence for busy systems.
Regional disk
For machines that cannot easily replicate themselves, a regional disk offers a second zone with synchronous copies.
Frequent snapshots
Scheduled snapshots with sensible retention cover mistakes, corruption and the loss of a disk.
Cross-region copies
Keep snapshots in a second region, or in a separate project with tight permissions, to survive a regional disaster or a compromised account.
Schedule a restore practice at least every quarter. You will almost always discover a missing permission, an outdated step or a slow part of the process. It is far cheaper to find these during practice than during a real outage.
Live migration and maintenance
Google regularly maintains the physical machines that run your virtual machines. For most machine types, a feature called live migration moves the running machine to other hardware without stopping it, and the disk connection continues without interruption. Because the disk lives separately, this does not affect your data. Some specialised machine types cannot live migrate and may restart, so design applications to start cleanly after a restart.
QCost and Billing
Disks are quiet spenders. They bill every hour, whether anyone is using them or not.
Persistent Disk is billed mainly by provisioned capacity. This means you pay for the gigabytes you created, not for the gigabytes you filled. A 500 gigabyte disk that holds 20 gigabytes of data costs the same as one that is full. Prices depend on the type, with Standard cheapest and the SSD types more expensive, and regional disks cost more because they store data in two zones. Extreme disks also charge for the operations you provision. Because prices change and vary by region, always check the official pricing page and use the pricing calculator before planning a budget.
It is like renting a warehouse by floor area. The rent is the same whether the warehouse is full of goods or nearly empty. The smart tenant rents what is needed, and moves to a bigger space only when the shelves begin to fill.
What drives the bill up
Unattached disks
A disk stays billable after its machine is deleted. Old, forgotten disks are one of the most common sources of waste.
Stopped machines still pay for disks
Stopping a virtual machine ends its compute charges, but its disks continue to cost money.
Over-provisioned size
Creating a huge disk “just in case” costs every month. You can grow later, so start modest.
Wrong disk type
Putting cold backup data on SSD costs several times more than Standard for no benefit.
Endless snapshot retention
Snapshots accumulate when nobody deletes them. Set a retention period on every schedule.
Regional disks everywhere
Paying double for replication on data that does not need it adds up quickly.
How to keep it under control
- Find and review orphaned disks monthly. If nobody owns a disk, snapshot it and delete it.
- Label everything. Add labels for owner, application and environment so cost reports show who spends what.
- Match type to purpose. Use Standard for cold bulk data, Balanced for general work, and faster types only where measurements justify them.
- Set snapshot retention. Keep dense recent snapshots and sparse older ones.
- Set budget alerts. A simple alert at eighty percent of the monthly plan prevents unpleasant surprises.
Because you can grow a disk online but cannot shrink it, it is cheaper to start a little small and grow with alerts than to start big. The exception is when you need the extra size for speed, as explained in the performance chapter.
A thought experiment: two storage plans
Consider a company that keeps 10 terabytes of old compliance records. Nobody reads them more than a few times per year. If the records sit on an SSD disk, the company pays a premium price every month for speed that nobody uses. Moving them to a Standard disk lowers the bill considerably. Moving them further to Cloud Storage may lower it more, because object storage is built for exactly this kind of cold data. The right answer depends on how the records are accessed, and the habit to build is to ask that question for every large disk.
Now consider a busy order database of only 300 gigabytes. Its disk is small, but every second matters, so it sits on a fast SSD disk with a regional option for safety and a snapshot every few hours. Its disk bill per gigabyte is much higher than that of the records archive, and rightly so, because each gigabyte earns money. Spending should follow value, not size.
Practical clean-up routine
List all disks
Export a list of every disk with its size, type, zone, labels and attached machine.
Mark the unattached ones
Any disk with no machine attached is a candidate for review. Ask the owner, or check the audit log for its last use.
Snapshot, then delete
If nobody claims a disk, snapshot it first as insurance, then delete it. Keep the snapshot for a defined period.
Review types and sizes
Look for premium disks holding cold data and for disks with huge unused space, and plan right-sizing steps.
Repeat monthly
Put the review in the calendar. A regular small clean-up beats an annual panic.
RAdvantages, Disadvantages and Trade-offs
An honest look at what you gain and what you give up.
Advantages
- Data survives machine stops, restarts and deletions.
- Built-in redundancy against hardware failure.
- Online resizing without downtime.
- Easy snapshots, schedules and clones.
- Detach and reattach to another machine in the same zone.
- Encrypted at rest by default, with key options.
- Regional option for zone-level protection.
- Works smoothly with Compute Engine and GKE.
Disadvantages
- Network hop means higher latency than Local SSD.
- Speed is tied to size and to the machine type.
- Zonal disks are tied to one zone.
- Cannot be shrunk in place.
- You pay for provisioned size, not used size.
- Normal disks cannot be shared for writing between machines.
- Newer machine families may favour Hyperdisk.
The big trade-offs in plain words
Durability against speed. Local SSD is faster because it is inside the host, but it gives up the safety of network storage. Persistent Disk accepts a small delay in exchange for data that outlives its machine.
Protection against price. Regional disks, frequent snapshots and cross-region copies all cost money. Spending should follow the value of the data. A cache can live on a cheap disk with no backups. A customer database deserves layers.
Simplicity against flexibility. Persistent Disk is easy to understand, but its speed rules tie performance to size. Hyperdisk gives more freedom to tune, and with it, more settings to understand.
Persistent Disk is like renting a safe storage unit in a secure building with a guard and cameras. It is a little further than your garage, and it has a monthly fee, but it survives a fire in your house. Local SSD is your own garage: closer and faster, but exposed to everything that happens at home.
SPersistent Disk vs Other Storage Options
Google Cloud offers several storage products. Knowing the neighbours helps you pick the right home for each kind of data.
Persistent Disk
Durable network block storage for VMs and containers. Speed tied mostly to size and machine type.
Hyperdisk
Newer network block storage where capacity, operations and throughput are set separately. Suits demanding and predictable workloads.
Local SSD
Very fast, physically attached, temporary storage for scratch data and caches.
Filestore
A managed shared file server for many machines that need a common folder.
Cloud Storage
Highly durable object storage for files, media, backups and data lakes, accessed over the web.
flowchart TD
Q1{"Is the data only scratch or cache that can be rebuilt?"}
Q1 -- "Yes" --> LS["Local SSD"]
Q1 -- "No" --> Q2{"Do many machines need to write to the same files?"}
Q2 -- "Yes" --> FS["Filestore"]
Q2 -- "No" --> Q3{"Are they large files or media served over the web?"}
Q3 -- "Yes" --> GCS["Cloud Storage"]
Q3 -- "No" --> Q4{"Need to tune IOPS and throughput on their own?"}
Q4 -- "Yes" --> HD["Hyperdisk"]
Q4 -- "No" --> PD["Persistent Disk"]
Comparing the options
| Topic | Persistent Disk | Local SSD | Filestore | Cloud Storage |
|---|---|---|---|---|
| Storage type | Block | Block | File (shared) | Object |
| Survives VM deletion | Yes | No | Yes | Yes |
| Speed | Good to very good | Fastest | Good | Fine for large objects, not for tiny random writes |
| Shared by many writers | Not by default | No | Yes | Yes, through the web interface |
| Typical use | Boot and data disks, databases | Caches, temporary data | Shared folders, content stores | Media, backups, archives, analytics |
The most common beginner mistake is using a disk as a place to store huge media libraries that many services download. That job fits Cloud Storage far better, since it scales without limit, costs less per gigabyte and is reachable from anywhere. Keep disks for data that needs the behaviour of a real drive, such as database files and operating systems.
Choosing storage is like choosing where to keep things at home. Your desk drawer is Local SSD, quick but small. The family cupboard is Persistent Disk, organised and reliable. A shared notice board in the hall is Filestore. A big rented warehouse across town is Cloud Storage.
TDesign Patterns That Fit Persistent Disk
A pattern is a proven recipe for a common problem. These five work especially well with disks.
Separate OS and data
Keep the operating system on the boot disk and your application data on a different data disk. You can rebuild the machine from a clean image and simply reattach the data disk.
One purpose per disk
Give database files, logs and backups their own disks. They have different speed needs, different growth rates and different backup rules, and separating them stops one from starving the others.
Golden image plus data snapshot
Build machines from a tested image and restore data from a recent snapshot. New environments appear in minutes, and the process doubles as a practice restore.
Replicate at two levels
Use the database’s own replication for fast failover, and a regional disk or snapshots for the layer beneath. Protection at both levels is stronger than at either one alone.
Cache in memory and on Local SSD
Keep hot data in memory or on Local SSD, and let Persistent Disk be the safe source of truth. Reads become fast, and writes remain durable.
The golden image pattern is like a restaurant franchise with a standard kitchen layout and a recipe book. Opening a new branch is fast because the setup is identical, and the daily ingredients (data) arrive from the central supplier.
The write-ahead log pattern
Many databases write every change first to a sequential log and later apply it to their main data files. Sequential writes are fast even on modest disks. Putting the log on its own fast disk can sharply improve commit speed, while the large data files sit on a cheaper, larger disk. This is a very common arrangement for relational databases on Compute Engine.
The ephemeral compute pattern
Treat virtual machines as disposable and disks as precious. When you need an upgrade, build a new machine from an image, attach the existing data disk, and delete the old machine. Because the data never moved, the upgrade is quick and the rollback is simple: reattach the disk to the old machine design.
UAnti-patterns to Avoid
An anti-pattern is a habit that looks sensible at first and causes pain later.
What it looks like
The team believes the disk is already “replicated”, so no snapshots are taken.
Why it hurts
Replication protects against hardware failure, not against deletion, corruption or mistakes. One wrong command and the data is gone from every copy.
Better approach
Attach a snapshot schedule to every disk that holds data you care about, and practise restoring.
What it looks like
Operating system, database, logs and backups all share a single boot disk.
Why it hurts
A runaway log file fills the disk and crashes the database. You cannot tune or protect each kind of data differently, and rebuilding the machine means touching the data.
Better approach
Use separate disks for the operating system, data, logs and backups, each sized and protected for its role.
What it looks like
Terabytes of old archives sit on a premium SSD disk because “it was the default”.
Why it hurts
You pay a high per-gigabyte price for speed that nobody uses, month after month.
Better approach
Move cold data to Standard disks or Cloud Storage and keep premium disks for hot data.
What it looks like
Two machines are given read-write access to the same ordinary file system to “share files”.
Why it hurts
Each machine keeps its own picture of the file system. They overwrite each other and corrupt metadata, often silently, until a crash reveals it.
Better approach
Use Filestore for shared folders, read-only attach for static data, or a cluster-aware file system if you truly need multi-writer.
What it looks like
Machines are deleted, but their data disks remain with no owner and no label.
Why it hurts
They quietly bill every month, and nobody dares delete them because nobody knows what they hold.
Better approach
Label disks with owner and purpose, review unattached disks monthly, and snapshot before deleting.
VBest Practices and Common Mistakes
A checklist to read before your first production launch.
Best practices
Begin with Balanced
It fits most workloads. Change type only when measurements prove a need.
Schedule snapshots
Attach schedules with retention to every important disk, and store copies in another location for critical data.
One purpose per disk
Keep operating system, data, logs and backups apart.
Benchmark before launch
Test disk and machine together with realistic loads, and note where throttling begins.
Watch space and throttling
Alert before disks fill up and when throttling persists.
Least privilege
Limit who can delete disks or share snapshots, and use customer-managed keys where rules require them.
Name and label everything
Owner, application and environment labels make cost reviews and clean-ups easy.
Test restores
Restore a snapshot to a test machine every quarter and time the process.
Common mistakes
Judging speed by disk type alone
A fast disk type on a tiny disk or a small machine still runs slowly. Check size and machine limits together.
Leaving auto-delete unchecked
A deleted machine takes its auto-delete disks with it. Confirm the setting for every disk that holds valuable data.
Formatting a disk that already has data
The format step on an existing disk wipes it. Confirm that a disk is new before formatting.
Ignoring a nearly full disk
Applications fail in strange ways at one hundred percent. Alert early and grow in time.
Trusting a backup that was never restored
Many teams discover broken backups only during an emergency. Practise the restore.
Mounting by device name
Device names can change between restarts. Use unique identifiers so the right disk lands on the right folder every time.
Write a short storage checklist covering type, size, zone, snapshot schedule, alerts, labels and restore steps. Review it for each new system, like a pilot reviewing a checklist before each flight.
WReal-World and Industry Examples
How teams typically use Persistent Disk in production.
Specific company architectures change over time and are rarely published in detail, so the following examples describe common patterns seen across the industry rather than any one named company. They show how the ideas in this guide combine in practice.
Self-managed relational databases
Many teams run PostgreSQL or MySQL on Compute Engine when they need settings that a managed service does not allow. A typical layout uses a small Balanced boot disk, a larger SSD data disk for table files, and a separate disk for the write-ahead log. Snapshots run every few hours, and a replica machine in another zone keeps a copy through the database’s own replication. The disk provides durability, and the database provides fast failover.
Search and analytics clusters
Engines such as Elasticsearch and distributed databases such as Cassandra spread data over many machines and keep several copies of it themselves. Each machine uses its own Persistent Disk, usually SSD or Balanced. Because the software already replicates data, teams often choose zonal disks and size them for speed and for the amount of data per machine, rather than paying for regional disks.
Stateful services on GKE
Message brokers, small databases and queue systems on Kubernetes use persistent volume claims backed by Persistent Disk. A StorageClass defines the disk type, and regional disks are chosen for the services where a zone outage must not stop work. Snapshots through the Kubernetes interface support backup and cloning for test environments.
Windows and enterprise applications
Companies moving legacy applications into the cloud often run Windows servers with file shares, licensing services and line-of-business software. Persistent Disk gives these applications the familiar behaviour of a local drive, while snapshots and machine images make backup and cloning easier than on traditional hardware.
Build servers and developer environments
Continuous integration systems use disks created from a prepared image so every build machine starts identical. Disks may be thrown away after use, or reused with cached dependencies to speed builds. The ability to clone a disk from a snapshot in seconds makes new environments cheap to create.
Managed databases beneath the surface
Google’s managed database services rely on the same kind of durable network block storage, adding automated backups and failover on top. Teams who need less control and less operational work often choose a managed service, while those who need custom software or special tuning use Persistent Disk directly.
In every pattern, the disk keeps the data safe, and something above it provides intelligence: database replication, Kubernetes scheduling or snapshot automation. Persistent Disk is the foundation, not the whole building.
XMoving and Migrating Disks
Disks are tied to a zone, but your needs are not. Here is how data travels.
Because a zonal disk lives in one zone, moving it to another zone, another region or another project always involves a copy. The cleanest tool for this is the snapshot, since snapshots are not tied to a zone and can create disks anywhere.
Moving a disk is like moving a piece of furniture to a house in another city. You cannot carry it through the wall. You photograph it, measure it and build an identical copy at the new house, then remove the original once you are sure the copy is perfect.
Moving between zones, regions or projects
Stop writes
Stop the application, or pause writes, so the copy is consistent. Unmount the disk if possible.
Take a snapshot
Snapshot the disk. Choose a snapshot storage location that suits where you plan to restore.
Create the new disk
Create a disk from the snapshot in the target zone, region or project, choosing the new type or size if you wish.
Attach and verify
Attach it to the new machine, mount it, and check the data and the application before sending real traffic.
Keep the old disk for a while
Retain the original for a safe period. Delete it only once the new setup has been proven.
Changing disk families
Newer machine families may require or prefer Hyperdisk. When you upgrade a machine, check its supported disk types first. Often the move follows the same path: snapshot the old disk, create a new disk of the new family from it, and attach it to the new machine. Test performance carefully, because the speed rules of the new family can differ from the old rules.
Bringing data from outside Google Cloud
To bring an on-premises server’s disks to the cloud, you can import a disk image through Google’s migration tools, or you can create a fresh disk and copy files over a network link. For very large data, offline transfer devices may beat the internet. Plan the cut-over carefully: copy the bulk data early, then run a short final sync while the application is paused.
Keeping current
Disk types, limits and machine support change as Google updates its products. Make it a habit to read the release notes a few times a year, review the supported disk list for the machine types you use, and re-check your performance assumptions when you resize or change machines.
Practise the move in a test project with a copy of real data. Time each step. The rehearsal tells you how long the real move will take and reveals problems while there is still room to fix them calmly.
YFrequently Asked Questions
Quick answers to the questions beginners ask most often.
ZSummary and Key Takeaways
If you remember only one page of this guide, make it this one.
Persistent Disk is Google Cloud’s durable network block storage. It keeps your data safe from machine stops and hardware failures, grows while running, and plugs easily into Compute Engine and Kubernetes. Speed depends on the disk type, its size and the machine it is attached to. Safety depends on snapshots, access control and practised recovery, not on replication alone. Cost follows provisioned size, so right-sizing, correct types and regular clean-ups matter.
Key Takeaways
- Persistent means separate: the disk lives apart from the virtual machine, so data survives stops, restarts and deletions, subject to the auto-delete setting.
- Pick the type by workload: Standard for cold bulk data, Balanced for most work, SSD and beyond for demanding databases, and Local SSD only for rebuildable scratch data.
- Speed has three limits: the disk, the machine and your software all matter, and the lowest limit wins. Watch throttling metrics.
- Replication is not backup: use snapshot schedules and practise restores, and use regional disks for zone-level protection where downtime is costly.
- Do not share ordinary disks for writing: use read-only attach, Filestore, Cloud Storage or cluster-aware setups.
- Control cost and access: you pay for provisioned size, so label, review orphans and set retention, and apply least privilege to disks and snapshots.
- Keep current: disk types and machine support change, so check the official documentation before every major design and migration.