Borg Backup with Proxmox

Yes, you are right ;)
Maybe someone of the Proxmox staff can give as an approximate date for the first beta release for the new backup system.
 
This is a really cool project! Coincidentally I've been using Borg for a little while to backup my user data (NAS data) and was thinking about a way to also use it for storing snapshots, so your timing has been perfect!
A quick question though - "Proxmox server must be configured to use ZFS." I presume then it is no problem using it with LVM/ext4 clients?
 
A quick question though - "Proxmox server must be configured to use ZFS." I presume then it is no problem using it with LVM/ext4 clients?
What do you mean by "client"?

By "Proxmox sever" I mean the node where VM resides ("the hypervisor"). And the script is supposed to run on this node. And the vm must use local zfs storage on the node.
 
What do you mean by "client"?

I mean another Proxmox node with snapshots that needs to be moved to a central storage repo. Pre-Borg I would do this by scp, but some snapshots are hundreds of gigabytes, so I was wondering if it would make sense letting Borg take care of this with it's build-in checkpointing.
 
I mean another Proxmox node with snapshots that needs to be moved to a central storage repo. Pre-Borg I would do this by scp, but some snapshots are hundreds of gigabytes, so I was wondering if it would make sense letting Borg take care of this with it's build-in checkpointing.
Sorry, but I do not understand. :-(
It is even possible to store vm and its snapshots on two separate nodes? :-O
I have not used Proxmox in such configuration...

Anyway - the script makes backup of current vm, not backup of already-existing snapshots.
 
I love Borg Backup and its deduplication capabilities. So I sat down and wrote a script to automate saving Proxmox images directly to Borg repository:

Me too! I was about to roll my own borg solution but saw this. Thank you for taking the time to write and release it.

I had a quick question about mountpoints: if I use the form

proxborg <VMID>:

That will back up a QEMU/CT (using differing methods: image for VM, The Better Way™ for CT) and exclude all mp which do not have backup=1 explicitly set?

I believe this is the case from your very good documentation, but with backups I like to be doubly sure ;-P

Cheers!
 
proxborg <VMID>:
That will back up a QEMU/CT (using differing methods: image for VM, The Better Way™ for CT) and exclude all mp which do not have backup=1 explicitly set?
Yes. If yoy want to include all mp's, do this: proxborg <VMID>:!

I believe this is the case from your very good documentation, but with backups I like to be doubly sure ;-P
Test it! With backups to not trust an unknown guy in Internet. :)
I can only tell that the script works for me and nothing more. (Have you read eula? No warranty. Test, test, test!)
 
Yes. If yoy want to include all mp's, do this: proxborg <VMID>:!

Thanks for the confirmation :) I want to exclude them because they're remotely mounted sshfs dirs.

Test it! With backups to not trust an unknown guy in Internet. :)
I can only tell that the script works for me and nothing more. (Have you read eula? No warranty. Test, test, test!)

Oh, absolutely I will be testing this. Second rule of backups, right? [1] "If it's not tested and confirmed you can restore from it, it's not a backup".

Cheers again!

---

[1]: The first rule is of course: "You have backups, right?"
 
And the vm must use local zfs storage on the node.

Strangely, despite setting up proxmox on ZFS I cannot snapshot. The VM's root disk is on local-zfs storage, yet I am told 'snapshot feature is not available'.

If I try to add storage, the only storage type for which 'backups (vzdump)' are available is the dir type, on which snapshots are not available.

I might create a new thread about this, but figured I'd ask here first as this is the context in which I ran into the issue!

---
Root disk:

lmsprox1.jpg

Snapshots:

lmsprox2.jpg

Storage view:

lmsprox3.jpg
 
Arrghhh... Right... In order to make backup-via-snapshot you must be able to make snapshot in the first place. :)

It will most likely not work with sshfs dirs. Actually it will not work with any dir mount, because raw dir mount does not support snapshots.

Idea: Try to remove ssh mounts from container config and mount these ssh dirs manually inside the container.
 
It will most likely not work with sshfs dirs. Actually it will not work with any dir mount, because raw dir mount does not support snapshots.

Idea: Try to remove ssh mounts from container config and mount these ssh dirs manually inside the container.

Oh dear. I am using external mp for the sshfs mounts because there were issues mounting them from inside a container- relating to it being an unprivileged CT, I think.

As I recall the suggested solution was to mount them externally and pass as mp. I'm not sure of the reference but see this thread, eg:

Using fuse inside the container is problematic as fuse and the kernel freezer mechanism don't work together. If you really absolutely need to use fuse mounts inside a container, don't try to use snapshot backups or lxc-freeze on those containers, or you will end up with hanging containers. A possible alternative would be to establish the fuse mount on the host, and then bind mount it into the container with an mpX entry in the container config, but this is not well tested (feedback welcome, as always!).

I might ask a separate question on best practices for remote mount that will work with snapshotting, and include a link to discussion here. It might not be something easily doable due to consistency etc but I might as well ask!
 
You may still make manual snapshot of rootfs (zfs snapshot) and send it to borg repository, but my script will not help you with it. You have to script it yourself... :-(
 
You may still make manual snapshot of rootfs (zfs snapshot) and send it to borg repository, but my script will not help you with it. You have to script it yourself... :-(

Aye, zfs snapshots seem to work, though haven't actually tested them. I'll figure something out!

Thanks again :)
 
Actually you may use my script... I forgot I implemented arbitrary dataset dump. :) Just use proxborg /rpool/data/container/rootfs.
Note that this way lxc config will not be dumped. Make sure to back it up separately.
 
I have written another script (VZBorg), which uses BorgBackup. It is not a replacement for the proxmox backup server, but is very flexible and suitable in many situations, specially if you have few resources. It lets you easily backup, restore, delete, list and purge or prune your local or remote backups. It can even work with services like BorgBase and rsync.net. If you want to give it a try, you can find it on github VzBorg.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!