Bug 1350966 - REST-API v3 | Failed to destroy a storage domain
Summary: REST-API v3 | Failed to destroy a storage domain
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.0.1
: 4.0.1.1
Assignee: Juan Hernández
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-28 20:57 UTC by Raz Tamir
Modified: 2016-07-19 06:23 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-19 06:23:36 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
acanan: testing_ack+


Attachments (Terms of Use)
engine and vdsm logs (2.05 MB, application/x-gzip)
2016-06-28 20:57 UTC, Raz Tamir
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 59917 0 master MERGED restapi: Do not ignore storage domain delete "destroy" parameter 2016-06-29 11:35:00 UTC
oVirt gerrit 59927 0 ovirt-engine-4.0 MERGED restapi: Do not ignore storage domain delete "destroy" parameter 2016-06-29 12:05:57 UTC

Description Raz Tamir 2016-06-28 20:57:11 UTC
Created attachment 1173549 [details]
engine and vdsm logs

Description of problem:
When trying to destroy a storage domain (in maintenance) using the REST API the response is:
Status: 409
Reason: Conflict
Detail: [Cannot remove Storage. The relevant Storage Domain is inaccessible.
-Please handle Storage Domain issues and retry the operation.]

Also in the rsdl, the description is odd:

<link href="/ovirt-engine/api/storagedomains/{storagedomain:id}" rel="delete">
<description>delete the specified storage domain in the system</description>
<request>
<http_method>DELETE</http_method>
<headers>
<header required="false">
<name>Correlation-Id</name>
<value>any string</value>
</header>
<header required="true">
<name>Content-Type</name>
<value>application/xml|json</value>
</header>
</headers>
<url>
<parameters_set>
<parameter required="false" type="xs:boolean" context="matrix">
<name>force</name>
<value>true|false</value>
</parameter>
<parameter required="true" type="xs:string" context="matrix">
<name>destroy</name>
<value>the id or name of the host</value>    <---- ?????
</parameter>
<parameter required="false" type="xs:boolean" context="matrix">
<name>async</name>
<value>true|false</value>
</parameter>
</parameters_set>
</url>
<body/>
</request>
</link>


Version-Release number of selected component (if applicable):
ovirt-engine-4.0.0.6-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
Have an operational DC
1. Move to maintenance one of the storage domains in the DC
2. send DELETE request to /api/storagedomains/{sd:id}
<storage_domain>
    <host id="{sd:id}"/>
    <format>false</format>
    <destroy>true</destroy>
</storage_domain>

Actual results:


Expected results:


Additional info:

Comment 1 Juan Hernández 2016-06-29 07:41:46 UTC
What version of the API?

Comment 2 Raz Tamir 2016-06-29 08:24:42 UTC
v3 - see the summary

Comment 3 Red Hat Bugzilla Rules Engine 2016-06-29 08:57:09 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 4 Juan Hernández 2016-06-29 10:14:06 UTC
Thanks Raz, I somehow missed the subject.

The problem is that the V3 is ignoring the "destroy" parameter because there is a typo in the code. We will fix it.

Comment 5 Juan Hernández 2016-06-29 10:18:00 UTC
Note that this only affects V3 of the API, V4 works correctly, if you want to use it as a workaround. Remember that in V4 of the API DELETE operations never have a body, they use parameters instead:

  DELETE /ovirt-engine/api/storagedomains/{sd:id}?host={host:id}&format=false&destroy=true

Comment 6 Raz Tamir 2016-06-29 10:24:32 UTC
Thanks

Comment 7 Raz Tamir 2016-07-03 12:00:02 UTC
Verified on rhevm-4.0.2-0.2.rc1.el7ev.noarch

Comment 8 Sandro Bonazzola 2016-07-19 06:23:36 UTC
Since the problem described in this bug report should be
resolved in oVirt 4.0.1 released on July 19th 2016, it has been closed with a
resolution of CURRENT RELEASE.

For information on the release, and how to update to this release, follow the link below.

If the solution does not work for you, open a new bug report.

http://www.ovirt.org/release/4.0.1/


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