Bug 1366794

Summary: API V3: can't force delete datacenter
Product: [oVirt] ovirt-engine Reporter: Meni Yakove <myakove>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.2CC: bugs, juan.hernandez, lleistne, mgoldboi, mperina, myakove
Target Milestone: ovirt-4.0.4Keywords: Automation, Regression
Target Release: 4.0.4Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
mgoldboi: planning_ack+
juan.hernandez: devel_ack+
pstehlik: testing_ack+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-26 12:32:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Meni Yakove 2016-08-12 20:41:47 UTC
Description of problem:
Failed to force delete data center (REST API V3) with error:
<fault>
<reason>Operation Failed</reason>
<detail>[Cannot remove Data Center. There is no active Host in the Data Center.]</detail>
</fault>

Version-Release number of selected component (if applicable):
rhevm-4.0.2.6-0.1.el7ev.noarch

Steps to Reproduce:
DELETE to /ovirt-engine/api/datacenters/<DC_ID>

body:
<action>
    <force>true</force>
</action>

Comment 1 Martin Perina 2016-08-14 07:34:05 UTC
Meni, this looks like error message from engine (maybe the is in RemoveDC command) and not REST, could you please test that you are able to force remove the same DC in webadmin?

Comment 2 Meni Yakove 2016-08-14 12:52:35 UTC
I can force remove from UI.

Comment 3 Juan Hernández 2016-08-14 17:53:06 UTC
This is a bug in the V3 compatibility layer, we will fix it. Meanwhile if you need to force a remove a data center you should be able to do it using the "force" parameter:

  DELETE /ovirt-engine/api/datacenters/{datacenter:id}?force=true
  Version: 3

Note that this parameter was added in version 4 of the API, but as version 3 of the API delegates most work to version 4, you can use it with version 3 as well.

Comment 4 Red Hat Bugzilla Rules Engine 2016-08-14 17:53:11 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 5 Juan Hernández 2016-08-14 17:54:04 UTC
I think that even if this is a regression, it isn't a blocker, because there is a workaround.

Comment 6 Red Hat Bugzilla Rules Engine 2016-08-14 17:54: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 7 Lucie Leistnerova 2016-09-08 08:37:19 UTC
forced to delete datacenter with error [Cannot remove Data Center. There is no active Host in the Data Center.] in version 3

verified in ovirt-engine-restapi-4.0.4-0.1.el7ev.noarch