VM Backup Plugin


Recommended Posts

Mod note: this plugin has multiple known issues, use with care.

 

This is a beta version of a plugin I am working on to replace the unraid-vmbackup script I have been maintaining here and here.

It is based off the latest version of the script (v1.3.1), and I will be maintaining both for now as there are some use-cases for the script that the plugin cannot currently replace. This is provided as-is with no guarantees.

 

That said, and without further ado, the current version of the plugin can be found here:

https://github.com/JTok/unraid.vmbackup/tree/v0.2.5

 

-JTok

 

Feel free to buy me a beer (or two 😋)

Edited by JTok
updated version to v0.2.5
  • Like 9
  • Thanks 2
Link to comment

Current version change log (we skipped a version):

v0.2.5 - 2022/12/25

The Last Dancer

  • fixed typo in import for jquery filetree
  • fixed issue with renaming and deleting configs not showing configurations
  • cleaned up code
  • enabled beta for backup extra files
  • re-added option to backup vms while they are running

 

v0.2.4 - 2021/03/12

Fettuccine Afraido

  • removed pigz and reverted back to standard gzip to reduce complexity.
  • fixed issue with legacy options not being updated correctly.
  • fixed issue with old package files not being removed.
  • fixed plugin package removal.
  • moved txt and json files from usb to /tmp to reduce writes to usb.
  • added option to backup configs.
  • added option to backup pre and post scripts.

 

https://github.com/JTok/unraid.vmbackup/tree/v0.2.5

 

 

-JTok

Edited by JTok
v0.2.5
  • Like 1
Link to comment
1 hour ago, Ashe said:
Works very well so far, well done. One request would be to allow unassigned devices to be used as the backup location, it only allows unraid shares at the moment.

 

You should be able to manually type any path that starts with /mnt/ even though the drop down list only shows shares.

 

 

If you need  a path that starts with something other than /mnt/:
Under the Danger Zone tab, at the very bottom. there is a setting called “Disable restrictive validation”. If you set it to ‘Yes’, it should allow you to chose any path.


Sent from my iPhone using Tapatalk

 

 

Edited by JTok
additional info
Link to comment

@JTok Big thanks in the first place for your work. Looks like the plugin works for me with a quick test on a single VM, normal backup+compression. A small issue I've found is when selecting the target path for the backup. It's basically not possible to read the dropdown menu items. I'am using the Black theme with Firefox. Same with Brave browser and Chrome on Unraid 6.8. Just to let you know.

grafik.png.c66197d0538a9907e016925ad571a22b.png

Link to comment


I tried manually typing the path but without changing the mode and it would not allow. Will try again. Thanks



Make sure the path you’re typing contains a trailing slash. I’m going to change that requirement in a future release, but I didn’t change it yet for the beta.


Sent from my iPhone using Tapatalk
Link to comment



Make sure the path you’re typing contains a trailing slash. I’m going to change that requirement in a future release, but I didn’t change it yet for the beta.


Sent from my iPhone using Tapatalk

I'm sure the trailing Slash was there. Will try again and report back


Sent from my iPhone using Tapatalk
  • Like 1
Link to comment
@JTok Big thanks in the first place for your work. Looks like the plugin works for me with a quick test on a single VM, normal backup+compression. A small issue I've found is when selecting the target path for the backup. It's basically not possible to read the dropdown menu items. I'am using the Black theme with Firefox. Same with Brave browser and Chrome on Unraid 6.8. Just to let you know.
grafik.png.c66197d0538a9907e016925ad571a22b.png


Weird. I’ll check it out. Thanks


Sent from my iPhone using Tapatalk
Link to comment
Very cool, can't wait to give it a whirl.
Quick question: do you plan to add restore capability at some point?


I hadn’t really thought about it, but I probably should lol.

I’ll put that on my to-do list, but that’s probably a post-beta feature right now.



Sent from my iPhone using Tapatalk
  • Thanks 1
Link to comment
3 hours ago, JTok said:

 


I hadn’t really thought about it, but I probably should lol.

I’ll put that on my to-do list, but that’s probably a post-beta feature right now.



Sent from my iPhone using Tapatalk

I second that request (for restore functionality).
No hurry, but that would be a valuable addition.

Link to comment

Here's my draft at manual instructions, feel free to use them as a starting point. I just backed up one VM as a test in this case.

1. Stop all VMs.

2. Take a peek at what VMs you're using and where you're backing them up. Here's my config:

image.png.d50f62c63a6df228754c8f4cd1805869.png

This means I should be able to find a directory here:

/mnt/user/Saidin/backuptest/Forsaken

3. Open a command shell.

image.png

4. Now you need to copy your VM vdisk and VM xml to the right location. If you're truly restoring, you'll need to make some directories as well. I'm assuming you're using the default location for domain disks, /domains share.

root@Truesource:/# mkdir /mnt/user/domains/Forsaken
root@Truesource:/# cp /mnt/user/Saidin/backuptest/Forsaken/20191220_1017_vdisk1.img /mnt/user/domains/Forsaken/vdisk1.img 
root@Truesource:/# cp /mnt/user/Saidin/backuptest/Forsaken/20191220_1017_Forsaken.xml /etc/libvirt/qemu/Forsaken.xml 

5. Start your VM.

 

 

Edited by DBJordan
Minor corrections.
  • Like 1
  • Thanks 1
Link to comment

New release with some minor functional changes and a few bug fixes. This was mostly background stuff with the exception of adding a "Backup Now" button.

 

 

v0.1.7 - 2019/12/22
Ms. Frizzle

- fixed minor issues.
- fixed paths requiring trailing slashes.
- fixed backup location drop-down color when using black theme.
- added additional logging.
- added donate button.
- added backup now button.
- changed backup location drop-down start folder to /mnt/.
- updated help.
- updated readme.

 

https://github.com/JTok/unraid.vmbackup/tree/v0.1.7

 

-JTok

  • Like 3
  • Thanks 1
Link to comment
Will this eventually get added to CA so it will update automatically?

unRAID should still detect updates in the plugin screen without it being part of CA (assuming I didn’t mess something up). And the CA update plugin should also still do automatic updates from what I can tell.

 

That said, I've been in contact with Squid about adding it, so that should get done soon.

 

Edited by JTok
Link to comment
54 minutes ago, JTok said:

unRAID should still detect updates in the plugin screen without it being part of CA (assuming I didn’t mess something up). And the CA update plugin should also still do automatic updates from what I can tell.

 

That said, I've been in contact with Squid about adding it, so that should get done soon.

 

hmm it didn't for me, but maybe I was too quick - dunno.  Thanks again for making this into a plugin.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.