1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

feat(vmbackups): restore, delete, retention, check and import know chains

An incremental backup is restored by copying its chain flat: every base's
disk file is checked first, as the backup's own, and a chain whose base's
row is gone is refused. A backup that a living backup builds on is not
deleted, by hand or by retention: retention deletes a chain only once all
of it is beyond keep, newest first; a failed backup holds no base. The
target check marks a backup missing when a base's file is gone. Reading a
target links each incremental backup to its base, read first, and leaves
one without its base unread. Restoring over the VM forgets its
checkpoints: its disks are replaced, and the next backup is full.
This commit is contained in:
catborise 2026-11-17 17:03:45 +03:00
parent 72e270a87e
commit d856ccca68
12 changed files with 555 additions and 391 deletions

View file

@ -165,6 +165,11 @@ class RestoreOverTests(TransactionTestCase):
self.assertTrue(op.intent["switching"])
self.assertNotIn("/pool/vm1.qcow2", self.removed) # the old volume stays
def test_the_chain_ends(self):
self.run_job(self.submit())
# its disks are replaced: their bitmaps are not the VM's any more
self.proxy.drop_checkpoint_metadata.assert_called_once_with()
def test_the_tpm_state_is_replaced(self):
self.with_tpm()
self.run_job(self.submit())