Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1445831

Summary: RestAPI Amend on disk does not work
Product: [oVirt] ovirt-engine Reporter: Avihai <aefrat>
Component: BLL.StorageAssignee: Allon Mureinik <amureini>
Status: CLOSED NOTABUG QA Contact: Raz Tamir <ratamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1.1.8CC: bugs, mlipchuk
Target Milestone: ---Keywords: AutomationBlocker, Regression
Target Release: ---   
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: 2017-04-26 19:39:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1432067    
Attachments:
Description Flags
engine & vdsm logs none

Description Avihai 2017-04-26 15:30:24 UTC
Created attachment 1274286 [details]
engine & vdsm logs

Description of problem:
RestAPI Amend on disk does not work , response is 405 Method Not Allowed .

Version-Release number of selected component (if applicable):
Engine :
ovirt-engine-4.1.2-0.1.el7.noarch

VDSM:
4.19.10.1-1

How reproducible:
100%

Steps to Reproduce:
1.Create DC + cluster on 4.0
2.Create VM + thin disk + snapshot .( all v0.1)
3.Amend via RestAPI.

Actual results:
RestAPI Amend on disk does not work , response is 405 Method Not Allowed .

Expected results:
Amend should work (worked several builds before) 


Additional info:
I tried multiple times at 26.4 ~ 18:15 - 18:19 

Both of the following RestAPI's failed immidiatly with:
"Status Code: 405 Method Not Allowed"

Details on PUT request I did 
Method :
put

URL via storage domain path :
https://storage-ge-04.scl.lab.tlv.redhat.com/ovirt-engine/api/storagedomains/8039e21e-559f-4d58-8ccb-a75138018502/disks

or
URL via disk path:
https://storage-ge-04.scl.lab.tlv.redhat.com/ovirt-engine/api/disks/2110c825-4dea-451f-b4c4-217b8836f9ec

Header:
basic authentication 
Content-type  -> application/xml


BODY: 
<disk>
  <qcow_version>qcow2_v3</qcow_version>
</disk>

Response:
Status Code: 405 Method Not Allowed
Allow: HEAD, DELETE, GET, OPTIONS
Connection: Keep-Alive
Content-Length: 0
Correlation-Id: c9cb9260-3b4e-4a97-923d-ba0254a50138
Date: Wed, 26 Apr 2017 15:19:39 GMT
Keep-Alive: timeout=5, max=100

Comment 1 Maor 2017-04-26 19:39:18 UTC
The amend operation API should not be done directly from on the disk but only from disk attachments (see https://bugzilla.redhat.com/show_bug.cgi?id=1429437#c7)

The valid API should be as follow:
  path: / ovirt-engine/api/vms/<VM-ID>/diskattachments/<disk-attachment-id>/