oVirtBackup: online full-backup tool for oVirt

I wrote the last days a little Tool to get in touch with Python (first time) and solved a little backup problem since I switched from vmware esxi to oVirt.

The Tool creates a full backup and export it to a NFS share (export domain).


  • NFS share which are connected to the ovirt-engine where the backups will be stored


  • Create a snapshot
  • Clone the snapshot into a new VM
  • Delete the snapshot
  • Export the VM to the NFS share
  • Delete the VM


  • It is possible to set the age in days how long the backup should be hold

You can find it on github:


WARNING: Wrong configuration can delete your existent backup !!! Please test it first with a new clean VM !!!

Note: With the current Python API (ovirtsdk) it is not possible to export a snapshot directly to the NFS share so it is necessary to create first a temporary VM

3 thoughts on “oVirtBackup: online full-backup tool for oVirt”

  1. Hi Gregor

    I’m trying to use the script, but i get this message:

    Traceback (most recent call last):
    File “/opt/oVirtBackup/backup.py”, line 127, in
    File “/opt/oVirtBackup/backup.py”, line 88, in main
    VMTools.wait_for_vm_operation(api, config, “Cloning”, vm_from_list)
    File “/opt/oVirtBackup/vmtools.py”, line 105, in wait_for_vm_operation
    while str(api.vms.get(vm_name + config.get_vm_middle() + config.get_vm_suffix()).get_status().state) != ‘down’:
    AttributeError: ‘NoneType’ object has no attribute ‘get_status’

    In the log file I get:

    Start backup for: Ansible
    Snapshot creation started …
    Snapshot operation(creation) in progress …
    Snapshot created
    Clone into VM started …
    Cloning in progress …

    My .cfg is here:


    # A list of names which VM’s should be backed up
    vm_names: [“Ansible”]

    # Middle part for the exported VM name

    # Description which should be set to the created snapshot
    snapshot_description=Snapshot creado por el script

    # Url which you use to connect to your engine

    # Username to connect to the engine

    # Password for the above user

    # Name of the NFS Export Domain

    # Timeout in seconds to wait during long time operations (snapshot creation, snapshot deletion, …)

    # The name of the cluster where the VM should be cloned

    # How long backups should be keeped, this is in days

    # If set to “True” no creation, deletion and other operations will be executed

    I Get this message from the oVirt Engine:

    1) Snapshot ‘Snapshot creado por el script’ deletion for VM ‘Ansible’ was initiated by admin@internal.

    2) Snapshot ‘Snapshot creado por el script’ deletion for VM ‘Ansible’ has been completed.

    3) VM Ansible_BACKUP_1445893715 creation was initiated by admin@internal.

    4) VDSM srvovirt03.cnsc.net command failed: low level Image copy failed

    5) VDSM command failed: Image does not exist in domain: u’image=7c0d6bb9-30d4-46f4-a239-327cc6557c9b, domain=27ee47c4-6106-47fc-bd74-d482fe1de653′

    6) Failed to complete VM Ansible_BACKUP_1445893715 creation.

    It’s oVirt 3.6 RC 3

    Thanks for any idea

Leave a Comment

Your email address will not be published. Required fields are marked *