Jump to content
danioj

unraid-autovmbackup: automate backup of virtual machines in unRAID - v0.4

157 posts in this topic Last Reply

Recommended Posts

## USE AT YOUR OWN RISK ##

# Live backup is experimental, so please dont test/use on daily use unraid box for now. That beeing said, i use this on my daily Unraid box without problems.

 

In order for this to work make sure:

 

When using enable_backup_running_vm="1" you HAVE TO CHANGE your vdisk path in vm.xml to point to /mnt/cache/somefolder or /mnt/disk1/somefolder instead of /mnt/user/somefolder

(see:

 

New script added as attachment, what is changed ?

 

# - Fixed case sensitive bug, where an .iso file is shown as warning in script-logging when filename is xxx.ISO. Only .iso was accepted (lines: 1180 and 1921)
# - Experimental: added live backup, backup of running vm. This also checks if guest agent is installed inside vm to add extra parameter for making sure we have a consistent disk state before taking snapshot and backup. This backup DOES NOT includes RAM state. so when VM is restored it wil be powered off and is in a state as it has been forced powerd off. allows the guest to flush its I/O into a stable state before the snapshot is created, which allows use of the snapshot without having to perform a fsck or losing partial database transactions. When guest agent is not installed it just creats a snapshot but is stil considerd to be a safe snapshot. Can be enabled or disabled with: enable_backup_running_vm="1" or "0"
# - Added Quick settings on top of script for easy changes true Unraid webgui
# - Added comments in script to see what is changed: look for: "### Added:" and "### edited:"

 

All features and functionality from original script is intact, so if you set enable_backup_running_vm=0 it is the same script as: https://github.com/JTok/unraid-vmbackup : v1.1.4 - 2018/05/19

 

## USE AT YOUR OWN RISK ##

 

 

 

 

Autovmbackup.sh.txt

Share this post


Link to post
Posted (edited)
On 2/24/2019 at 8:42 AM, Dikkekop said:

## USE AT YOUR OWN RISK ##

# Live backup is experimental, so please dont test/use on daily use unraid box for now. That beeing said, i use this on my daily Unraid box without problems.

 

In order for this to work make sure:

 

When using enable_backup_running_vm="1" you HAVE TO CHANGE your vdisk path in vm.xml to point to /mnt/cache/somefolder or /mnt/disk1/somefolder instead of /mnt/user/somefolder

(see:

 

New script added as attachment, what is changed ?

 

# - Fixed case sensitive bug, where an .iso file is shown as warning in script-logging when filename is xxx.ISO. Only .iso was accepted (lines: 1180 and 1921)
# - Experimental: added live backup, backup of running vm. This also checks if guest agent is installed inside vm to add extra parameter for making sure we have a consistent disk state before taking snapshot and backup. This backup DOES NOT includes RAM state. so when VM is restored it wil be powered off and is in a state as it has been forced powerd off. allows the guest to flush its I/O into a stable state before the snapshot is created, which allows use of the snapshot without having to perform a fsck or losing partial database transactions. When guest agent is not installed it just creats a snapshot but is stil considerd to be a safe snapshot. Can be enabled or disabled with: enable_backup_running_vm="1" or "0"
# - Added Quick settings on top of script for easy changes true Unraid webgui
# - Added comments in script to see what is changed: look for: "### Added:" and "### edited:"

 

All features and functionality from original script is intact, so if you set enable_backup_running_vm=0 it is the same script as: https://github.com/JTok/unraid-vmbackup : v1.1.4 - 2018/05/19

 

## USE AT YOUR OWN RISK ##

 

 

 

 

Autovmbackup.sh.txt

 

How does one install the guest agent?

 

EDIT:  Nvmd, found it on the virtio CDrom.

Edited by IamSpartacus

Share this post


Link to post

So, just realised the pinned link at the start of this thread is 3 years old as is Spaceinvaders video! 

Never the less this is all still good stuff.

 

I am however having issues getting it to back up a Linux vm.

 

Its loading its image from a converted image for my HassIO server. 

The log output is -

2019-03-12 12:22 information: started attempt to backup 
HassIO
to /mnt/user/AutoBackups
2019-03-12 12:22 warning: HassIO can not be found on the system. skipping vm.
2019-03-12 12:22 information: finished attempt to backup 
HassIO
to /mnt/user/AutoBackups.

This is what the config looks like... any ideas why it cant find the VM?

 

image.thumb.png.6cd2b39d32a2b3632011d3d6f258ae00.png

 

 

Share this post


Link to post

This is what the config looks like... any ideas why it cant find the VM?


Looks like your VM is named HassOI in unraid template, not HassIO.


Sent from my iPhone using Tapatalk

Share this post


Link to post
11 hours ago, Jorgen said:

 


Looks like your VM is named HassOI in unraid template, not HassIO.


Sent from my iPhone using Tapatalk

 

Good point well made! $£$%

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now