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.
 

rcd

Member
Jul 12, 2019
109
5
18
58
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?
 

michabbs

New Member
May 5, 2020
27
4
3
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.
 

rcd

Member
Jul 12, 2019
109
5
18
58
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.
 

michabbs

New Member
May 5, 2020
27
4
3
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.
 

bertieb

New Member
Jul 1, 2020
5
0
1
bertieb.org
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!
 

michabbs

New Member
May 5, 2020
27
4
3
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!)
 

bertieb

New Member
Jul 1, 2020
5
0
1
bertieb.org
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?"
 

bertieb

New Member
Jul 1, 2020
5
0
1
bertieb.org
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
 

michabbs

New Member
May 5, 2020
27
4
3
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.
 

bertieb

New Member
Jul 1, 2020
5
0
1
bertieb.org
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!
 

michabbs

New Member
May 5, 2020
27
4
3
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... :-(
 

bertieb

New Member
Jul 1, 2020
5
0
1
bertieb.org
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 :)
 

michabbs

New Member
May 5, 2020
27
4
3
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!