You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
backup(nas): fix parent-checkpoint recreation for incremental after VM restart
Found while testing on a real libvirt 10.0.0 / qemu 8.2 host: an incremental backup
taken after the VM has been (re)started since the last backup FAILED. CloudStack
rebuilds the domain XML on every VM start, wiping libvirt's checkpoint registry, but
the dirty bitmap persists on the qcow2 (QEMU reloads it). The old code rebuilt a
minimal checkpoint XML and did a fresh 'checkpoint-create', which QEMU rejects with
'Bitmap already exists'; the qemu-img --remove fallback then can't run because the
running VM holds a write lock on the image.
Fix: register the parent with 'checkpoint-create --redefine' using the FULL
checkpoint XML (checkpoint-dumpxml output), which adopts the existing bitmap. A
minimal/synthesized XML is rejected by libvirt's checkpoint RNG schema, so the full
dump is required:
- dump-on-create: persist <bitmap>.checkpoint.xml next to each backup on the NAS
- on-recreate: redefine from the parent backup's saved XML; if it's missing (a
pre-fix backup) or redefine fails, fall back to a full so the chain restarts.
Verified on host xcbn-paix-host3 (libvirt 10.0.0): full->dirty->incremental, then
restart->redefine->incremental, all succeed; the previously-broken path now works.
0 commit comments