在偶尔完整备份之前删除增量快照 Google Cloud Compute Engine

Deleting incremental snapshots before occasional full backup Google Cloud Compute Engine

关于 Google Cloud Compute Engine 上的快照,我有一些无法在文档中找到答案的问题:

  1. 我们的一些磁盘确实有两个小时的频率。文档说,在未定义的时间,会捕获磁盘的完整映像。如果我不需要恢复最新完整映像之前的任何内容,这是否意味着可以删除新完整映像之前的所有快照?

  2. 如果是这样,我如何识别可以删除的快照?

  3. 或者:有没有办法自动完成这个任务(例如,“删除最新的完整图像之后所有先前的增量图像”?)

让我为您提供一些可以回答您问题的文档链接:

  1. 根据文档 Working with persistent disk snapshots:

Compute Engine uses incremental snapshots so that each snapshot contains only the data that has changed since the previous snapshot.

另一方面,正如 @Peter Sonntag 所承认的那样,根据文档 Use existing snapshots as a baseline for subsequent snapshots:

Important: Snapshots are incremental by default to avoid billing you for redundant data, to minimize use of storage space, and to decrease snapshot creation latency. However, to ensure the reliability of snapshot history, a snapshot might occasionally capture a full image of the disk.

  1. 根据文档 Snapshot deletion:

When you delete a snapshot, Compute Engine immediately marks the snapshot as DELETED in the system. If the snapshot has no dependent snapshots, it is deleted outright. However, if the snapshot does have dependent snapshots:

  1. Any data that is required for restoring other snapshots is moved into the next snapshot, increasing its size.
  2. Any data that is not required for restoring other snapshots is deleted. This lowers the total size of all your snapshots.
  3. The next snapshot no longer references the snapshot marked for deletion, and instead references the snapshot before it.
  1. 要自动删除您的快照,可以使用 Snapshot retention policy:

A snapshot retention policy defines how long you want to keep your snapshots.

If you choose to set up a snapshot retention policy, you must do so as part of your snapshot schedule.