Are Google Compute Engine (GCE) persistent disk (PD) snapshots crash-consistent?

361 Views Asked by At

When I take a persistent disk snapshot, what are the consistency guarantees for this snapshot? I know it is not guaranteed to be "application consistent", but is it "crash consistent"? Or are there no consistency guarantees?

-- EDIT --

For comparison, Machine Images are guaranteed to be crash-consistent as is. However, the docs are silent on this issues with persistent disk snapshots.

2

There are 2 best solutions below

0
On BEST ANSWER

TL;DR: PD disk snapshots are crash consistent.

From the Compute Engine Persistent documentation:

When you take a snapshot of a persistent disk, you don't need to take any additional steps to make your snapshot crash consistent. In particular, you do not need to pause your workload.

2
On

As per the snapshot best practice you can create consistent snapshot from the persistent disk even if the application is writing data to those disks. If your app require strict consistency then you can follow the below steps to ensure consistent snapshot.

To prepare your persistent disk before you take a snapshot do the following:

1- Connect to your instance using SSH.

2- Run an app flush to disk. For example, MySQL has a FLUSH statement. Use whichever tool is available for your app.

3- Stop your apps from writing to your persistent disk.

4- Run sudo sync.