Bug 1359139

Summary: The "creation_status" resources don't work with V3
Product: [oVirt] ovirt-engine Reporter: Juan Hernández <juan.hernandez>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.1CC: bugs, lleistne, mgoldboi, oourfali, vishal.icreate
Target Milestone: ovirt-4.0.4Keywords: Regression, ZStream
Target Release: 4.0.4Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-26 12:42:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1374995    

Description Juan Hernández 2016-07-22 11:45:26 UTC
In version 3 of the API there is a "creation_status" resource that reports the status of asynchronously created resources. For example, when creating a snapshot the result is looks like this:

  <snapshot id="456" href="/vms/123/snapshots/456">
    ...
    <link rel="creation_status" href="/vms/123/snapshots/456/creation_status/789" rel="creation_status"/>
    ...
  </snapshot>

The link points to a resource that can be used to check the creation of the snapshot, for example:

  GET /vms/123/snapshots/456/creation_status/789

The result should be something like this:

  <creation id="789" href="vms/123/snapshots/456/creation_status/789">
    <status>
      <state>complete</state>
    </status>
  </creation>

The use of this is unreliable, as the operation may be synchronous or asynchronous and return or not the status, depending on the implementation details of the server.

The recommended way to check the status of the creation is to repeatedly retrieve the snapshot and check its "snapshot_status" attribute.

However, we need to preserve the current behaviour in V3 of the API, and currently this doesn't work, so we need to restore it.

Comment 1 Red Hat Bugzilla Rules Engine 2016-07-22 11:45:29 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 3 Lucie Leistnerova 2016-09-07 12:33:34 UTC
if creation cannot begin because engine is doing some complicated action
creation_status returns

    <status>
        <state>in_progress</state>
    </status>

after the snapshot record is created it returns

    <status>
        <state>complete</state>
    </status>

and engine proceed with snapshot creation (snapshot_status = locked)
so it seems ok

verified in ovirt-engine-restapi-4.0.4-0.1.el7ev.noarch

Comment 4 Vishal 2016-09-08 06:57:59 UTC
Ofcourse it is showing in_progress status but once engine started to create snapshot but due to some memory issues or any other issue it can not complete the process and unable to create snapshot now at this time how can I check that snapshot is actually generated or not.So I need that I can check creation status by calling API like API version 3.

Comment 5 Lucie Leistnerova 2016-09-08 08:12:09 UTC
As mentioned by Juan the right way to check, that the shapshot is really ready, is  <snapshot_status>ok</snapshot_status> in the concrete snapshot. The creation_status means that the initial creation command finished.