There is an example that implements all the logic you need for this: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/vm_backup.py
The only thing missing there is the software inside the VM that does the data copy (it could even be a script), which is out of scope or oVirt.



On Sat, Jul 20, 2019 at 5:10 PM <smidhunraj@gmail.com> wrote:
I am following this link.

https://ovirt.org/documentation/admin-guide/chap-Backups_and_Migration.html#backing-up-and-restoring-virtual-machines-using-the-backup-and-restore-api

I got response for

GET /api/vms/4ef8b995-ae58-49d6-8980-ef0fa6688d92/snapshots/1b94ca4e-8c03-4166-8d29-2b831e24b90e/disks HTTP/1.1 Accept: application/xml Content-type: application/xml


Identify disk id "Array
(
    [disk] => Array
        (
            [0] => Array
                (
                    [actual_size] => 0
                    [alias] => GlanceDisk-8700235
                    [format] => cow
                    [image_id] => a42bda58-7556-4ebe-a54d-03dc0a3b1f54
                    [propagate_errors] => false
                    [provisioned_size] => 8589934592
                    [read_only] => false
                    [shareable] => false
                    [sparse] => true
                    [status] => ok
                    [storage_type] => image
                    [wipe_after_delete] => false
                    [snapshot] => Array
                        (
                            [id] => 1b94ca4e-8c03-4166-8d29-2b831e24b90e
                        )

                    [storage_domains] => Array
                        (
                            [storage_domain] => Array
                                (
                                    [0] => Array
                                        (
                                            [id] => ad6aea6d-ff90-457f-98eb-99380949e23a
                                        )

                                )

                        )

                    [name] => GlanceDisk-8700235
                    [description] => CentOS 7 Generic Cloud Image v1711 for x86_64 (8700235)
                    [id] => dded245b-4a73-48b4-a1b4-ba98c37490ad
                )




What is the values that i have to give to the POST request in this api


 POST /api/vms/22222222-2222-2222-2222-222222222222/disks/ HTTP/1.1
 Accept: application/xml
 Content-type: application/xml

 <disk id="11111111-1111-1111-1111-111111111111">
     <snapshot id="11111111-1111-1111-1111-111111111111"/>
     <active>true</active>
 </disk>

to replace
1)vms ===>>         22222222-2222-2222-2222-222222222222
2)disk id           11111111-1111-1111-1111-111111111111
3)snapshot id       11111111-1111-1111-1111-111111111111
_______________________________________________
Devel mailing list -- devel@ovirt.org
To unsubscribe send an email to devel-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/devel@ovirt.org/message/OPXOP7OLFGSJ626VEX7ZMRWG5IWKGPWZ/