Help Center
Choose product document...
Veeam Backup & Replication 9.5
User Guide for Microsoft Hyper-V

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.

Retention Policy for Deleted VMs 

How Retention Policy for Deleted VMs Works

If you enable retention policy for deleted VMs in backup job settings, Veeam Backup & Replication performs the following actions:

  1. 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.
  2. 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.
  3. 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.

  1. 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.

Retention Policy for Deleted VMs 

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.

Retention Policy for Deleted VMs 

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.
  • [For vCD backup jobs] Retention policy for deleted VMs is applied only if a backup job stops backing up the entire vApp. If the backup job stops backing up VMs in the vApp, retention policy for deleted VMs is not applied.

Related Topics

Creating Backup Jobs

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation