EideardVMR / unraid-easybackup

Snapshot for virtual machines and backups for them, as well as for Docker
GNU General Public License v3.0
7 stars 1 forks source link

Unable to backup VMs with attached physical devices #12

Open GraphicHealer opened 1 month ago

GraphicHealer commented 1 month ago

Hello!

When I try to run a bakup on a VM that has a physically mounted drive, I am unable to initiate a backup.

This is my error log: EasyBackup.log

I did get it sortof working after messing with it, but I had to edit the following line: https://github.com/EideardVMR/unraid-easybackup/blob/434dd0e07cde79babe5d416ca7b2d9f409154eeb/src/includes/KVM.class.php#L283

to include this:

--diskspec hdd,snapshot=no

So that it would skip the drive labled hdd,

And added a line below this line: https://github.com/EideardVMR/unraid-easybackup/blob/434dd0e07cde79babe5d416ca7b2d9f409154eeb/src/includes/KVM.class.php#L112

containing this:

if($disks[$i]->attributes()['type'] != 'file') { continue; }

so that it would skip drives that are not a "file" type.

If there was a way to properly disable backup for individual HDDs on each VM, that would be great. Prehaps something like how the Docker page in this plugin works?

Thanks!

GraphicHealer commented 1 month ago

Honestly, one thought I had after looking through your code, is to create a --diskspec flag for each disk on the VM, and choose to add snapshot=no or snapshot=yes depending on if the disk is in the disabled list or not, and then append all the --diskspec flags to the end of $cmd for the backup/snapshot commands. Just a thought.

EideardVMR commented 1 month ago

Hi, thank you very much for this valuable tip! I will add it to my todo list and see what I can do. I didn't think at all that someone would actually mount an HDD instead of an image. The plugin is designed for images only. If I can't include your requested feature in the next patch, I'll include your change so that you don't have the same problem again when you update!

GraphicHealer commented 1 month ago

Hi, thank you very much for this valuable tip! I will add it to my todo list and see what I can do. I didn't think at all that someone would actually mount an HDD instead of an image. The plugin is designed for images only. If I can't include your requested feature in the next patch, I'll include your change so that you don't have the same problem again when you update!

Thanks dude!

This is an awesome plugin you wrote. I can't wait to see where it goes!