OverviewDeploymentManagementOperationReference

Setting retention policy

Set the retention policy for restore points. The retention policy only applies to the automatically created restore points. Manually created restore points are retained permanently.

Parameter Description
Keep by time Keep the restore points created during the last n days.
Keep by quantity Keep the last n restore points.
Keep permanently Keep the restore points permanently.

Note:

The backup service uses a combination of full and incremental backups. After each full backup, subsequent incremental backups are performed based on the previous backup. Recovering a virtual machine requires the selected restore point and all the restore points it depends on, including full and incremental backups. Therefore, to ensure successful virtual machine recovery, the backup service retains both full and incremental restore points, even if the restore points exceed the specified limit of the retention policy. When all the earliest full backup restore points and the incremental backup restore points that depend on it exceed the retention policy, they will be deleted.

For example, the backup plan performs a full backup at 00:00 every day, an incremental backup every hour, and is set to retain the most recent 7 restore points. Assuming all backup jobs are successful, all 30 restore points generated from 00:00 the previous day to 05:00 the current day will be retained, totaling 30. After 06:00, all restore points of the previous day will be deleted, and the restore points generated from 00:00 and later on the current day will be retained, ensuring that the most recent 7 restore points are retained.