Backups in ProxMox

linux-category-inverted

In Hyper-V, taking backups was, welll, not very pleasant.  It was fine if you had a dedicated backup solution, but for a small set of VM’s like I have, it require basically taking snapshots of each individual VM and exporting them.

Microsoft didn’t make the process very easy, but with a bit of PowerShell scripting I had a pretty good system in place that kept the VM’s down only for as long as it took to export the disk images.

ProxMox on the other hand has a built in VM backup system that looks like it will automate most of the things I had scripted.

However, the first thing that becomes a problem is that by default, ProxMox stores the backup images on the boot drive, which is only 80g in size.  I installed a 1TB SSD to host my VM’s so that math doesn’t work very well 😉

I had upgraded my main data drives a while ago from some 2TB HD’s to 6TB HD’s and those old drives have just been laying around, so I decided to add them to the host servers as backup space.

My first attempt to do this was to create a new LVM storage group add them to the ProxMox server as a new storage group, but it turns out that doesn’t work as you can’t use an LVM disk for backup.  Instead I had to simply create a ext4 file system on the disks and mount them to the ProxMox host server.  I found this article useful, with the exception that it’s a little old and suggests ext3 still.

Once the drive was mounted, going in to the ProxMox web interface, selecting Datacenter->Storage->Add->Directory brought up the standard dialog to add storage to the system.  One item to note is that since I have two nodes in my cluster, you have to connect to the node that has the local drive on it.

There some standard fields to fill in, like the ID, which I labeled “backups”, note that creating a directory store in ProxMox will assume it is available on all nodes, not just he current one.  Make sure to select the right content type, for me I only selected “VZDump backup files”, but you might want to also support other things like ISO images or container templates.

The other item to note is the “Max Backups” field, this sets the maximum number of backup images that are allowed on the disk for each VM.  Once this number is exceeded the old backup files will be removed automatically (at least if I’m reading the documentation correctly).  For me, I set this to 3.

The final step is then to setup a backup schedule.  To do this, select the host Datacenter->Backups->Add.

Since this is backing up to local storage, the first option “Node” should be set to the physical node your backing VM’s up from.  Then you can simply select your newly added backup storage, what time you want the backups to start and which VM’s to backup.  The rest of the options are straight forward and now you have a weekly backup of all your VM’s.

I also keep a copy of my backups offsite, which is easy to do as you can just sftp a copy of the backups from your /mnt/backups/dump directory and move them to a USB drive or other storage to take with you.

One last point, as mentioned above, my main file server has a 6tb drive, which of course can’t be backed up to a 2tb disk.  I have a separate set of backup disk for this and so I don’t won’t ProxMox to backup that volume.  Fortunately, if you go to [Your VM]->Hardware->[Disk you want to exclude]->Edit, you can select the “No Backup” checkbox and it will not be included in the ProxMox backups.

Avatar photo

Greg

Greg is the head cat at JumbleCat, with over 20 years of experience in the computer field, he has done everything from programming to hardware solutions. You can contact Greg via the contact form on the main menu above.

More Posts - Website

Avatar photo

Greg

Greg is the head cat at JumbleCat, with over 20 years of experience in the computer field, he has done everything from programming to hardware solutions. You can contact Greg via the contact form on the main menu above.

Leave a Reply