Red Hat Bugzilla – Bug 1018554
[restapi] undo snapshot preview through restapi commits snapshot instead of undoing preview
Last modified: 2016-02-10 14:20:13 EST
Created attachment 811690 [details]
engine and vdsm logs
Description of problem:
Attempting to undo a snapshot preview through RESTAPI commits that snapshot, removing any snapshots that were taken after the snapshot was originally created, just like committing the snapshot preview, instead of returning to the "Active before preview" snapshot and having all snapshots available.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a vm with a disk and take 2 snapshots
2. preview the first snapshot
3. Send REST post request to the following url:
first snapshot is no longer previewed but second snapshot disappears
second snapshot should be available
The problem is in the REST and does not reproduce in the GUI.
A previewed snapshot has two rows in the volumes DB table, one is active the other is the previewed volume.
Since the user send the original snapshot id, the REST delegates it to the engine and cause the commit of the first snapshot.
The fix should be in the REST, by getting the other volume id (The temporary previewed volume) and send the correct volume id to the engine.
This API was introduced by patch http://gerrit.ovirt.org/#/c/11163/
This functionality was broken from the day it was introduced and should be reverted.
The exception is occuring because undo has been invoked on the wrong snapshot. It needs to be invoked on the snapshot that shows a description of "Active VM before preview". When undo is invoked from webadmin, the front end code takes care of choosing the right snapshot. When invoking from rest api please invoke the undo action on the snapshot with <type>preview</type>.
*** This bug has been marked as a duplicate of bug 867339 ***
this feature was reverted due to lack of appropriate infrastructure in the engine,
it will be reconsidered in one of the following versions, for more details please
follow RFE bug 867339.