This is a tool, written in Python, to make online fullbackup's of a VM which runs in an oVirt environment.
It is necessary to install the oVirt Python-sdk. In addition when running Pyhon < 2.7 you need you install argparse.
http://www.ovirt.org/Python-sdk
Take a look at the usage text.
backup.py -h
Take a look at the example "config_example.cfg"
- Create a snapshot
- Clone the snapshot into a new VM
- Delete the snapshot
- Delete previous backups (if set)
- Export the VM to the NFS share
- Delete the VM
00 20 * * * /home/backup/oVirtBackup.git/backup.py -c /home/backup/oVirtBackup.git/config_webserver.cfg -d >> /var/log/oVirtBackup/webserver.log
Logrotate: /etc/logrotate.d/oVirtBackup
/var/log/oVirtBackup/* {
daily
rotate 14
compress
delaycompress
missingok
notifempty
}
Set permissions to config.cfg only for the needed user (chmod 600 config.cfg).
- When the ovirtsdk supports exporting a snapshot directly to a domain, the step of a VM creation can be removed to save some disk space during backup
- http://www.ovirt.org/REST-Api
- http://www.ovirt.org/Python-sdk
- http://www.ovirt.org/Testing/PythonApi
- https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.1/html-single/Developer_Guide/files/ovirtsdk.infrastructure.brokers.html#VMSnapshot
Install tox.
$ tox