KVM Backup Solutions

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

IamSpartacus

Well-Known Member
Mar 14, 2016
2,515
650
113
Are there any decent backup solutions for VM's (in my hase .img disks) running on KVM?
 

Stephan

Well-Known Member
Apr 21, 2017
920
698
93
Germany
Last time I looked in January this year, there was nothing appealing. So I scripted away myself. Not for the faint of heart, 900 lines bash script, a handful of helper scripts, maybe 3-4 weeks debugging and exploring, soldering (not kidding).

Step 1 I basically tar up the host filesystems root+boot but without postgresql files and also not any VM qcow2 images and some other stuff.

Step 2 Snapshot VMs sequentially and atomically and copy off all virtual disks to backup place (in my case from SSD to a HDD RAID5). Commit snapshot before going to the next VM. Running VMs are undisturbed by the backup and operate without any downtime.

Step 3 Copy powered off VMs as they are, no snapshot like in step 2 necessary. In step 2 and 3 I will export through libvirt a XML definition file for each VM to aid in restoration should that become necessary.

Step 4 Backup of local postgresql using pg_basebackup and a checkpoint.

Step 5 Archive step 1-4 data using borg backup with zstd level 3 compression. Right now I have 1.83 TB of raw data compressed and deduplicated down to 174 GB. Borg keeps 25 archives right now with 7 daily, 4 weekly, 12 monthly and 5 yearly max. Integrity check of the archive is run every 30 days.

Step 6 Mail me any warnings or worse if they happened, including the current runs full log. Package maintainers on Arch Linux have a habit of breaking random packages.

Step 7 I have bareos tape backup (a bacula clone) running daily with quarterly fulls going to a LTO6 and incrementals going to a LTO5 drive. Since the drives are in my office I modded them using 2.5mm stereo plugs to connect the on-switch of the device potential free with a USB relais box. Reason: Noise. You can't power them on using a mains switch, those drives WANT their button pushed to actually turn on... bummer. So before every tape run a script will execute that turns on the correct drive, waits for it to boot up, loads a tape if present. After each run the tape is ejected and after some cooling off period the drive is turned off again.

Pretty much a boatload of trouble to get everything going. I think something like Xen Orchestra might be better than this kind of KVM bare metal work. Professionally I would just buy Veeam and VMware to do all this, but I wanted to see how far open source does reach in 2018. Quite far, but you need to be a Linux hacker to pull it off. Haven't published anything due to lack of time and out of fear of needing to support this afterwards, sorry.
 

MiniKnight

Well-Known Member
Mar 30, 2012
3,072
973
113
NYC
Proxmox VE makes basic backups easy.

Add a NFS share, map it to Proxmox, schedule VM backups and retention policies.

Proxmox can also do ZFS snapshot with send/ receive.

I've turned a low power Proxmox VE host into a NFS server.
 
  • Like
Reactions: gigatexal

IamSpartacus

Well-Known Member
Mar 14, 2016
2,515
650
113
Proxmox VE makes basic backups easy.

Add a NFS share, map it to Proxmox, schedule VM backups and retention policies.

Proxmox can also do ZFS snapshot with send/ receive.

I've turned a low power Proxmox VE host into a NFS server.
Are you saying that you can backup VMs from Proxmox VE that aren't actually running on said Proxmox host by simply mapping them via an NFS share?
 

MiniKnight

Well-Known Member
Mar 30, 2012
3,072
973
113
NYC
I think you can if they're on another Proxmox host in the cluster! I see your point, if you're running RHEL it doesn't help. It's a good reason to think about Proxmox.
 

IamSpartacus

Well-Known Member
Mar 14, 2016
2,515
650
113
I haven't looked at Proxmox in a few years. Is it possible to pass a USB flash drive through to a VM so that it's available pre-OS boot in Proxmox like you can in VMware?
 

Joel

Active Member
Jan 30, 2015
851
191
43
42
I haven't looked at Proxmox in a few years. Is it possible to pass a USB flash drive through to a VM so that it's available pre-OS boot in Proxmox like you can in VMware?
Yes. I wasn't able to configure the USB drive as a boot drive in the "options" panel, but I hit ESC at the bios splash screen and it showed up as an option. This was a Win10 thumb drive if it matters (probably UEFI).

Normally I find it easier to just keep the ISOs I'm interested in on the server and I can just pick what I want in the dropdown.
 

IamSpartacus

Well-Known Member
Mar 14, 2016
2,515
650
113
Yes. I wasn't able to configure the USB drive as a boot drive in the "options" panel, but I hit ESC at the bios splash screen and it showed up as an option. This was a Win10 thumb drive if it matters (probably UEFI).

Normally I find it easier to just keep the ISOs I'm interested in on the server and I can just pick what I want in the dropdown.
I'm just thinking about running on OS that runs off a USB (such as Unraid) inside of Proxmox. If what you've seen is correct, it should work.
 

mbosma

Member
Dec 4, 2018
76
58
18
It is also possible to mount the USB-stick virtually as a .img file.
The same method is used for running xpenology inside of Proxmox.
Code:
"args: -device 'piix3-usb-uhci,addr=0x18' -drive 'id=synoboot,file=/var/lib/vz/images/103/synoboot.img,if=none,format=raw' -device 'usb-storage,id=synoboot,drive=synoboot'"
Source