Bug 1608452

Summary: StreamingAPI - Download snapshot disk for backup purpose using REST API, when VM has already user created snapshots
Product: [oVirt] ovirt-engine Reporter: Ketan <ketan.pachpande>
Component: RestAPIAssignee: Tal Nisan <tnisan>
Status: CLOSED DUPLICATE QA Contact: meital avital <mavital>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.2.4.5CC: abhay.marode, bugs, derez, ketan.pachpande, michal.skrivanek, nsoffer, pchavva, ylavi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-05 15:38:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1609341, 1694070    

Description Ketan 2018-07-25 14:47:54 UTC
Description of problem:
Regarding Image transfer (download) for backup of VM having multiple snapshots already created by user/admin


Version-Release number of selected component (if applicable):
N/A

How reproducible:

Reference articles:

https://bugzilla.redhat.com/show_bug.cgi?id=1405805

https://ovirt.org/develop/release-management/features/storage/backup-restore-disk-snapshots/

For Backup and Recovery of VM:

Scenario for backup:
VM has 1 disk. There are already 5 snapshots of VM created by backup admin,
So we have 5 snapshot disks for this VM.
In order to take backup of this VM using REST API.
First we take snapshot. So there are now 6 snapshots (Say snapshot ID XXX and disk snapshot ID YYY).

According to the article mentioned, each of these 6 snapshot disks need to be downloaded as backup process. and while restoring we have to upload all snapshot disks and then create VM


Actual results:
If we download the disk using disk snapshot ID XXX, then entire disk is not downloaded, but only the delta (between 5th snapshot and 6th snapshot) is downloaded.


Expected results:
For the Backup Purpose, we do not want to retain the chain of snapshots, but we want to download entire disk using snapshot ID XXX, which is created for backup purpose, with REST API (i.e. using proxy_url and signed ticket).

In short, given a disk snapshot ID, entire disk should be downloadable and not just delta.


Additional info:
This would simplify the restore process, because while doing restore, we will need to upload only one disk and create VM out of it.

Comment 1 Michal Skrivanek 2018-07-26 04:37:14 UTC
If you do not need individual snapshots, how is it different from simple download of whole VM, e.g. by simple https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/export_vm_as_ova.py?

Comment 2 Yaniv Lavi 2018-07-26 10:28:31 UTC
You can also merge all the snapshot to the base using qemu-img.

Comment 3 Ketan 2018-07-26 10:38:44 UTC
(In reply to Yaniv Lavi from comment #2)
> You can also merge all the snapshot to the base using qemu-img.

Thanks Yaniv,
But for that, eventually we have to download all snapshot disks to our backup appliance and then use qemu-img. This will increase the size of download than actual size of base image.

Comment 4 Ketan 2018-07-26 11:00:19 UTC
(In reply to Ketan from comment #3)
> (In reply to Yaniv Lavi from comment #2)
> > You can also merge all the snapshot to the base using qemu-img.
> 
> Thanks Yaniv,
> But for that, eventually we have to download all snapshot disks to our
> backup appliance and then use qemu-img. This will increase the size of
> download than actual size of base image.

Also, we will need to first stage everything on backup appliance then take backup of merged disk. But, if we get direct download stream (of view of all merged snapshots), then we can directly pass it to our backup stream. This will not need any staging to be done on our side.

Comment 5 Michal Skrivanek 2018-07-26 19:07:51 UTC
comment #1 then?

Comment 6 AbhayM 2018-07-27 10:16:34 UTC
(In reply to Michal Skrivanek from comment #5)
> comment #1 then?

We don't want to stage the data on machine and then send to tape.
In enterprises, data disks can be huge and staging storage will not be practical for us when we backup data everyday.
It will be good if we ask data on certain extent of snapshot disk and oVirt retrieves the data by traversing the snapshot chain.

Comment 7 Tal Nisan 2018-07-31 11:05:07 UTC
Hi Ketan,
Do you mean that you'd like to download an entire disk starting from snapshot n and downwards? (i.e. collapse all snapshots to one starting from the n snapshot to the base one)

Comment 8 Ketan 2018-07-31 11:11:59 UTC
Yes exactly.

Comment 9 Yaniv Lavi 2018-08-05 15:38:19 UTC
We will be address this request as part of BZ #1217820.
For now I recommend keeping a reference of last backup snapshot as reference point and download the rest of the chain.
For marges of snapshots, please use qemu-img post the backup process.

*** This bug has been marked as a duplicate of bug 1217820 ***