5.8. Full Virtual Machine Backups

Full virtual machine backups can be implemented in the following way:
  1. Take a vm snapshot of the vm targeted for backup.
  2. Back up the vm configuration at the time of the snapshot (Disks configuration can be backed up as well if needed) - (added capability to Red Hat Enterprise Virtualization Manager as part of the Backup API)
  3. Attach the disk snapshots that were created in (1) to the virtual appliance for data backup - (added capability to Red Hat Enterprise Virtualization Manager as part of the Backup API)
  4. Back up the data.
  5. Detach the disk snapshots that were attached in (4) from the virtual appliance - (added capability to Red Hat Enterprise Virtualization Manager as part of the Backup API)
Here is an example of the act of backing up a virtual machine:
  1. Navigate to the wanted disk snapshot from REST by accessing
    SERVER:PORT:/api/vms/GUID/snapshots/GUID/disks
    
  2. POST the copied disk with the disk id and the snapshot ID:
    http://SERVER:PORT/api/vms/GUID/disks/
    
    When creating a disk you will have to pass the disk ID and the snapshot ID such as the following example:
    <disk id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
      <snapshot id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"/>
    </disk>
    
  3. After copying the data from the disk detach the disk snapshot from the VM using the REST with the following parameters:
    Method = DELETE
    URL indicates to the specific disk in the VM: 
         http://SERVER:PORT/api/vms/GUID/disks/GUID
    Body=<action><detach>true</detach></action>