Bug 1502741

Summary: Cannot fence host through REST API: PM is enabled for Host but no Agent type selected
Product: [oVirt] ovirt-engine Reporter: Petr Matyáš <pmatyas>
Component: BLL.InfraAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.0CC: bugs, mperina, oourfali
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: 4.2.0   
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-12-20 11:10:57 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 Petr Matyáš 2017-10-16 15:00:44 UTC
Description of problem:
I'm getting 400 error after running fence from REST API
<action>
    <fault>
        <detail>[Cannot restart Host. Power Management is enabled for Host but no Agent type selected., Cannot fence Host, Host fence is disabled., Cannot restart Host. Fence operation failed.]</detail>
        <reason>Operation Failed</reason>
    </fault>
    <fence_type>restart</fence_type>
    <status>failed</status>
</action>

Version-Release number of selected component (if applicable):
4.2.0-0.0.master.20171013142622.git15e767c.el7.centos

How reproducible:
always

Steps to Reproduce:
1.curl -v -u "$user@$domain:$password" -H "Content-type: application/xml" --insecure -X POST https://$engine_url/ovirt-engine/api/hosts/$host_id/fence -d "<action><fence_type>restart</fence_type></action>"

Actual results:
400 bad request with [Cannot restart Host. Power Management is enabled for Host but no Agent type selected., Cannot fence Host, Host fence is disabled., Cannot restart Host. Fence operation failed.]

Expected results:
successful fence of a host

Additional info:

Comment 2 Petr Matyáš 2017-10-30 17:03:06 UTC
Verified on ovirt-engine-4.2.0-0.0.master.20171029154613.git19686f3.el7.centos.noarch

Comment 3 Sandro Bonazzola 2017-12-20 11:10:57 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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