Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2013696

Summary: [REST API] Incorrect disk snapshot returned for GET api/disks/xxx/disksnapshots/xxx request
Product: [oVirt] ovirt-engine Reporter: Mark Kemel <mkemel>
Component: RestAPIAssignee: Mark Kemel <mkemel>
Status: CLOSED CURRENTRELEASE QA Contact: Ilia Markelov <imarkelo>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4.9.1CC: ahadas, bugs, dfodor, michal.skrivanek, sfishbai
Target Milestone: ovirt-4.5.1Flags: pm-rhel: ovirt-4.5?
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: ovirt-engine-4.5.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-23 05:54:58 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:16 UTC
Description of problem:
On disks that have more than one snapshots, the REST API request ovirt-engine/api/disks/{diskid}/disksnapshots/{snapshotid} not necessarily return the requested disk snapshot.

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


How reproducible:
100%

Steps to Reproduce:
1. Create more than 1 snapshots for a disk
2. The request ovirt-engine/api/disks/{diskid}/disksnapshots?include_active returns all the snapshots of this disk, including Active VM snapshot
3. Request these snapshots one by one ovirt-engine/api/disks/{diskid}/disksnapshots/{snapshotid}

Actual results:
Only one of the snapshots is returned for any request with any {snapshotid}

Expected results:
The requested snapshot should be returned

Additional info:
The bug is in BackendDiskSnapshotResource::get. GetAllDiskSnapshots query is used, which returns all the disk snapshots. Need to use another query that will return the single requested snapshot

Comment 3 Michal Skrivanek 2022-04-11 08:59:26 UTC
any update/intention to fix? if not please close.

Comment 4 Mark Kemel 2022-04-17 18:30:39 UTC
Posted a PR 
https://github.com/oVirt/ovirt-engine/pull/283

Comment 5 Ilia Markelov 2022-06-09 11:14:31 UTC
Verified.

Requested snapshots were returned as expected.

Versions:
engine-4.5.1-0.62.el8ev
vdsm-4.50.1.1-1.el8ev.x86_64

Comment 6 Sandro Bonazzola 2022-06-23 05:54:58 UTC
This bugzilla is included in oVirt 4.5.1 release, published on June 22nd 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.1 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.