5.8. Full Virtual Machine Backups
Full virtual machine backups can be implemented in the following way:
- Take a vm snapshot of the vm targeted for backup.
- 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)
- 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)
- Back up the data.
- 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:
- Navigate to the wanted disk snapshot from REST by accessing
SERVER:PORT:/api/vms/GUID/snapshots/GUID/disks
- 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>
- 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>