abbbi / virtnbdbackup

Backup utility for Libvirt / qemu / kvm supporting incremental and differential backups + instant recovery (agentless).
http://libvirtbackup.grinser.de/
GNU General Public License v3.0
330 stars 46 forks source link

After first offline backup the second fail with "does not contain full backup" #161

Closed slu-010101 closed 6 months ago

slu-010101 commented 6 months ago

Version used virtnbdbackup --version 2.0

Describe the bug Can't execute switch to auto incremental backup: specified target folder [/mnt/snapshot/2024_12/winABCDEF] does not contain full backup.

Expected behavior If the vm is offline during the first auto backup, the second backup should do nothing because there was no change. Or if it impossible to detect changes backup the complete disk again.

Hypervisor information: Debian 12.5 libvirt-daemon 9.0.0-4

Logfiles: Please attach generated logfiles relevant to the reported issue. virtnbdbackup.log virtnbdbackup_fail.log

abbbi commented 6 months ago

An Offline backup cannot be used as full backup because if virtual machine is offline no Checkpoint can be created using libvirt api. Checkpoints are mandatory for subsequent incremental or differential backups.

To actually be able to create a full backup, virtual machine must be online.

slu-010101 commented 6 months ago

But in this case should never start a backup with auto? And is the first backup healthy, even if the machine was offline?

abbbi commented 6 months ago

But in this case should never start a backup with auto? And is the first backup healthy, even if the machine was offline?

1) if virtual machine is offline and backup mode is "auto" it falls back to backup mode "copy": it at least creates a complete copy backup instead of doing nothing. The backup is healthy. No checkpoint is created because libvirt api refuses to create checkpoint for offline virtual machines.

2) if virtual machine is online and backup mode is "auto" and target directory is empty it can create an checkpoint and then proceeds with a full backup. The checkpoint will track any changes to virtual machine disks and subsequent incremental or differential backups are possible.

its possible to workaround this with pre scripts, check if VM is online if you want a full backup to be created

abbbi commented 6 months ago

See this issue for progress on that topic:

https://github.com/abbbi/virtnbdbackup/issues/164