Trackpads Posted January 14, 2023 Share Posted January 14, 2023 Is there a simple or step by step tutorial for backing up and restoring VMs? I used the plugin to backup some drives but cannot find an understandable procedure on how to restore them. The spaceinvader video is 6 years old and the Vm Backup support thread link for restoring doesnt make sense. Quote Link to comment
JorgeB Posted January 14, 2023 Share Posted January 14, 2023 Do you have a libvirt.img backup or just the vdisks? Quote Link to comment
Trackpads Posted January 14, 2023 Author Share Posted January 14, 2023 I used the backup script so I have the .fd, the .xml, and the img for each machine Quote Link to comment
Trackpads Posted January 14, 2023 Author Share Posted January 14, 2023 I tried moving them to various places but the gui doesnt seem to have an 'open' vm prompt, it only lets you create one. Thanks again Quote Link to comment
JorgeB Posted January 15, 2023 Share Posted January 15, 2023 You can create a new VM and copy/paste the XML, not sure about the .fd, you might try asking in the plugin support thread, I recommend backing up libvirt.img instead, with that and the vdisks you have everything you need. Quote Link to comment
ghost82 Posted January 15, 2023 Share Posted January 15, 2023 there are 2 fd file, one is the ovmf bios, which can be created new, they all are the same. The other is the var fd which contains the efi variables, you can use the backup (by pointing in the xml to the backup vars fd file) if you want to backup the efi variables or you can use a new one, in this case it's like as you do a nvram reset. 1 Quote Link to comment
Trackpads Posted January 15, 2023 Author Share Posted January 15, 2023 First, thank you both for replying. But I literally dont understand. I think I can copy the xml data to the new one and will try. I should have said 'for dummies' above lol Quote Link to comment
ghost82 Posted January 15, 2023 Share Posted January 15, 2023 Basically copy xml in a text file, copy vdisk.img, copy the ovmf_vars.fd. Create a new empty vm and do not start it. Replace the new xml code with the one from the xml backup. Check the paths in the code of the xml for the vdisk.img and for the ovmf_vars.fd and change them pointing to that of your backup files. If the vm fails to start because of the uuid, meaning it's duplicated, delete the uuid line in the xml, libvirt will automatically create a new one. 1 Quote Link to comment
The Transplant Posted February 26 Share Posted February 26 @ghost82 Following on this thread I am now in the process of restoring a VM. I am running the backup plugin and have some questions before I do this: I notice in the backup directory that I have several copies by date of the img, xml and fd file. But the newest img file does not have an xml or an fd file associated with it. Should I revert back to the next newest file set where all three exist? Or can I use the xml and fd files from an older backup set? My fd file is not named ovmf_vars.fd but 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd. I assume that doesn't matter? Looking at the xml I see a few corrections I might need to make: /mnt/user/domains/Outlook/vdisk1.img - the image is currently in a backups folder - so I will move it to the corresponding folder in domains and leave this as is. Should I do anything with the 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd file that is currently in the backups folder? Thanks! Quote Link to comment
ghost82 Posted February 27 Share Posted February 27 Hello @The Transplant I never used the backup plugin, so I'm sorry but I don't know how this plugin works. Anyway... 18 hours ago, The Transplant said: But the newest img file does not have an xml or an fd file associated with it An img file is the disk file. The xml file contains the emulated hardware and layout of the virtual pc. The edk2 ovmf code fd file is the bios of your virtual pc. The edk2 ovmf vars fd file is the nvram of your virtual pc. You need these 4 things to boot a qemu vm. 18 hours ago, The Transplant said: But the newest img file does not have an xml or an fd file associated with it You should be able to boot the img by recreating the other 3 files; you can copy the ovmf code fd file from another vm (it's the bios, the bios is the same for every vm), and you also can use the ovmf vars fd file copied (better) from the same vm (the vars file can contain nvram variables, such as boot order). As far as the xml you can create a new vm, so to generate a new xml and change the relevant part of this new xml to point to your img disk file, and fd files; if hardware layout is different than the old xml (for example, you add a new usb virtual controller which was not there in the original vm), windows should be smart enough to not hang. Obviously you need to know if your original vm was a uefi or bios vm, q35 or i 440fx, so you can create the new vm accordingly, using ovmf or seabios nad q35 or i440fx virtual chipsets. 19 hours ago, The Transplant said: My fd file is not named ovmf_vars.fd but 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd. I assume that doesn't matter? Correct, it doesn't matter, unraid applies a prefix with the uid of the vm to the filename. 19 hours ago, The Transplant said: /mnt/user/domains/Outlook/vdisk1.img - the image is currently in a backups folder - so I will move it to the corresponding folder in domains and leave this as is. Either edit the path to point to that of where the img is, or move the img to that path. 19 hours ago, The Transplant said: Should I do anything with the 20240206_0300_5ab648ed-0c63-aa51-400c-277ece7bd277_VARS-pure-efi.fd file that is currently in the backups folder? This file should contain some nvram variables, but it shouldn't matter, make sure to check the xml to point to this file. If it doesn't boot you may need to enter the ovmf bios screen (by pressing esc key on vm boot repeatedly) and change the boot order. Quote Link to comment
The Transplant Posted February 27 Share Posted February 27 Thanks @ghost82 - I did manage to restore the older file and get it running. But I had made some changes and want to get the newer image restored so will work through your suggestions above. The backup script I am using just seems to make a copy of the .img, xml, and .fd file. It did take me a while to realize that it was appending dates to the front of these files - so you could maintain multiple backups. This feels like something that should be native in the GUI for both dockers and VMs. Since I had not been through a crash like this it took me down for a number of days while I learned how to restore. A simple create new VM and click on restore and select the backup would have been nice, and from a software standpoint is remarkably simple to add? I appreciate the help! Quote Link to comment
ghost82 Posted February 28 Share Posted February 28 17 hours ago, The Transplant said: I did manage to restore the older file and get it running. But I had made some changes and want to get the newer image restored so will work through your suggestions above If an older backup works, just replace the img file with the newer one and it should boot. 1 Quote Link to comment
The Transplant Posted February 28 Share Posted February 28 6 hours ago, ghost82 said: If an older backup works, just replace the img file with the newer one and it should boot. Thanks - that did work. Definitely not an experience I would want to repeat. The reason I had to do this in the first place is because 1 of my 2 cache drives failed. I replaced it but I am still in the process of moving data off the second cache drive onto the new replacement, and then the plan is to mirror this drive to avoid issues like this. This is another daunting task - nothing seems to work as planned. If you feel inclined to take a look - here is the link to that thread. Thanks! 1 Quote Link to comment
Trackpads Posted February 28 Author Share Posted February 28 This is something that is simple in most Hypervisors but nearly impossible here. Not sure that it should be that way. Quote Link to comment
The Transplant Posted February 28 Share Posted February 28 I have had relatively limited experience with hypervisors but it seems like a simple backup and restore should not be this difficult. But I am learning that unraid has come a long way but still requires a fairly deep understanding of what is going on behind the scenes to recover from any issues. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.