Veeam Backup & Replication is industry leading backup software. While Veeam does not, as yet, have a software package specifically tailored for use with XenServer, it is possible to use it to backup and restore XenServer VMs.
AUTHOR: Ross Lagerwall
TARGET: Customers (Intermediate)
Veeam backup and restore software consists of 3 components (backup server, backup repository, backup proxy), all of which can be run on a single Windows VM. This suite of software can then be used to backup any number of Windows and Linux target VMs. When used with XenServer, Veeam cannot connect directly to the hypervisor. Instead, VMs need to be added either as a Windows or Linux machine. Veeam will then connect to the VM and install an agent which provides the snapshotting and changed block tracking facilities to do live backups.
The tests below were performed with the latest development version of XenServer 8 and the latest released version of Veeam (12.0.0).
Windows target VMs
The following Veeam operations were performed successfully on a Windows VM running on XenServer:
- Full backup of the VM, including all volumes.
- Incremental backup (using the default changed block tracking method)
- Full restore of all volumes in the VM, including the system volume. System volumes cannot be restored live. Instead, it requires generating a boot ISO and booting the VM from the ISO to perform the restore.
- Live in-place restore of a single (non-system) volume.
- Backup a directory in the VM instead of a full volume.
- Restore of individual files in the VM.
- Performing a VM backup with application-level awareness. For example, if the target VM is running SQL Server, Veeam will ensure that the SQL Server database is in a consistent state in the backup. It is also possible to directly restore the database from the backup.
- Exporting the backup as a VHD. The resulting VHD can be imported into XenServer, attached to a VM, and booted. This can be used as a way of replicating existing running VMs in your infrastructure.
Linux target VMs
The following Veeam operations were performed successfully on a CentOS 7 VM running on XenServer:
- Full backup of the VM, including all volumes.
- Incremental backup of the VM (using the Veeamsnap kernel module).
- Full restore of all volumes, including the system volume. System volumes cannot be restored live. Instead, it requires using a recovery ISO and booting the VM from the ISO to perform the restore.
- Backup a directory in the VM instead of a full volume.
- Restore of individual files in the VM.
- Exporting the backup as a VHD. The resulting VHD can be imported into XenServer, attached to a VM, and booted. This can be used as a way of replicating existing running VMs in your infrastructure. We did notice that sometimes filesystems needed to be fscked after performing this operation which we believe is an artifact of the way that Veeam takes the live snapshot of the mounted filesystem.
As of version Veeam 12.0.0, non-system volumes from Linux VMs cannot be restored using the Veeam management tool, instead they must be restored using the recovery ISO or the command-line. This is a Veeam limitation, not a XenServer limitation.
Warning: Before using Veeam with Linux VMs on XenServer, please note that due to a bug VMs may encounter disk corruption when a Veeam backup is performed unless one of the following conditions is met:
- The VM uses a Linux kernel based on 6.4 or newer, or it uses a kernel with the following change backported. Learn more
- The VM uses the Veeamsnap kernel module for snapshotting and changed block tracking. This is generally used with older Linux distros like CentOS 7. New Linux versions use the blksnap kernel module. You can find out which kernel module your distro uses here.
- The VM uses the blksnap kernel module for snapshotting and changed block tracking from Veeam Agent for Linux version 6.0.2.1173 which contains a fix for the disk corruption issue.
For more information on this issue, please see https://www.Veeam.com/kb4428
XenServer provides many features that may be used to create a backup solution (clone, snapshotting, changed block tracking, export as VHD, etc). Veeam is complementary to that and can be used with XenServer today to provide full backup and restore solution for users wanting a turnkey backup solution, the industry standard, or simply wanting to manage all their backups across different infrastructure in a single place.