Bug 1359139 - The "creation_status" resources don't work with V3
Summary: The "creation_status" resources don't work with V3
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.0.4
: 4.0.4
Assignee: Juan Hernández
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
Depends On:
Blocks: 1374995
TreeView+ depends on / blocked
 
Reported: 2016-07-22 11:45 UTC by Juan Hernández
Modified: 2021-06-10 11:30 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-26 12:42:17 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 61235 0 master MERGED restapi: Add V3 creation server 2016-07-29 16:21:28 UTC
oVirt gerrit 61708 0 ovirt-engine-4.0 MERGED restapi: Add V3 creation server 2016-07-31 05:12:48 UTC

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.


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