Issue
At present OnApp supports two backup types: normal and incremental. Note, having these types mixed within the same cloud is not supported in 6.x versions yet.
As for the Linux VMs, both of these types are known as file-level backups. In some circumstances, it becomes more efficient to backup the entire disk rather than access the file system.
Pros of disk image-based backups
The backup tool never looks at the files and it allows bypassing the file systems that might be in an inconsistent state or a large number of small files that may degrade the backup performance, etc.
Cons of disk image-based backups
The backup tool reads the entire disk not depending on the amount of actual data. It might increase the time for taking backups for the large disks but with low utilization.
The backup size may significantly increase compared to the one taken using the file-level method.
Incremental backups are not supported.
Actually, the disk image-based backup technique is already implemented in OnApp but only used for the virtual servers built from ISO/OVA.
Environment
OnApp 6.x
Backup type: Normal
Guest's OS: Linux
Resolution
When taking normal backups, a compressed tar archive is created. The idea is to wrap the tar tool up without changing the existing automation code.
The wrapper uses the dd utility to take a raw disk image. It supports compression (default level) and sparse options. It can work with old backups taken with native tar utility, regular onapp templates, custom templates.
The wrapper tries to install pigz (unless it's found) when the compression is enabled. It's a more sufficient tool because of the multithreading support.
You can find some information on how to install pigz on the CR in the following article:
Download the tar wrapper and install it on the backup server or hypervisors in case there are no backup servers in the cloud.
Run these commands on the compute resources:
#TAR_PATH=`which tar`
#mv $TAR_PATH $TAR_PATH.original
#curl -s https://bitbucket.org/onappcore/support-tools-public/raw/630fbfcd60926f5e27f9f93a21d3d2a2510f37e8/tar-wrp.sh > $TAR_PATH
#chmod +x $TAR_PATH
Change the following variables in the script depending on your needs and onapp configuration:
TMPL_PATH='/onapp/templates/'
BKP_PATH='/onapp/backups/'
DD_BS='8M'
#The backup mode is always sparse unless compression is enabled.
SPARSE=false # [true|false]
#Compression control. It affects only backup mode as other modes are auto-detected.
COMPR=true # [true|false]
#Bypass the wrapper and run native tar.
WRP_ENABLED=true # [true|false]
##
To make the changes permanent on CloudBoot compute resources:
On the Control Panel locate the compute resource's tftpboot config directory by its MAC address and copy the tar wrapper into it.
cp#cp tar-wrp.sh /tftpboot/images/centos5/diskless/snapshot/<mac_address>/
Then add these commands to the compute resource custom config:
#TAR_PATH=`which tar`
#mv $TAR_PATH $TAR_PATH.original
#cp /.rw/tar-wrp.sh $TAR_PATH
#chmod +x $TAR_PATH
Run the above commands manually or reboot the CloudBoot CR to apply the changes.
When the wrapper is enabled you will see appropriate messages in the backup transaction logs.
As for the Windows VMs: such a backup option is also available. Please refer to this article for more information on this matter: