dguerri / LibVirtKvm-scripts

Libvirt/KVM scripts - online forward incremental backup for libvirt/KVM virtual machines
GNU General Public License v3.0
72 stars 25 forks source link

Remove rebasing step in backup proceedure? #8

Closed AJRepo closed 9 years ago

AJRepo commented 9 years ago

Thanks again for a nice program. If I've read the code right, I see that there is a rebasing of the backing files in the backup directory which stores the full path to that source in the backup directory.

So you currently have

   new_backing_file="$BACKUP_DIRECTORY/$(basename $backing_file)"
...
   new_parent_backing_file=$BACKUP_DIRECTORY/$(basename $parent_backing_file)
...
   command_output=$($QEMU_IMG rebase -u -b "$new_parent_backing_file" "$new_backing_file")

I think that would make sense if you ran the VM in the backup directory, but in the case of a disaster recovery (DR) you'd put the backup files back in their original location, not run from the backup directory (which might potentially cause an issue anyway as this script would then be backing up the VM from and to the same directory).

So I think it might make more sense to not rebase the backup files. What do you think?

dguerri commented 9 years ago

Hi @AJRepo. That's a good point. Originally, I wanted to keep backup files linked as I wanted to consolidate them before restoring them. The restoring part/script has never been implemented, tho... So it's now pointless.

AJRepo commented 9 years ago

Cool. I submitted commit 2e33677249998eb5eae2a53cbbea1782edaf9207 to remove that command. I'll do a pull request in a bit.

AJRepo commented 9 years ago

In looking at restore procedures I found libvirt ( http://wiki.apparmor.net/index.php/Libvirt ) changes /etc/apparmor.d/libvirt/libvirt-DOMID.files to deny writes to the backing file and updates apparmor to only allow writes to the current disk image. So a restore under a system that uses apparmor would need to keep the file naming and structure as-as, or modify the apparmor files. If it's ok, I'll play around with some restore and consolidation tests and let you know what I find, but you can close this issue.

dguerri commented 9 years ago

That'd be great. Thanks @AJRepo .