Repository navigation
Replies: 2 comments 2 replies
|
@zidz for your information, I am working on incremental backup of RBD volumes to NAS backup right now. |
2 replies
|
@zidz @weizhouapache Thats awesome work from both of you, exactly what i've been looking for. At the moment i'm solving the requirement for incremental backups based on Ceph snapshot-diffs using external scripts - which unfortunately have no integration with Cloudstack so far. So i am very excited about the work of both of you, thanks a lot! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
TL;DR
I built an incremental RBD backup provider for CloudStack (port to 4.23.0.0).
It uses Ceph RBD snapshots +
export-diff/import-diffso an incremental backupis ~32x smaller than the full, and a restore replays the full→incremental chain.
Full + incremental + restore are verified end-to-end through the management API
against a real Ceph/KVM host. This is a prototype for design feedback, not a
finished PR — I'd like input on two open questions below.
Motivation
The existing NAS backup provider copies whole disk images every time. On Ceph
RBD primary storage we can do far better: take an RBD snapshot per backup and
export only the diff since the previous snapshot. Backups become small and fast,
and a restore is
import(base) +import-diff(chain).Design
plugins/backup/rbdimplementingBackupProvider.rbd snap create+protect+export→<disk>.<vol>.rbd.export-diff --from-snap <parent>→<disk>.<vol>.<ts>.rbdiff.importbase +import-diffeach link, truncated at theselected backup (restoring an earlier backup lands on that point-in-time).
scripts/vm/hypervisor/kvm/rbdbackup.sh(called by the KVMagent wrappers, mirroring the NAS path).
What changed vs 4.23.0.0
plugins/backup/rbd/**(provider + tests + spring module),scripts/vm/hypervisor/kvm/rbdbackup.sh.core/.../backup/{Take,Delete,Restore}BackupCommand.java— added RBD fields(parent snap, base snap, rbd uri/snap, disk types). New
Commandfields only;rolling-upgrade safe (old agents ignore unknown fields).
kvm/.../Libvirt{Take,Delete,Restore}BackupCommandWrapper.java— routepure-RBD VMs to
rbdbackup.sh; NAS path unchanged (guarded branch).plugins/pom.xml+debian/rules— build & package the new module.Enabling it today
createBackupOfferingis currently hard-gated to the KBOSS provider, andthere's no
createBackupRepositoryAPI, so the offering + repository must becreated via DB for now:
backup.framework.enabled=true,backup.framework.provider.plugin=rbd,rbd.backup.incremental.enabled=truebackup_repository(NFS) and abackup_offering(provider=rbd),linked by
backup_offering.external_id = backup_repository.uuidFull step-by-step is in
plugins/backup/rbd/README.md.Verification (real Ceph/KVM host)
.rbdobject, ~5 GB.rbdiff, ~132 B.rbdiff, ~512 MBrestore-as-templateLimitations / known issues
restoreBackupresolves the VM from
backup.getVmId()). For a new, custom-named VM userestore-as-template→ register as template → deploy.plugins/pom.xml,debian/rules), so adefect there has global blast radius — see open question 2.
Open questions for the community
createBackupOfferingbe generalized beyond KBOSS soRBD (and other providers) can create offerings via API/UI, removing the manual
DB step? Or is there a preferred existing mechanism I missed?
provider be opt-in (profile/flag) to limit build/startup coupling?
Try it
Branch
feature/rbd-incremental-backup-4.23(6 commits on top of4.23.0.0): compare linkDocs:
plugins/backup/rbd/README.md.Feel free to get inspiration from, use full or parts of this implementation if anyone have use for it in any way.
All reactions