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:
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>
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.
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
QE verification bot: the bug was verified upstream