Bug 1253338 - [API] restore snapshot via API results in snapshot being stuck on "In preview" status
[API] restore snapshot via API results in snapshot being stuck on "In preview...
Product: oVirt
Classification: Community
Component: ovirt-engine-core (Show other bugs)
Unspecified Unspecified
unspecified Severity urgent
: ---
: 3.6.0
Assigned To: Moti Asayag
sefi litmanovich
: AutomationBlocker, Regression
Depends On:
  Show dependency treegraph
Reported: 2015-08-13 09:54 EDT by sefi litmanovich
Modified: 2016-02-10 14:35 EST (History)
10 users (show)

See Also:
Fixed In Version: 3.6.0-12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-04 06:40:39 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
restore snapshot relevant part in engine log (32.94 KB, text/plain)
2015-08-13 09:54 EDT, sefi litmanovich
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 45547 master MERGED engine: Revert JPA Never
oVirt gerrit 45586 ovirt-engine-3.6 MERGED engine: Revert JPA Never

  None (edit)
Description sefi litmanovich 2015-08-13 09:54:35 EDT
Created attachment 1062591 [details]
restore snapshot relevant part in engine log

Description of problem:

trying to restore snapshot via rest api results in snapshot being stuck on "In preview" status

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


How reproducible:


Steps to Reproduce:
1. Create a vm with disk
2. Create snapshot.
3. restore snapshot:

POST https://{engin}/ovirt-engine/api/vms/{vm_id}/snapshots/{snapshot_id}/restore



Actual results:

snapshot is stuck on "In preview" mode forever.

Expected results:

snapshot moves to "In previewe" and shortly after commits the snapshot.
Comment 1 Juan Hernández 2015-08-17 13:09:41 EDT
The "restore" operation is performed by the RESTAPI in two sequential steps:

1. The RESTAPI runs the "TryBackToAllSnapshotsOfVm" command and waits for the completion of the job by this operation.

2. The RESTAPI runs the "RestoreAllSnapshot" action.

What happens in this case is that the job returned by the "TryBackToAllSnapshotsOfVm" command never finishes, it is always in status "STARTED", thus the RESTAPI will never get out of step 1.

Note also that ideally the RESTAPI shouldn't coordinate two backend actions, like in this case. Consider adding a single backend command that performs these two steps.
Comment 2 Juan Hernández 2015-08-18 04:30:14 EDT
Moving to "infra", as it looks like a generic caching issue in the DAO layer. See bug 1254230, which is probably a duplicate.
Comment 3 sefi litmanovich 2015-09-20 09:32:19 EDT
Verified according to steps in the description.
Comment 4 Sandro Bonazzola 2015-11-04 06:40:39 EST
oVirt 3.6.0 has been released on November 4th, 2015 and should fix this issue.
If problems still persist, please open a new BZ and reference this one.

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