How to backup KVM virtual machines

Case #

You have a KVM-based virtualization solution and you need to create a backup and restore plan for your KVM virtual machines. This article provides high level guidance on how to backup KVM virtual machines.

Solution #

Option 1: Use bash scripts and out-of-the-box KVM features #

KVM provides out-of-the-box shell commands to backup KVM virtual machines, which utilize the concept of VM snapshots and VM configuration files. Examples of a KVM backup and restore procedure can be found in the following articles:

You can generally also create Linux bash scripts to backup KVM virtual machines. This should automate the previously mentioned method where the KVM VM backup procedure is run one shell command at a time. One such example is the following script: https://nixlab.org/blog/backup-kvm-virtual-machines.

Option 2: Use third party backup software #

Linux Kernel-based Virtual Machine (KVM) virtualization platform providers, such as Redhat, provide their own backup and restore solution, which is bundled into their virtualization platform. A third party solution which supports the ovirt virtualization platform is Storware. Details on their backup solution are provided in the following link: https://storware.eu/solutions/virtual-machine-backup-and-recovery/ovirt-vm-backup-and-recovery/.

When looking for a backup solution for a custom KVM-based implementation, other party solutions can be used to backup KVM virtual machines. They do come at a certain cost but they provide numerous benefits. The most important benefit in a third party KVM backup solution is the overall management overhead. All backup and restore functionality can be managed by a single pane of glass using the third party tool's management console. Also the restoration procedure will be available with the peace of mind that the underlying code has been tested in production environments, which is far better than a in-house developed Linux Bash script. Last but not least, a third party solution can provide a supportability statement which covers all supported Linux distributions and KVM versions, while a custom-made bash script may run into issues when executed against a non-tested Linux distribution or kernel version.

Another noteworthy KVM virtual machine backup solution is Acronis Cyber Protect. Acronis Cyber Backup 12.5, Acronis Cyber Protect 15 and Acronis Cyber Protect Cloud support Kernel-based virtual machines (KVM). Backup of KVMs can be done by installing Agent inside the guest OS of the virtual machine (agentless backup is not available). When an agent is installed in the guest system, the backup and recovery operations are the same as with a physical machine. Backup and recovery of KVM machines can also be done with bootable media. The following KVM management tools have been tested by Acronis for Acronis Cyber Backup 12.5 and Acronis Cyber Protect compatibility:

  • Proxmox 
  • oVirt
  • QEMU

If you are using a different KVM management tool that is not on the list above, such as Cloudstack for example, it does not mean that it is not supported. The detection of KVM hypervisor by the backup agent installed inside VM is done by checking signatures of virtual hardware. These checks are independent of the type of KVM management tools used so the above list is intended to be used only as a quick reference. If you have Acronis Cyber Backup 12.5, it is highly recommended to upgrade to Acronis Cyber Protect 15.x as soon as possible.

Yet another interesting KVM virtual machine backup solution is virtnbdbackup. Virtnbdbackup is a backup utility for Libvirt / qemu / kvm supporting incremental and differential backups and instant recovery.

Powered by BetterDocs