project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Feature] zfs && ceph rbd : cross-cluster incremental replication

Open aderumier opened this issue 8 months ago • 9 comments

Hi,

Currently the cross-cluster replication seem to do basic full clone of snapshot. This is working with any storage, but it can't really work at scale with big vms.

For some storage like zfs or ceph, it's possible to do zfs->zfs or ceph rbd->cephrbd replication through incremental snapshot.

Proxmox already have a tool: pve-zsync for zfs sync across cluster https://pve.proxmox.com/wiki/PVE-zsync https://github.com/proxmox/pve-zsync/blob/master/pve-zsync

It's doing basically a "zfs send|zfs receive" through ssh between nodes + copy config

for ceph, it can be done with something like: "rbd export rbd/testimage-to-export - | ssh user@remotecluster rbd import rbd/testimage-to-import"

as I'm a proxmox contributor, I could also look to extend pve-zsync to support ceph rbd, as it's almost the same workflow.

(They are some plan on proxmox side to also add support for replication of qcow2 external snapshot in the future, but it's a little bit more complex to handle with the merge of snapshot chain)

aderumier avatar Mar 17 '26 01:03 aderumier

yip. there is also this: https://github.com/lephisto/crossover

but has some caveats, you have to make adjustments to which restorepoint you want to bring up, and there is no UI. config/schedule is via cron. Doing that and monitoring in pegaprox would be a massive feature win

odgeza avatar Mar 18 '26 05:03 odgeza

This project is also interesting https://github.com/whoschek/bzfs

focused on zfs replication, it's written in python, and already seem handle the scheduling in //

seem to be written by a proxmox user: https://forum.proxmox.com/threads/ann-bzfs-1-18-0-near-real-time-zfs-replication-tool-is-out.180811/

    * manage periodic ZFS snapshot creation, replication, pruning, and monitoring, across a fleet of N source hosts and M destination hosts, using the same single shared fleet-wide jobconfig script. Each of the M destination hosts receives replicas from (the same set of) N src hosts.
    * Monitor if snapshots are successfully taken on schedule, successfully replicated on schedule, and successfully pruned on schedule, across the entire fleet.
    * More powerful include/exclude filters for selecting what datasets and snapshots and properties to replicate.
    * Can be strict or told to be tolerant of runtime errors.
    * Has parametrizable retry logic
    * Can be used not just for backup, but also for low latency replication use cases```

aderumier avatar Mar 18 '26 07:03 aderumier

+1 Would really like this to be implemented. Especially something that is able to create multiple incremental replicas on a remote site. I managed to get something similar working with https://github.com/lephisto/crossover GUI integration would be ++

Pulsar846 avatar Mar 18 '26 08:03 Pulsar846

This project is also interesting https://github.com/whoschek/bzfs

focused on zfs replication, it's written in python, and already seem handle the scheduling in //

Hi guys, I'm the author of the bzfs ZFS replication CLI that was mentioned above. If you have any questions just shoot them over :-)

whoschek avatar Mar 18 '26 20:03 whoschek

This project is also interesting https://github.com/whoschek/bzfs focused on zfs replication, it's written in python, and already seem handle the scheduling in //

Hi guys, I'm the author of the bzfs ZFS replication CLI that was mentioned above. If you have any questions just shoot them over :-)

Ah great :) I wonder if it could be adapted to handle ceph rbd too ? the workflow is exactly the same than zfs send|zfs receive, but with rbd export|import. The more complex thing is the scheduling for me, and you seem to have handle it :) I'll try to take time to read your code next week.

aderumier avatar Mar 19 '26 10:03 aderumier

This project is also interesting https://github.com/whoschek/bzfs focused on zfs replication, it's written in python, and already seem handle the scheduling in //

Hi guys, I'm the author of the bzfs ZFS replication CLI that was mentioned above. If you have any questions just shoot them over :-)

Ah great :) I wonder if it could be adapted to handle ceph rbd too ? the workflow is exactly the same than zfs send|zfs receive, but with rbd export|import. The more complex thing is the scheduling for me, and you seem to have handle it :) I'll try to take time to read your code next week.

For ZFS replication you can invoke the bzfs CLI or alternatively embed bzfs as a Python library dependency and call bzfs_main.{bzfs|bzfs_jobrunner}.run_main().

Re Ceph: I don't really use Ceph and I'd rather have bzfs continue to be focused on excellent unambiguous ZFS functionality ("Do One Thing Well"). Having said that, the codebase is pretty straightforward and is structured such that you could probably directly reuse quite a bit of infra for Ceph purposes by calling the bzfs_main.util.* modules and sailing with that. All of the infra around scheduling, parallel tasks, parallel task trees, SSH command client, retries, etc is in that bzfs_main/util/ dir and is independently useful and isolated - nothing in that dir depends on ZFS or anything outside of that dir. If you run into bumps let me know.

whoschek avatar Mar 19 '26 19:03 whoschek

This project is also interesting https://github.com/whoschek/bzfs focused on zfs replication, it's written in python, and already seem handle the scheduling in //

Hi guys, I'm the author of the bzfs ZFS replication CLI that was mentioned above. If you have any questions just shoot them over :-)

Ah great :) I wonder if it could be adapted to handle ceph rbd too ? the workflow is exactly the same than zfs send|zfs receive, but with rbd export|import. The more complex thing is the scheduling for me, and you seem to have handle it :) I'll try to take time to read your code next week.

For ZFS replication you can invoke the bzfs CLI or alternatively embed bzfs as a Python library dependency and call bzfs_main.{bzfs|bzfs_jobrunner}.run_main().

Re Ceph: I don't really use Ceph and I'd rather have bzfs continue to be focused on excellent unambiguous ZFS functionality ("Do One Thing Well"). Having said that, the codebase is pretty straightforward and is structured such that you could probably directly reuse quite a bit of infra for Ceph purposes by calling the bzfs_main.util.* modules and sailing with that. All of the infra around scheduling, parallel tasks, parallel task trees, SSH command client, retries, etc is in that bzfs_main/util/ dir and is independently useful and isolated - nothing in that dir depends on ZFS or anything outside of that dir. If you run into bumps let me know.

ok thanks! The scheduling part is very interesting, because it's always complex to implement at scale, handle the errors/retries. I'll try to give it a try in coming weeks. (I'm a bit busy at work currently). note that ceph also have is own mirror daemon with snapshot send|receive, but it's more difficult to manage it a central way like you do.

I known that proxmox have plans to add this feature in pdm in the future, but no clear roadmap yet

aderumier avatar Mar 20 '26 09:03 aderumier

Hey @aderumier — this landed. There's now an incremental mode that ships just the delta each cycle instead of a full clone: RBD via export-diff | import-diff off an anchor snapshot, ZFS via send -i, byte-relayed between the two nodes (no direct node↔node link needed). Opt-in per replication job, and it falls back to the full clone when the disks aren't all rbd/zfs on both ends. It's on Testing now — would genuinely value your eyes on it if you get a moment.

opencollective.com/pegaprox if it's useful to you 🙏

— MK

mkellermann97 avatar Jul 25 '26 10:07 mkellermann97

This landed in v1.0 🎉

Cross-cluster replication now has an incremental path for ZFS (snapshot send/receive) and Ceph RBD (incremental diff export/import) over an SSH byte-relay, instead of full-cloning the snapshot every run — so it actually scales to big VMs, which was exactly your point.

Thanks a lot for the detailed write-up and the pointers to pve-zsync — that shaped the design. Closing as implemented; if you run into edge cases with the incremental engine (or want to talk RBD-diff specifics), please open a fresh issue. 🙏

mkellermann97 avatar Aug 09 '26 19:08 mkellermann97