Retention Policy for Deleted VMs
In some situations, after you configure and run backup jobs in Veeam Backup & Replication, you may want to change something in the virtual infrastructure or in the backup strategy. For example, you may remove some VMs from the virtual infrastructure or move them to another location. You may also exclude some VMs from jobs that have already run for some time.
By default, when you remove a VM protected by Veeam Backup & Replication from the virtual infrastructure or exclude it from a job, backup files containing data for this VM still remain on the backup repository. To avoid keeping redundant data on disk, you can set retention policy for deleted VMs. In this case, Veeam Backup & Replication will remove data for VMs that are no longer processed by the backup job from the backup repository.
Retention policy for deleted VMs is set at the level of the backup job. You must enable the Remove deleted VMs data after <N> days option in backup job settings and specify the desired period of time for which data for deleted VMs must be retained on the backup repository.
Mind the following:
- You must use retention policy for deleted VMs wisely. It is strongly recommended that you set retention policy for deleted VMs to 3 days or more to prevent unwanted data loss.
- The Remove deleted VMs after N days option lets you control data of deleted or excluded VMs. In addition to it, Veeam Backup & Replication applies general retention policy rules to maintain the necessary number of restore points in the backup chain. For more information, see Retention Policy.
How Retention Policy for Deleted VMs Works
If retention policy for deleted VMs is set for a backup job, Veeam Backup & Replication performs the following actions:
- If all VMs in the job are processed with the Success status, at the end of the backup job session Veeam Backup & Replication gets a list of VMs in the backup.
- For every VM in the backup, Veeam Backup & Replication checks the configuration database and gets the date of the latest backup job session completed with the Success status.
- Veeam Backup & Replication checks if any VM in the backup meets the following conditions:
- There are no successful backups for the VM for the last N days.
- There are no corrupted backups for the VM for the last N days.
Where N is the number of days specified in the Remove deleted VMs data after N days setting.
- If both conditions are true for some VM, Veeam Backup & Replication removes data for this VM from the backup. When Veeam Backup & Replication removes data for deleted VMs, it does not free up space on the backup repository. It marks the space as available to be overwritten, and this space is overwritten during subsequent job sessions or the backup file compact operation.
Example 1
You create a backup job for 2 VMs and set the retention policy for deleted VMs to 5 days. The backup job runs for 7 times and processes VMs in the following way:
- VM 1 is successfully processed during all job sessions.
- VM 2 is successfully processed during the 1st and 2nd backup job sessions. Before the 3rd job session, VM 2 is excluded from the job and is not processed by subsequent job sessions.
During the 8th job session, Veeam Backup & Replication will remove data for VM 2 from backups on the backup repository since there are no successful and corrupted backups for VM 2 for the last 5 days.
Example 2
You create a backup job for 2 VMs and set the retention policy for deleted VMs to 5 days. The backup job runs for 7 times and processes VMs in the following way:
- VM 1 is successfully processed during all job sessions.
- VM 2 is successfully processed during the 1st and 2nd backup job sessions. Starting from the 3rd job session, VM 2 fails to be processed, for example, due power loss while VM data is transported.
During the 8th job session, Veeam Backup & Replication will not remove data for VM 2 from backups on the backup repository. Even though there are no successfully created backups for VM 2 for the last 5 days, Veeam Backup & Replication will detect that the configuration database contains information about corrupted backups for VM 2 for the last 5 days.
Limitations for Retention Policy for Deleted VMs
Retention policy for deleted VMs is applied to reverse incremental backup chains, forever forward incremental backup chains and forward incremental backup chains for which synthetic full backups with subsequent transform is enabled.
Related Topics