JTok / unraid.vmbackup

a plugin for backing up VMs in unRAID including vdisks and configuration files.
51 stars 4 forks source link

How to RESTORE? #31

Open Garbonzo17 opened 2 years ago

Garbonzo17 commented 2 years ago

Ok, so I used this to try to make things simple before blowing remaking my libvirt.img file. now that I remade that, I was hoping to just restore the vm's I had.... doesn't seem like it's going to be that simple. but any help/advice would be helpful. TIA -g

tomoliveri commented 2 years ago

Same issue here.

I boot straight to a uefi shell, seems it's unable to read the disk at all. Disk shows up as 'UEFI Misc device' in bios I've tried copying the nvram.fd file from the backup folder, ensuring that the xml points to it to no avail.

Meanwhile, the backup boots just fine on virtualbox. (Hence my troubleshooting secure boot)

Ideas most welcome...

realizelol commented 2 years ago

Obviously there is no GUI method, instead you have to use the command line. (SSH to your unraid server)

If you're having a date in-front of the file remove that part.

XML goes to /etc/libvirt/qemu e.g. cp /mnt/disk2/backups/vms/Windows/20220101_0000_Windows.xml /etc/libvirt/qemu/Windows.xml

NVRAM (.fd) goes to /etc/libvirt/qemu/nvram e.g. cp /mnt/disk2/backups/vms/Windows/20220101_0000_111111-2222-3333-4444-55555555555_VARS-pure-efi.fd /etc/libvirt/qemu/nvram/111111-2222-3333-4444-55555555555_VARS-pure-efi.fd

IMG file goes to /mnt/user/domains in a subdirectory e.g. Windows e.g. cp /mnt/disk2/backups/vms/Windows/20220101_0000_vdisk1.img /mnt/user/domains/Windows/vdisk1.img

But the best way you should have a look into the XML file - e.g.: grep -oP "<nvram>\K(.*)(?=</nvram>)|<source file='\K.*\.(img|qcow2)(?='.*)" cp /mnt/disk2/backups/vms/Windows/20220101_0000_Windows.xml


best regards

realizelol

tomoliveri commented 2 years ago

Awesome. I'm back up and running.

I had tried to do this by manually editing the .xml, but I must have missed something / it seems that libvirt needs a restart to reload the xml domains

Garbonzo17 commented 2 years ago

Thanks, didn't need a gui, just couldn't find it documented... but every thread I read of someone restoring a backup kinda glossed it over like it was obvious... it's not for someone new to unraid and has gotten to the point where they are using a tool to create backups knowing it LIKELY they will need them as they are tinkering/learning. I am REALLY glad to have this information now, so THANKS!

I will go restore one just for giggles and make sure I have it down, but I don't foresee any problems (although its generally the unforeseen ones that bite ya, huh?)

-g

Nischi85 commented 1 year ago

Is there some reason this can't be implemented as a restore option in the GUI like plugin Appdata Backup?

realizelol commented 4 months ago

I found this post in the unraid forum, which will maybe help to restore: https://forums.unraid.net/topic/86303-vm-backup-plugin/?do=findComment&comment=1075536