VM Backup Plugin


Recommended Posts

On 4/22/2023 at 7:31 PM, joykingdom said:

image.thumb.png.fa5cff4e7c52d684c3320bf848acef8b.png

This plugin has problems with 6.12rc3

 

On 8/4/2023 at 4:14 AM, rorton said:

sorry, I may have been assuming what @CodeGlitcher was experiencing was the same, is it is sort of uninstalling itself. 

 

My issue is that when I reboot, the box comes up and the plug-in sits in the Plugin file install errors (as image)

 

1871603520_Screenshot2023-08-03at21_09_30.thumb.png.38a04684e6ed1332b514379b1ca7ef8a.png

 

If I delete and then manually install again, it works. 

 

I have just rebooted to get the screenshot, if there are any logs I can provide from anywhere please let me know

 

Im using 6.12.3, and has been happening on all 6.12 versions

 

On 8/4/2023 at 4:28 AM, rorton said:

I do have this in my syslog too...

 

Aug  3 21:08:40 Unraid root: plugin: installing: vmbackup.plg
Aug  3 21:08:40 Unraid root: plugin: creating: /boot/config/plugins/vmbackup/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz - downloading from URL https://raw.githubusercontent.com/jtok/unraid.vmbackup/master/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz

 

if I then delete the plugin, and then reinstall, I see this in syslog...

 

Aug  3 21:24:51 Unraid root: plugin: creating: /boot/config/plugins/vmbackup/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz - downloading from URL https://raw.githubusercontent.com/jtok/unraid.vmbackup/master/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz
Aug  3 21:24:52 Unraid root: plugin: checking: /boot/config/plugins/vmbackup/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz - MD5
Aug  3 21:24:52 Unraid root: plugin: running: upgradepkg --install-new /boot/config/plugins/vmbackup/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz
Aug  3 21:24:52 Unraid root: plugin: creating: /boot/config/plugins/vmbackup/vmbackup-v0.2.5-2022.12.25.txz - downloading from URL https://raw.githubusercontent.com/jtok/unraid.vmbackup/master/vmbackup-v0.2.5-2022.12.25.txz
Aug  3 21:24:52 Unraid root: plugin: checking: /boot/config/plugins/vmbackup/vmbackup-v0.2.5-2022.12.25.txz - MD5
Aug  3 21:24:52 Unraid root: plugin: running: upgradepkg --install-new /boot/config/plugins/vmbackup/vmbackup-v0.2.5-2022.12.25.txz
Aug  3 21:24:55 Unraid root: plugin: vmbackup.plg installed

 

 

On 8/4/2023 at 4:43 AM, Elmojo said:

I know next to nothing about plugin development or installation, but it looks to me like, in the first case, it's trying to install the plugin, not run one that's already installed.   This leads me back to my original guess of there being something fishy going on with compatibility (or lack thereof) with v6.12.  I'd start there, and ask for general help (in another thread maybe?) where those who are familiar with how plugins act can perhaps help track down the specific issue.

All I know is that mine works fine(ish), and I'm on 6.11.5. Sorry.

I’m having this “Plugin File Install Errors” problem too on Unraid 6.12.3. If the system reinstalls VM Backup automatically after a reboot, in my case, it is for sure going to fail. I live in China, need to use a proxy to access GitHub. After rebooting, the Docker service is initializing so my proxy is not yet available. If the system reinstalls VM Backup at this point, it is going to fail.

Link to comment

Sorry for the late reaction forgot to enable notificaitons. 

 

Yes this exactly what i am having to.

I run my router as a vm and the first few minutes after a reboot i dont have a internet connection.
After some digging i found that the plugin tries to download xmlstarlet package.

 

Aug  3 21:13:24 NAS root: plugin: creating: /boot/config/plugins/vmbackup/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz - downloading from URL https://raw.githubusercontent.com/jtok/unraid.vmbackup/master/packages/xmlstarlet-1.6.1-x86_64-1_slonly.txz
Aug  3 21:13:28 NAS root: plugin: downloading: xmlstarlet-1.6.1-x86_64-1_slonly.txz ...#015plugin: xmlstarlet-1.6.1-x86_64-1_slonly.txz download failure: Network failure

 

I tried to place the package directly in the config/plugins/vmbackup/pakcages but that does not seem to work.

 

I took a look the code and the last pr https://github.com/JTok/unraid.vmbackup/pull/36/files gives me the impression that installtation without internet was fixed. 
It should no longer remove the xmlstarlet package and install it locally. 

But this pr has been merged to a development branch and not to the master branch.

 

I have tried to install the plugin from the development branch and it does work even after a reboot.

 

My solution for now is to manual install  theplugin from: https://raw.githubusercontent.com/jtok/unraid.vmbackup/development/vmbackup.plg

But it would be nice to be able to switch back to de master branch for stability reasons.

 

 

 

Edited by CodeGlitcher
  • Upvote 1
Link to comment
On 12/19/2021 at 5:21 PM, dja said:

HOW TO RESTORE!!!!


Option 1- Script:
Use the great script from @petchav, many thanks! See the video below for a guide on how to use this. 

 

 

 

Text instructions:


Open Unraid console.

 

Enter the following commands:
- cd /mnt/user/<share name>/<backup folder>
- git clone https://github.com/Emilien-Lambert/Unraid-VM-Backup-Plugin-Restoration-Script.git
- This will clone the script to your backup folder.

 

Enter the following commands:
- cd Unraid-VM-Backup-Plugin-Restoration-Script
- chmod +x vm_backup_restoration.sh
- ./vm_backup_restoration.sh
- This will begin the script.

 

Do the following:
- Delete the VM you want to restore. Select Remove VM & Disks.
- Shut down all other VMs.
- Make sure the VM service is ENABLED/ON in Settings > VM Manager.

 

Enter the path of VM backups.
- Example: /mnt/user/<share name>/<backup folder>/VMs

 

Enter name of VM you wish to restore.
- This will be the name of the folder of the VM you want to restore.
- Example: Ubuntu

 

Enter the date of the backup you want restored.
- For example, if the filename of the VM is 20220124_0300_Ubuntu.xml
- Just enter 20220124_0300

 

The restoration process could take several minutes.

 

Once complete, stop your Unraid storage array and start it again.

Your newly restored VM will show up.

  • Like 1
Link to comment

Hi all, 

I've a problem with one of my VMs. I can't backup it. here is the info that I have in the logs:

 

Quote

2023-08-13 03:52:18 information: FW01 can be found on the system. attempting backup.
2023-08-13 03:52:18 information: removing old local FW01.xml.
2023-08-13 03:52:18 information: creating local FW01.xml to work with during backup.
2023-08-13 03:52:18 information: /mnt/user/Backup_VMs_Docker/VMs/FW01 exists. continuing.
2023-08-13 03:52:18 information: skip_vm_shutdown is false and use_snapshots is 1. skipping vm shutdown procedure. FW01 is running. can_backup_vm set to y.
2023-08-13 03:52:18 information: actually_copy_files is 1.
2023-08-13 03:52:18 information: can_backup_vm flag is y. starting backup of FW01 configuration, nvram, and vdisk(s).
2023-08-13 03:52:19 information: copy of FW01.xml to /mnt/user/Backup_VMs_Docker/VMs/FW01/20230813_0300_FW01.xml complete.
2023-08-13 03:52:19 information: copy of /etc/libvirt/qemu/nvram/4ebc9912-edac-f434-2157-6a660d715f7c_VARS-pure-efi.fd to /mnt/user/Backup_VMs_Docker/VMs/FW01/20230813_0300_4ebc9912-edac-f434-2157-6a660d715f7c_VARS-pure-efi.fd complete.
2023-08-13 03:52:19 information: able to perform snapshot for disk /mnt/user/domains/FW01/vdisk1.img on FW01. use_snapshots is 1. vm_state is running. vdisk_type is raw
2023-08-13 03:52:19 information: qemu agent found. enabling quiesce on snapshot.
2023-08-13 03:52:19 failure: snapshot command failed on vdisk1.snap for FW01.
2023-08-13 03:52:19 failure: snapshot_fallback is 0. skipping backup for FW01 to prevent data loss. no cleanup will be performed for this vm.

 

Any idea why ?

Link to comment

I imagine this is an easy answer (and I didn't find it in searching):

 

When I choose to compress the image (vdisk.img), the original file remains in addition to the compressed one (vdisk.img, vdisk.img.zst).  I'm getting about a 50gb savings in compression, and I'm OK with the headaches mentioned in other posts.

 

Is there a way for me to exclude/remove that original .img file after the compression (or prevent it in the first place)?  To restate:  I'd like to keep a compressed VM image, not both the original and a compressed one.

Edited by Tomahawk51
Link to comment

When I select multiple VMs for backup and I select 3 servers for backup it only does backup of first and then finish the job ?

Why it does not try to proceed to next VM and is doing only 1st one ?

 

It was suppose to run backup on GameServer, UbuntuServer, WinAP

 

but it only did on GameServer 

 

why?

 

 

2023-08-22 20:26:13 information: snapshot_fallback is 0. snapshots will fallback to standard backups.
2023-08-22 20:26:13 information: pause_vms is 0. vms will be shutdown for standard backups.
2023-08-22 20:26:13 information: enable_reconstruct_write is 0. reconstruct write will not be enabled by this script.
2023-08-22 20:26:13 information: compare_files is 0. files will not be compared after backups.
2023-08-22 20:26:13 information: backup_xml is 1. vms will have their xml configurations backed up.
2023-08-22 20:26:13 information: backup_nvram is 1. vms will have their nvram backed up.
2023-08-22 20:26:13 information: backup_vdisks is 1. vms will have their vdisks backed up.
2023-08-22 20:26:13 information: start_vm_after_backup is 0. vms will not be started following successful backup.
2023-08-22 20:26:13 information: start_vm_after_failure is 0. vms will not be started following an unsuccessful backup.
2023-08-22 20:26:13 information: disable_delta_sync is 0. rsync will be used to perform delta sync backups.
2023-08-22 20:26:13 information: rsync_only is 0. cp will be used when applicable.
2023-08-22 20:26:13 information: actually_copy_files is 1. files will be copied.
2023-08-22 20:26:13 information: clean_shutdown_checks is 20. this is probably a sufficient number of shutdown checks.
2023-08-22 20:26:13 information: seconds_to_wait is 30. this is probably a sufficient number of seconds to wait between shutdown checks.
2023-08-22 20:26:13 information: keep_error_log_file is 1. error log files will be kept.
2023-08-22 20:26:13 information: number_of_error_log_files_to_keep is 10. this is probably a sufficient error number of log files to keep.
2023-08-22 20:26:13 information: started attempt to backup GameServer, UbuntuServer, WinAP to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto
2023-08-22 20:26:13 information: GameServer can be found on the system. attempting backup.
2023-08-22 20:26:13 information: removing old local GameServer.xml.
removed 'GameServer.xml'
2023-08-22 20:26:13 information: creating local GameServer.xml to work with during backup.
2023-08-22 20:26:13 information: /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer exists. continuing.
2023-08-22 20:26:13 information: copy of backup of /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_1043_20230804_2115_Gameserver_082023.img vdisk to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_20230804_2115_Gameserver_082023.img starting.
'/mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_1043_20230804_2115_Gameserver_082023.img' -> '/mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_20230804_2115_Gameserver_082023.img'
2023-08-22 20:40:57 information: copy of /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_1043_20230804_2115_Gameserver_082023.img to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_20230804_2115_Gameserver_082023.img complete.
2023-08-22 20:40:57 information: extension for /mnt/user/isos/debian-11.7.0-amd64-netinst.iso on GameServer was found in vdisks_extensions_to_skip. skipping disk.
2023-08-22 20:40:57 information: skip_vm_shutdown is false. beginning vm shutdown procedure.
2023-08-22 20:40:57 information: GameServer is running. vm desired state is shut off.
Domain GameServer is being shutdown

2023-08-22 20:40:57 information: performing 20 30 second cycles waiting for GameServer to shutdown cleanly.
2023-08-22 20:40:57 information: cycle 1 of 20: waiting 30 seconds before checking if the vm has entered the desired state.
2023-08-22 20:41:27 information: GameServer is shut off. vm desired state is shut off. can_backup_vm set to y.
2023-08-22 20:41:27 information: actually_copy_files is 1.
2023-08-22 20:41:27 information: can_backup_vm flag is y. starting backup of GameServer configuration, nvram, and vdisk(s).
sending incremental file list
GameServer.xml

sent 7,277 bytes received 35 bytes 14,624.00 bytes/sec
total size is 7,167 speedup is 0.98
2023-08-22 20:41:27 information: copy of GameServer.xml to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_GameServer.xml complete.
sending incremental file list
a5374532-5d73-88d9-d03e-506821f267df_VARS-pure-efi.fd

sent 131,245 bytes received 35 bytes 262,560.00 bytes/sec
total size is 131,072 speedup is 1.00
2023-08-22 20:41:27 information: copy of /etc/libvirt/qemu/nvram/a5374532-5d73-88d9-d03e-506821f267df_VARS-pure-efi.fd to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_a5374532-5d73-88d9-d03e-506821f267df_VARS-pure-efi.fd complete.
sending incremental file list
20230804_2115_Gameserver_082023.img

sent 694,108,869 bytes received 3,277,035 bytes 1,248,676.64 bytes/sec
total size is 53,687,091,200 speedup is 76.98
2023-08-22 20:50:45 information: copy of /mnt/vm_ssd/domains_ssd/20230804_2115_Gameserver_082023.img to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_20230804_2115_Gameserver_082023.img complete.
2023-08-22 20:50:45 information: backup of /mnt/vm_ssd/domains_ssd/20230804_2115_Gameserver_082023.img vdisk to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230822_2026_20230804_2115_Gameserver_082023.img complete.
2023-08-22 20:50:45 information: extension for /mnt/user/isos/debian-11.7.0-amd64-netinst.iso on GameServer was found in vdisks_extensions_to_skip. skipping disk.
2023-08-22 20:50:45 information: the extensions of the vdisks that were backed up are img.
2023-08-22 20:50:45 information: vm_state is shut off. vm_original_state is running. starting GameServer.
Domain GameServer started

2023-08-22 20:50:46 information: backup of GameServer to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer completed.
2023-08-22 20:50:46 information: cleaning out backups older than 90 days in location ONLY if newer files exist in /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/
2023-08-22 20:50:46 information: did not find any config files to remove.
2023-08-22 20:50:46 information: did not find any nvram files to remove.
2023-08-22 20:50:46 information: did not find any vdisk image files to remove.
2023-08-22 20:50:46 information: did not find any vm log files to remove.
2023-08-22 20:50:46 information: cleaning out backups over 2 in location /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/
2023-08-22 20:50:46 information: removed '/mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230820_0000_GameServer.xml' config file.
2023-08-22 20:50:46 information: removed '/mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/GameServer/20230820_0000_a5374532-5d73-88d9-d03e-506821f267df_VARS-pure-efi.fd' nvram file.
/tmp/vmbackup/scripts/default/user-script.sh: line 2899: 082023: value too great for base (error token is "082023")
2023-08-22 20:50:46 information: finished attempt to backup GameServer, UbuntuServer, WinAP to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto.
2023-08-22 20:50:46 information: cleaning out logs over 1.
2023-08-22 20:50:46 information: removed '/mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto/logs/20230822_1139_unraid-vmbackup.log'.
2023-08-22 20:50:46 information: cleaning out error logs over 10.
2023-08-22 20:50:46 information: did not find any error log files to remove.
2023-08-22 20:50:46 Stop logging to log file.
2023-08-22 20:50:46 Found /tmp/vmbackup/scripts/default.pid. Attempting to kill process.
2023-08-22 20:50:46 Killed user script with pid 93908 for default.
2023-08-22 20:50:46 Removed: /tmp/vmbackup/scripts/default/user-script.sh
2023-08-22 20:50:46 Removed: /tmp/vmbackup/scripts/default.pid

Edited by macmus
Link to comment
5 hours ago, Elmojo said:

What does your log report?

pasted log above.

 

It just doesn't start it ?

 

 

2023-08-22 20:26:13 information: started attempt to backup GameServer, UbuntuServer, WinAP to /mnt/user/NOWADZIELNIA/_Domain_Backup/backup_auto

 

It find GameServer and does the backup of UbuntuServer and WinAP

 

Edited by macmus
Link to comment

I'm not quite following you...

You say in your previous post that it only backed up 'Gameserver', but in your last post, you say "It find GameServer and does the backup of UbuntuServer and WinAP".

Which is it?  Does it back up the Ubuntu and WinAP or no?

Is that log you posted complete, or is there more to it?

 

Check your settings and make sure [Backup all VMs?] is set to [Yes], or that you have a list of VMs specified below that line.

What happens if you run the missing backups manually? Do they complete successfully, or is there an error?

Sorry, I'm a novice at this myself, just throwing stuff out that I ran into in my setup. :)

Link to comment
On 8/23/2023 at 8:11 AM, Elmojo said:

I'm not quite following you...

You say in your previous post that it only backed up 'Gameserver', but in your last post, you say "It find GameServer and does the backup of UbuntuServer and WinAP".

Which is it?  Does it back up the Ubuntu and WinAP or no?

Is that log you posted complete, or is there more to it?

 

Check your settings and make sure [Backup all VMs?] is set to [Yes], or that you have a list of VMs specified below that line.

What happens if you run the missing backups manually? Do they complete successfully, or is there an error?

Sorry, I'm a novice at this myself, just throwing stuff out that I ran into in my setup. :)

 

I'm sorry for not being clear.

 

I have in list selected 3 VMs GameServer, UbuntuServer and WinAP. When I run manually the backup now it finds all 3 servers, but it performs backup only of a first one from the list. In this case GameServer is the first server. If I uncheck it from the list It will backup Ubuntu but not WinAP etc..

 

You can see it all in logs.

 

 

Link to comment
  • 4 weeks later...
On 9/18/2023 at 12:26 AM, macmus said:

updated to latest unraid version, still only one VM is getting backed up from the list selected.

 

Does anyone have this issue ?

Can you post logs after checking the settings below and running the backup one more time?

 

Under "other settings" in the plugin make sure to set the following to 'yes'

"Keep log files"
"Enable per VM logs" 

Link to comment

Please help me find my problem

Thanks for the plg. Two days ago I installed it and configured. Yesterday after my server rebooted, it was gone, nowhere to be found in the plugins nor in the settings. I installed again and today i couldn't find it either. In the app center it shows "install" instead of "installed" which I did do. Maybe it doesn't like to stay with me. Please tell me how to let it be with me.

Link to comment
15 hours ago, francishe said:

Please help me find my problem

Thanks for the plg. Two days ago I installed it and configured. Yesterday after my server rebooted, it was gone, nowhere to be found in the plugins nor in the settings. I installed again and today i couldn't find it either. In the app center it shows "install" instead of "installed" which I did do. Maybe it doesn't like to stay with me. Please tell me how to let it be with me.

Weird. It disappeared again this morning after my server's reboot. I checked its appdata folder is still there, but .plg file is gone. Why?

I am running 6.12.4, where everything is fine except this one.

Link to comment
On 8/5/2023 at 11:50 AM, HeyHollis said:

 

 

 

I’m having this “Plugin File Install Errors” problem too on Unraid 6.12.3. If the system reinstalls VM Backup automatically after a reboot, in my case, it is for sure going to fail. I live in China, need to use a proxy to access GitHub. After rebooting, the Docker service is initializing so my proxy is not yet available. If the system reinstalls VM Backup at this point, it is going to fail.

Might be the reason quoted above. I am also sitting behind GFW.

Link to comment
  • 2 weeks later...
  • 2 weeks later...

If anyone is still running into the problem of getting warning messages that "user script file does not exist" when running this plugin with a schedule (especially if the backup still seems to work), it may be due to an old crontab entry. Try running `crontab -l | grep vmbackup` and see if you have any entries that use a directory as the argument to `run_backup` instead of just the config name. You may want to run `crontab -e` to remove all of your vmbackup cron entries and then recreate them through the plugin settings.

  • Like 1
Link to comment

I've noticed that the plugin doesn't remove QCOW2 VM files.  I have number of backups to keep set to 4, it removes the .fd and .xml files, but it won't remove the QCOW2 file.  Any way I can get it to remove the extra backup?  Here are the relevant logs:

 

2023-10-17 04:03:31 information: backup of Home Assistant to /mnt/user/backups/Unraid/VMs/Home Assistant completed.
2023-10-17 04:03:31 information: number of days to keep backups set to indefinitely.
2023-10-17 04:03:31 information: cleaning out backups over 4 in location /mnt/user/backups/Unraid/VMs/Home Assistant/
2023-10-17 04:03:31 information: removed '/mnt/user/backups/Unraid/VMs/Home Assistant/20230919_0330_Home Assistant.xml' config file.
2023-10-17 04:03:31 information: removed '/mnt/user/backups/Unraid/VMs/Home Assistant/20230919_0330_xxx.fd' nvram file.
2023-10-17 04:03:31 information: did not find any vdisk image files to remove.
2023-10-17 04:03:31 information: did not find any vm log files to remove.
2023-10-17 04:03:31 information: removing local Home Assistant.xml.
removed 'Home Assistant.xml'

 

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.