Data Source: Mount archives before backup #1273
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#1273
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'd like to do and why
Hi all,
I run borgmatic on Proxmox Servers, with the intention of efficently backup up the guest snapshops.
Proxmox usually places backups of the guests as .tar (or similar) in /var/lib/vz/dump, one tar per backup.
Even if leaving the archives uncompressed and tweaking the chunker_params, it is not really efficent in deduplicating the content.
This would be probably better if it would be possible to backup the tar "content" file-based, instead of the complete tar file as a single file.
Therefore I'd like to suggest an option to add a "archive-unpack" as a data source, mounting the archive and backing up the content file by file. This should result (in my understanding) in much better deduplication.
Right now I'm experimenting with ratarmount (
find . -type f -name '*.tar' -exec ratarmount {} \;), although that is not too successful yet.I'm of course open for discussions, other ideas etc.
Other notes / implementation ideas
No response
Thanks for filing this. Here are my initial thoughts:
borgmatic create, it would untar each tarball—maybe into a temporary directory—and send the data to Borg (separately from any source files).vzdump(directly or indirectly), what do you think of instead having a native Proxmox/vzdump data source? That would allow borgmatic to potentially direct the dump. borgmatic still probably couldn't stream the dump directly to Borg, because storing a streamed tarball wouldn't actually solve your deduplication problem. But it could, for instance, callvzdump --stdoutand pipe that into a tar extract command to write the result into a temporary directory on the fly. And then Borg could be pointed at that temp directory.More ideas:
vzdumpat all, borgmatic could freeze the container, bind mount the rootfs, and point Borg at it directly. (Then unfreeze the container afterwards.) No intervening tarball to worry about that way.Hi,
thanks for the thoughts!
In my point of view, vzdump and "archive-unpack" would be both independently from each other a interesting idea. vzdump directly obviously would avoid a "middle step", while being tight more direct to proxmox, thats why I came up with the tar idea which could fit more use cases.
Regarding the restore, for all ideas (including the container freeze) it would be important that a "pve-compatible" backup file (ideal: a content-side identical archive) could be restored to import the VM in another hypervisor etc. (scenario: A hypervisor had a catastrophic failure, the VM is needed up and running in another one from the backup).
@margau wrote in #1273 (comment):
Sounds like you have a preference for the "archive-unpack" approach at this point?
Could you say a little more about this? Is the idea that, for the archive unpack approach for instance, a restore would reconstruct a "pve-compatible" tarball at the same path that it started at when it was originally backed up? And it would be "pve-compatible" by virtue of being the exact same data that was in there to begin with?
Hi,
I guess archive-unpack as the "most generic version" would be the most useful also for other usecases.
Regarding the restore path:
Proxmox just wants to have the tar file "somewhere", so it can be piped by hand using
pct restoreorqmrestore. An automated restore probably won't be that useful, as the use case with a "restore" would likely mean moving to another host etc.That means from my perspective:
Yes, archive-unpack would just place the archive in the same location as before the backup (especially as this is not proxmox-related, but generic). In my understanding, pve-compatible just means "the same tar archive contents" for the "archive-unpack" variant-
It could be a bit more interesting for the
vzdump --stdoutapproach (where it would also need an archive which could be restored by the commands above, but for me it is not clear "where" that would be).Got it, thank you. That's helpful. Okay, here's what I'm thinking for the archive-unpack in terms of configuration UX. Something like:
Only
nameandpathwould be required. The implicit restore path would default topathunlessrestore_pathoverrides it.Let me know if you have any feedback.