管理恢复点Manage recovery points

本文介绍虚拟机保留功能的工作原理。This article describes how retention works for virtual machines. 备份时会创建恢复点,可从恢复点执行还原操作。Whenever backups happen, recovery points are created from which restore operations can be carried out.

对于虚拟机,初始备份是完整备份,后续备份是增量备份。For virtual machines, the initial backup is a full backup and the subsequent backups are incremental backups.

恢复点和保留Recovery points and retention

计划的初始备份和增量备份Scheduled initial and incremental backup

接下来简单举例介绍虚拟机 V1,其数据磁盘由 4 个块组成:块 1、块 2、块 3 和块 4。Let’s take a simplified example of the virtual machine V1 with a data disk composed of four blocks: Block 1, Block 2, Block 3, and Block 4. 每个块的大小均为 16 KB。Each block is 16 KB in size.

具有 4 个块的虚拟机

步骤 1 - 初始备份: 初始备份是一个完整备份。Step 1 -Initial Backup: The initial backup is a full backup. 它充当应用后续增量备份的基线。It acts as a baseline on which subsequent incremental backups are applied. 假设有数据写入源虚拟机 (VM) 上的块 1 和块 2。Suppose there's data written into Block 1 and Block 2 on the source VM. 该数据将作为 D1 和 D2 复制到恢复服务保管库存储中。The same data will be replicated as D1 and D2 on the Recovery Services vault storage.

初始备份已复制

步骤 2 - 增量备份 1: 假设有新数据添加到了 VM 的块 3。Step 2 -Incremental backup 1: Consider there's new data added to block 3 of the VM. 该数据将在下次增量备份中被复制,只有更改的块存储为 D3。The same data will be replicated on the next incremental backup and only the block that is changed is stored as D3. 在每个步骤中,即使 1 KB 的块发生更改,都会将整个 16 KB 的块上传至恢复点。During each step, even if 1 KB of the block changes, the entire 16-KB block is uploaded in the recovery point.

第一次增量备份

步骤 3 - 增量备份 2: 现在假设源 VM 上的块 3 和块 2 有数据更改。Step 3 -Incremental backup 2: Now consider there are data changes on block 3 and block 2 on the source VM. 这些更改将在下次增量备份中复制为 D3' 和 D2'。These changes will be replicated on the next incremental backup as D3' and D2'.

第二次增量备份

按需备份On-demand backup

为 VM 设置保护后,可随时选择为该 VM 运行按需备份。You can choose to run an on-demand backup of a VM anytime after you set up protection on it.

  • 如果按需备份在计划的第一次初始备份之前触发,则它是完整备份。The on-demand backup will be a full backup if it's triggered before the first scheduled initial backup.
  • 如果按需备份在初始备份完成后触发,则它是增量备份。If the initial backup is complete, and an on-demand backup is triggered, then it's an incremental backup.
  • 为按需备份创建的恢复点的保留时间是你在触发备份时指定的保留期值。The retention time of recovery points created for an on-demand backup is the retention value that you specify when you trigger the backup.

存储成本Storage cost

为初始备份创建的恢复点包含具有数据的所有块。The recovery point created for the initial backup contains all the blocks that have the data. 后续增量恢复点仅包含数据发生更改的块。The subsequent incremental recovery points consist only of the blocks that have changed data. 存储成本与所有恢复点中的所有块的总和相对应。The storage costs correspond to the sum of all the blocks spanning across all the recovery points.

接下来使用上述示例来了解每个步骤后的存储成本:Let's use the above example to understand the storage cost after each step:

步骤Step 备份类型Backup type 已更改的块Blocks changed 存储类型Storage type
11 初始备份Initial backup 块 1、块 2Block 1, Block 2 对应于恢复点 1(D1+D2)Corresponding to recovery point 1(D1+D2)
22 增量备份 1Incremental Backup 1 块 3Block 3 对应于恢复点 1(D1+D2) + 恢复点 2(D3)Corresponding to recovery point 1(D1+D2) + recovery point 2(D3)
33 增量备份 2Incremental Backup 2 块 2、块 3Block 2, Block 3 对应于恢复点 1(D1+D2) + 恢复点 2(D3) + 恢复点 3(D2’+D3’)Corresponding to recovery point 1(D1+D2) + recovery point 2(D3) + recovery point 3(D2’+D3’)

恢复点有效期Recovery point expiration

如备份策略中指定的,每个恢复点都有保留期。Each recovery point has a retention duration, as specified in the backup policy. 系统会定期清理,所有过期的恢复点都会清理。The cleanup happens at regular intervals and all the recovery points that have expired are cleaned up.

恢复点过期后,将会被删除或合并。When the recovery point expires, it either gets deleted or merged.

情况 1:初始恢复点过期Case 1: Initial recovery point expires

初始恢复点过期时,它将与下一个增量恢复点合并。When the initial recovery point expires, it merges with the next incremental recovery point. 增量恢复点中覆盖的所有数据块都将被删除,其余的数据块将会合并。All the data blocks that are overwritten in the incremental recovery point get deleted and the rest are merged. 然后,增量备份成为初始完整备份。The incremental backup then becomes the initial full backup. 我们来看一个示例:Let’s review with an example:

  • 初始备份期间创建的恢复点 1 包含 VM 的完整备份。Recovery Point 1 that is created during the initial backup has the full backup of the VM.
  • 如果恢复点 1 过期,那么恢复点 2 为下一个完整备份 。When Recovery Point 1 expires, Recovery Point 2 is the next full backup.
  • 块 D1 与恢复点 2 合并,D2 将被删除,原因是块 2 中的数据在恢复点 2 中被覆盖 。Block D1 gets merged with Recovery Point 2 and D2 is deleted since the data in block 2 is overwritten in Recovery Point 2. 此更改被捕获为块 D2'。This change is captured as block D2'.
  • 块 D1 在连续恢复点中按保留原样,直到在下一次备份之前对它进行任何更改为止。Block D1 is retained in the consecutive recovery points as is, until there are any changes made to it before the next backup.

第一种情况

情况 2:中间的增量恢复点过期Case 2: In-between incremental recovery point expires

  • 如果恢复点 2 在恢复点 1 之前过期,则恢复点 2 中的数据与下一个可用恢复点(恢复点 3)合并 。If Recovery Point 2 expires before Recovery Point 1, the data from Recovery Point 2 is merged with the next available recovery point: Recovery Point 3. 因此,块 D3 与恢复点 3 合并。So block D3 is merged with Recovery Point 3.
  • 恢复点 1 仍是包含块 D1 和 D2 的完整备份。Recovery Point 1 is still the full backup with block D1 and D2.

第二种情况

事例 3:按需恢复点过期Case 3: On-demand recovery point expires

在此示例中,计划(每日备份)策略按计划运行,保留期为 n 天。In this example, a schedule (daily backup) policy is scheduled to run with n days retention period. 如果按需备份在计划的下一次备份之前的第 4 天触发,并且其保留期指定为 10 天,则它仍将是增量备份。If an on-demand backup is triggered on the fourth day before the next scheduled backup and its retention period is specified as 10 days, then it will still be an incremental backup. 恢复点(按需 RP1)将在恢复点 3 之后且恢复点 4 之前创建 。A recovery point (On-demand RP1) will be created after Recovery Point 3 and before Recovery Point 4. 第 14 天结束时,按需恢复点(按需 RP1)过期,并将与下一个可用恢复点合并。At the end of Day 14, the on-demand recovery point (On-demand RP1) gets expired, and it will be merged with the next available recovery point. 服务器上仍存在的数据块会合并,而已更改(覆盖或删除)的数据块将从过期的恢复点中删除。The data blocks that are still present on the server are merged, while the data blocks that changed (overwritten or deleted) are deleted from the expired recovery point.

第三种情况

策略更改对恢复点的影响Impact of policy change on recovery points

修改策略时,该策略将同时应用于新恢复点和现有恢复点。When a policy is modified, it's applied to both new and existing recovery points. 有关详细信息,请参阅策略更改对恢复点的影响For more information, see Impact of policy change on recovery points.

停止保护对恢复点的影响Impact of stop protection on recovery points

可通过两种方法来停止保护 VM:There are two ways to stop protecting a VM:

  • 停止保护并删除备份数据。Stop protection and delete backup data. 此选项将使所有将来的备份作业停止保护你的 VM 并删除所有恢复点。This option will stop all future backup jobs from protecting your VM and deletes all the recovery points. 如果启用了软删除,则已删除的数据将保留 14 天。If soft delete is enabled, the deleted data will be retained for 14 days. 处于软删除状态的项不会产生费用。Charges aren't incurred for items in soft-deleted state. 数据可在 14 天内取消删除。The data can be undeleted within the period of 14 days. 如果未启用软删除,数据将立即被清理,无法还原 VM,也无法使用“恢复备份”选项。If soft delete isn't enabled, the data will be immediately cleaned up and you won't be able to restore the VM or use the Resume backup option.
  • 停止保护并保留备份数据。Stop protection and retain backup data. 此选项会停止将来所有备份作业对 VM 的保护。This option will stop all future backup jobs from protecting your VM. 但是,Azure 备份服务将永久保留已备份的恢复点。However, the Azure Backup service will forever retain the recovery points that have been backed up. 你需要付费才能将恢复点保留在保管库中(有关详细信息,请参阅 Azure 备份定价)。You'll need to pay to keep the recovery points in the vault (see Azure Backup pricing for details). 如果需要,你将能够还原 VM。You'll be able to restore the VM if needed. 如果你决定恢复 VM 保护,可使用“恢复备份”选项。If you decide to resume VM protection, then you can use the Resume backup option. 恢复备份后,保留规则将应用于过期点。After resuming backup, retention rules will be applied to expiration points. 还可使用“删除备份数据”选项来删除已备份的数据。You can also delete the backed-up data using the Delete backup data option.

在不停止保护的情况下删除 VM 的影响Impact of deleting a VM without stop protection

在不停止保护的情况下删除 VM 会影响恢复点,此方案不可取。Deleting a VM without stop protection has impact on recovery points, and is an undesirable scenario. 理想情况是应在删除虚拟机之前停止备份。Ideally backups should be stopped before deleting the virtual machine. 因为该资源不存在,所以计划的备份会失败并显示 VMNotFoundV2 错误Since the resource doesn't exist, the scheduled backups will fail with the VMNotFoundV2 error. 恢复点将根据保留策略定期清理,但虚拟机的最后一个副本将永久保留,并将相应地进行计费。The recovery points will be cleaned periodically according to the retention policy, but the last copy of the virtual machine will remain forever and you'll be billed accordingly. 根据你的方案,有以下两个选项:Depending on your scenario, you have the following two options:

  • 选项 1:使用任何恢复点还原 VM。Option 1: Restore the VM using any of the recovery points. 如果要恢复已删除的 VM,请使用相同的名称并在相同的资源组中进行还原。If you want to recover the deleted VM, restore using the same name and in the same resource group. 如果将已还原的 VM 保护到相同的保管库,则现有恢复点会自动附加。If you protect the restored VM to the same vault, then the existing recovery points will automatically get attached.
  • 选项 2:转到恢复服务保管库,停止对删除数据的保护。Option 2: Go to the Recovery Services vault and stop protection with delete data.

处于软删除状态的项的恢复点过期的影响Impact of expired recovery points for items in soft deleted state

如果对恢复服务保管库启用了软删除,则过期的恢复点将保持软删除状态并且不会被清理。If soft delete is enabled for the recovery services vault, then the expired recovery point stays in soft deleted state and isn't cleaned up. 当恢复点处于软删除状态时,不会产生任何费用。No charges are incurred when a recovery point is in soft-deleted state.

变动率对备份性能的影响Impact of churn on backup performance

假设 VM 的总存储是 8 TB,变动率为 5%。Suppose the total storage of a VM is 8 TB and the churn is 5%. 则相应的增量备份存储将为 8 TB 的 5%,即 0.4 TB。Then the corresponding incremental backup storage will be 5% of 8 TB that is 0.4 TB. 变动率越高,后续增量备份的后端存储也就越高。Higher churn corresponds to higher backend storage for subsequent incremental backups. 变动率会影响备份性能。The churn impacts the backup performance. 变动率越高,备份过程越慢,后端存储的消耗也就越大。Higher the churn, the slower the backup process, and greater the consumption of backend storage.

若要了解变动率如何影响备份性能,请查看以下场景:To understand how churn impacts the backup performance, look at this scenario:

虚拟机Virtual machines VM1VM1 VM2VM2 VM3VM3
数据磁盘数Number of data disks 4(A1、A2、A3、A4)4 (A1, A2, A3, A4) 4(B1、B2、B3、B4)4(B1, B2, B3, B4) 4(C1、C2、C3、C4)4(C1, C2, C3, C4)
每个磁盘的大小Size of each disk 4 TB4 TB 4 TB4 TB 4 TB4 TB
备份数据变动量Backup data churn A1- 4 TBA1- 4 TB B1-1 TB;B2-1 TBB1-1 TB; B2-1 TB
B3-1 TB;B4-1 TBB3-1 TB; B4-1 TB
C1-2 TB;C4-2 TBC1-2 TB; C4-2 TB

备份性能的顺序将为 VM2>VM3>VM1。The backup performance will be in the order VM2>VM3>VM1. 这是因为变动的数据分布在不同磁盘上。The reason for this is the churned data is spread across the various disks. 由于磁盘的备份会并行进行,VM2 将表现出最佳性能。Since the backup of disks happens in parallel, VM2 will show the best performance.

后续步骤Next steps