mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-01 05:47:01 +03:00
3dfd53df1c
This commit implements the in-place restore of VM backups. Selected VM disks will be replaced with the specified backup: * A new API call has been added to the XML-RPC API (`one.vm.restore`) with the following arguments: - VM ID to be restored, needs to be in **poweroff** state - IMAGE ID of the backup to restore - INCREMENT ID, only for incremental backups, the increment to use (defults to -1 to use the last increment available) - DISK ID of the disk to restore (defaults to -1 to restore all VM disks) * Datastore drivers needs to implemente a new operation `ls`. This new operation takes the VM, image information of the backup and datastore information and returns the restore URL for the disks in the backup. * This commit includes the implementation for qcow2 and ssh drivers, ceph will be implemented in a separated PR. The new driver action is `restore host:vm_dir vm_id img_id inc_id disk_id` * The restore operation is performed in a new state `PROLOG_RESTORE` rendered as `RESTORE` and `rest` in short form. State in in RSuntone. TODO: - Remove any existing VM snapshot (system/disk) in the VM. Note that snapshots are not included in a backup. - Ceph drivers - JAVA, GO Lang API bindings - Sunstone interface, new state and new operation. Review new state in RSuntone. co-authored-by: Pavel Czerny <pczerny@opennebula.io>