Bug 2013697

Summary: [REST API] Incorrect disk_snapshot parent href in api/disks/xxx/disksnapshots
Product: [oVirt] ovirt-engine Reporter: Mark Kemel <mkemel>
Component: RestAPIAssignee: Artiom Divak <adivak>
Status: CLOSED NEXTRELEASE QA Contact: Ilia Markelov <imarkelo>
Severity: low Docs Contact:
Priority: medium    
Version: 4.4.9.1CC: ahadas, bugs, dfodor, sfishbai
Target Milestone: ovirt-4.5.3Flags: sbonazzo: ovirt-4.5-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.5.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-19 14:30:59 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:

Description Mark Kemel 2021-10-13 14:50:54 UTC
Description of problem:
When requesting disk snapshots of a disk (ovirt-engine/api/disks/{diskid}/disksnapshots or ovirt-engine/api/disks/{diskid}/disksnapshots/{snapshotid}), the 'parent' element holds incorrect href - disk href instead of the disksnapshot href.

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


How reproducible:
100%

Steps to Reproduce:
1. Create at least one disk snapshot
2. Issue REST API request ovirt-engine/api/disks/{diskid}/disksnapshots?include_active&include_template or ovirt-engine/api/disks/{diskid}/disksnapshots/{snapshotid}

Actual results:
On disk snapshots that have the <parent> element, the href attribute will be like this:
<parent href="/ovirt-engine/api/disks/71b3d7c7-19ee-4b14-adb5-17422e1e7407" id="af16f154-f973-46ee-9683-5c456e3cb51e"/>

Expected results:
<parent href="/ovirt-engine/api/disks/71b3d7c7-19ee-4b14-adb5-17422e1e7407/disksnapshots/af16f154-f973-46ee-9683-5c456e3cb51e" id="af16f154-f973-46ee-9683-5c456e3cb51e"/>

Additional info:
Note that when 'include_template' flag is requested, and one of the disk_snapshots have a template disk as a parent (as described here https://bugzilla.redhat.com/1900597) - this template disk snapshot belongs to another disk, thus the href should be built accordingly.

Comment 3 Michal Skrivanek 2022-04-11 08:50:07 UTC
No update for a while, didn't make it in time for 4.5, closing

Comment 4 Ilia Markelov 2022-06-15 12:09:08 UTC
Failed verification.

Still getting the wrong result for ovirt-engine/api/disks/{diskid}/disksnapshots request on engine-4.5.1.1-0.14.el8ev

Comment 5 Casper (RHV QE bot) 2022-09-19 14:30:59 UTC
This bug has low overall severity and passed an automated regression suite, and is not going to be further verified by QE. If you believe special care is required, feel free to re-open to ON_QA status.