Bug 2013696 - [REST API] Incorrect disk snapshot returned for GET api/disks/xxx/disksnapshots/xxx request
Summary: [REST API] Incorrect disk snapshot returned for GET api/disks/xxx/disksnapsho...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.4.9.1
Hardware: All
OS: All
medium
medium
Target Milestone: ovirt-4.5.1
: ---
Assignee: Mark Kemel
QA Contact: Ilia Markelov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-13 14:50 UTC by Mark Kemel
Modified: 2022-06-23 05:54 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-4.5.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-23 05:54:58 UTC
oVirt Team: Storage
Embargoed:
pm-rhel: ovirt-4.5?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 285 0 None open restapi: fix query in single GET disksnapshot request 2022-04-18 13:38:04 UTC
Red Hat Issue Tracker RHV-43802 0 None None None 2021-10-13 14:53:14 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.