VM Backup Plugin


JTok

Recommended Posts

Hi,

 

I'm trying to set up this plugin to backup a VM that is running. I.e. it needs to be shut off before the backup.

 

The plugin logs that it tries to shut it off, but it's not working. I've tested and the VM can ble cleanly shut down with "Stop" through the WebUI, so theres nothing preventing the VM from being shut off. 

 

Theres also nothing in the syslog indicating that the VM has gotten a shutdown-command, so I'm pretty sure this is not working from the plugin. 

 

Any pointers? I obviously don't want to enable force shutdown/kill.

 

Thanks!

 

 image.thumb.png.5579a1cdff9c69aa310c2fc6ac223171.pngimage.thumb.png.686361859800fc4f5fb3af3f326074b3.png 

Link to comment

Hi community, recently my VM backup script needs hours for a backup. One VM is backed up within 30 minutes, the other VM takes tens of hours, with the script seemingly pausing. Here's a snippet from the log file. Anyone have any idea what happens between 10pm and almost 6am?

2021-07-26 21:40:24 information: copy of backup of /mnt/user/Backup-VM/Server 2019/20210724_1234_server2019.img vdisk to /mnt/user/Backup-VM/Server 2019/20210726_2140_server2019.img starting.
2021-07-26 22:49:36 information: copy of /mnt/user/Backup-VM/Server 2019/20210724_1234_server2019.img to /mnt/user/Backup-VM/Server 2019/20210726_2140_server2019.img complete.
2021-07-26 22:49:36 information: extension for /mnt/user/isos/windows_2019_Server.iso on Server 2019 was found in vdisks_extensions_to_skip. skipping disk.
2021-07-26 22:49:36 information: extension for /mnt/user/isos/virtio-win-0.1.190-1.iso on Server 2019 was found in vdisks_extensions_to_skip. skipping disk.
2021-07-26 22:49:36 information: skip_vm_shutdown is false. beginning vm shutdown procedure.
2021-07-26 22:49:36 infomration: Server 2019 is running. vm desired state is shut off.
2021-07-26 22:49:43 information: performing 20 30 second cycles waiting for Server 2019 to shutdown cleanly.
2021-07-26 22:49:43 information: cycle 1 of 20: waiting 30 seconds before checking if the vm has entered the desired state.
2021-07-26 22:50:13 information: Server 2019 is shut off. vm desired state is shut off. can_backup_vm set to y.
2021-07-26 22:50:13 information: actually_copy_files is 1.
2021-07-26 22:50:13 information: can_backup_vm flag is y. starting backup of Server 2019 configuration, nvram, and vdisk(s).
2021-07-26 22:50:13 information: copy of Server 2019.xml to /mnt/user/Backup-VM/Server 2019/20210726_2140_Server 2019.xml complete.
2021-07-26 22:50:13 information: copy of /etc/libvirt/qemu/nvram/dec2ff71-7e5e-7cd2-e5b3-b5e22cdc9a06_VARS-pure-efi.fd to /mnt/user/Backup-VM/Server 2019/20210726_2140_dec2ff71-7e5e-7cd2-e5b3-b5e22cdc9a06_VARS-pure-efi.fd complete.
2021-07-27 05:57:02 information: copy of /mnt/disk1/domains/Server 2019/server2019.img to /mnt/user/Backup-VM/Server 2019/20210726_2140_server2019.img complete.
2021-07-27 05:57:06 information: backup of /mnt/disk1/domains/Server 2019/server2019.img vdisk to /mnt/user/Backup-VM/Server 2019/20210726_2140_server2019.img complete.
2021-07-27 05:57:06 information: extension for /mnt/user/isos/windows_2019_Server.iso on Server 2019 was found in vdisks_extensions_to_skip. skipping disk.
2021-07-27 05:57:06 information: extension for /mnt/user/isos/virtio-win-0.1.190-1.iso on Server 2019 was found in vdisks_extensions_to_skip. skipping disk.
2021-07-27 05:57:06 information: the extensions of the vdisks that were backed up are img.
2021-07-27 05:57:06 information: vm_state is running. vm_original_state is running. not starting Server 2019.
2021-07-27 05:57:06 information: backup of Server 2019 to /mnt/user/Backup-VM/Server 2019 completed.
2021-07-27 05:57:06 information: number of days to keep backups set to indefinitely.
2021-07-27 05:57:06 information: cleaning out backups over 2 in location /mnt/user/Backup-VM/Server 2019/
2021-07-27 05:57:06 information: did not find any config files to remove.
2021-07-27 05:57:06 information: did not find any nvram files to remove.
2021-07-27 05:57:06 information: did not find any vdisk image files to remove.
2021-07-27 05:57:06 information: did not find any vm log files to remove.

 

Link to comment

Can we please please get a newbee friendly tutorial how to restore a vm? 

A few others also asked and noone really seams to care. 

I figured out that i have datestamped files. Always 3:

FD-File like ....VARS-pure-efi

QCOW2 File... 

xml file...

 

I guess i know what to do with the xml and the qcow2, but where do i put the fd file?

Link to comment
57 minutes ago, charley said:

Can we please please get a newbee friendly tutorial how to restore a vm? 

A few others also asked and noone really seams to care. 

I figured out that i have datestamped files. Always 3:

FD-File like ....VARS-pure-efi

QCOW2 File... 

xml file...

 

I guess i know what to do with the xml and the qcow2, but where do i put the fd file?

 

From the XML view of my VM it appears the FD file goes in:

/etc/libvirt/qemu/nvram/

 

Which is one level down from the XML file in:

/etc/libvirt/qemu/

 

Link to comment

Big grin and BIG THANKS to the author of this plug!

I am using it successfully on 4 different Unraid systems and I have absolutely nothing negative to report after some months of use....it just does what it is supposed to do.

Bravo!

 

 

Link to comment

Hi everyone,

 

I am use this script/plugin since a couple of days but have now the following issue:
 

The Windows 10 VM is running 24/7 and backup is planned every day at 21:00, but the state of the VM is paused. Is it possbile to resume the VM automatically after the backup was finished or that the vm is not paused while a VM backup is performed?

Also I have set it to to snapshot backups but my files are always the same size (22GB each vdisk)

 

Update: System is going to sleep because somehow the energy settings have been changed (not by me). So this issue is solved but the one with creating snapshots instead of every day full backups is still open. Anyone has an idea?

Edited by PsYcRo
Link to comment

I have a problem with the vm backup tool it was working fine then i upgraded to unraid V6.10.0-rc1 and the snap shot part of the program stopped working it is giving me this error any idea what is causing it

 

failure: snapshot command failed on vdisk1.snap for Windows 10 Pro.

 

 

Thank you

20210811_1603_unraid-vmbackup.log

Edited by JP s
Adding Test File
  • Like 1
Link to comment

i keep getting an error complaining about file storage when doing snapshots. I'm not sure what it's referencing, i have set the backup location to /mnt/user/backups/vmbackup/ and this location works when stopping and backing up.

 

vm_state is running. vdisk_type is raw
2021-08-14 04:43:14 information: qemu agent found. enabling quiesce on snapshot.
error: internal error: missing storage backend for 'file' storage

 

Link to comment
  • 3 weeks later...
On 8/12/2021 at 1:15 AM, JP s said:

I have a problem with the vm backup tool it was working fine then i upgraded to unraid V6.10.0-rc1 and the snap shot part of the program stopped working it is giving me this error any idea what is causing it

 

failure: snapshot command failed on vdisk1.snap for Windows 10 Pro

 

 

Similar issue here after the 6.10.0-rc1 update. Both automatic and manual Backups don't create a disk snapshot, only the .fd and .xml file for the VM. 

 

Log attached. 

20210830_1416_unraid-vmbackup.txt

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.