Bug 1608392 - Status code from the API for unsupported reduce volume actions (for disk that resides on file based domain for example) is 400 (bad request) instead 409 (conflict)
Summary: Status code from the API for unsupported reduce volume actions (for disk that...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.2.5
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.2.6
: 4.2.6.2
Assignee: shani
QA Contact: Shir Fishbain
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-25 12:34 UTC by Shir Fishbain
Modified: 2018-09-03 15:09 UTC (History)
6 users (show)

Fixed In Version: ovirt-engine-4.2.6.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-03 15:09:34 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)
engine.log (3.33 MB, text/plain)
2018-07-25 12:34 UTC, Shir Fishbain
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 93360 0 master MERGED restapi: Reduce Image For Sharable Disk - CONFLICT 2018-08-02 09:41:12 UTC
oVirt gerrit 93455 0 ovirt-engine-4.2 MERGED restapi: Reduce Image For Sharable Disk - CONFLICT 2018-08-02 12:05:13 UTC

Description Shir Fishbain 2018-07-25 12:34:48 UTC
Created attachment 1470513 [details]
engine.log

Description of problem:
An attempt to reduce of a shareable disk or disk that resides on file SD using REST API, returns a wrong status code - 400 (bad request) and it should return 409 conflict.

Version-Release number of selected component (if applicable):
4.2.5.1-0.1.el7ev
vdsm-4.20.34-1.el7ev.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create a shareable floating disk and attached them to two VMs Attached the disk on block based domain.
2. Call reduce for the disk:
POST method Reduces the size of the disk image in the REST API.
engine_addressti/disks/%disk_id%/reduce 
with request body as follows:
<action>
<async>true</async>
</action>


Actual results:
The status code is 400 Bad Request

Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <async>true</async>
    <fault>
        <detail>[Cannot ${action} Storage. Reduce image is not supported for shareable disks.]</detail>
        <reason>Operation Failed</reason>
    </fault>
    <status>failed</status>
</action>

Expected results:
The status should be 409 conflict.

Additional info:

Comment 3 Shir Fishbain 2018-08-12 08:56:20 UTC
The bug reproduced.
The status code is still 400 Bad Request.
Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <async>true</async>
    <fault>
        <detail>[Cannot ${action} Storage. Reduce image is not supported for shareable disks.]</detail>
        <reason>Operation Failed</reason>
    </fault>
    <status>failed</status>
</action>

Comment 5 Eyal Edri 2018-08-12 15:05:30 UTC
Looking at https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=shortlog;h=refs%2Fheads%2Fovirt-engine-4.2

It seems this patch got in after the tag for 4.2.6 was made, we'll check why the bot moved it to ON_QA prematurely.

Comment 6 Shir Fishbain 2018-08-15 10:36:49 UTC
The bug was fixed.
The status code is 409 Conflict.
Response:
<action>
  <async>true</async>
  <fault>
    <detail>[Cannot ${action} Storage. Reduce image is not supported for shareable disks.]</detail>
    <reason>Operation Failed</reason>
  </fault>
  <status>failed</status>
</action>

ovirt-engine-4.2.6.3-0.0.master.20180813213957.gitf1e5f42.el7.noarch
vdsm-4.20.37-2.gitb789857.el7.x86_64

Comment 7 Raz Tamir 2018-08-28 07:07:46 UTC
QE verification bot: the bug was verified upstream


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