Bug 1258247

Summary: [Per host CHAP] Modifying CHAP credentials fails with "Could not find resource for relative"
Product: Red Hat Enterprise Virtualization Manager Reporter: Elad <ebenahar>
Component: ovirt-engineAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Elad <ebenahar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: acanan, amureini, bazulay, gklein, juan.hernandez, lsurette, rbalakri, Rhev-m-bugs, tnisan, yeylon, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.6.0-11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 1186812    

Description Elad 2015-08-30 13:58:59 UTC
Description of problem:
An attempt to modify the CHAP credentials for a specific host via REST API using the storageconnectionextension tag under hosts fails with the following error:


JBWEB000065: HTTP Status 404 - RESTEASY001185: Could not find resource for relative : /hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions of full path: https://10.35.161.53/api/hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions

JBWEB000309: type JBWEB000067: Status report

JBWEB000068: message RESTEASY001185: Could not find resource for relative : /hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions of full path: https://10.35.161.53/api/hosts/15d9db95-f353-4f3d-a17b-cad598381de6/storageconnectionextensions

JBWEB000069: description JBWEB000124: The requested resource is not available.
JBoss Web/7.5.10.Final-redhat-1


Version-Release number of selected component (if applicable):
rhevm-3.6.0-0.12.master.el6.noarch

How reproducible:
Always

Steps to Reproduce:
Storage server with CHAP support
1. Discover and login to a storage server with CHAP credentials
1. Modify the credentials of a specific host in the storage server
2. Modify the credentials in RHEV via REST API as follows:

POST under:

https://engine-add/api/hosts/%host_id%/storageconnectionextensions

<storageconnectionextension>   
 <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</target>
    <username>elad</username>
    <password>456456456456</password>
</storageconnectionextension>



Actual results:
Modification fails with the mentioned exception appears only in the response body. No indication for the failure in engine log.
In server log all I got is:

2015-08-30 13:29:17,050 INFO  [org.apache.commons.httpclient.HttpMethodBase] (org.ovirt.thread.pool-7-thread-48) Response content length is not known



Expected results:
CHAP modification for a specific host should work

Additional info:
sosreport from engine:
http://file.tlv.redhat.com/ebenahar/sosreport-elad-rhevm3.scl.lab.tlv.redhat.com-20150830135444.tar.xz

Comment 1 Tal Nisan 2015-08-30 14:01:00 UTC
Juan, from checking the setup it seems that the relative link to the extensions appears under the host but once you try to GET it it ends with a 404, on master it works correctly, any idea why?

Comment 2 Juan Hernández 2015-08-31 08:57:25 UTC
This happens because the version of Resteasy included in JBoss EAP doesn't like the fact that the resource implementation for connection extensions contains an incorrect @Path annotation, it must be removed.

Comment 3 Juan Hernández 2015-08-31 08:58:29 UTC
Tal, please take the bug or assign it to someone in your team, so that it will be backported to the 3.6 branch. I already verified that the proposed fix solves the problem both in the master branch and in the 3.6 branch.

Comment 4 Juan Hernández 2015-08-31 09:07:49 UTC
By the way, the instructions to reproduce that appear in the description of the bug aren't correct: the XML tag should be "storage_connection_extension", not "storageconnectionextension". I used a the following script to reproduce:

---8<---
#!/bin/sh -ex

url="https://engine36.example.com/ovirt-engine/api"
user="admin@internal"
password="..."

curl \
--verbose \
--cacert /etc/pki/ovirt-engine/ca.pem \
--user "${user}:${password}" \
--request POST \
--header "Content-Type: application/xml" \
--header "Accept: application/xml" \
--data '
<storage_connection_extension>   
  <target>iqn.2015-06.com.example:mytarget</target>
  <username>foo</username>
  <password>bar</password>
</storage_connection_extension>
' \
"${url}/hosts/6bc0bc71-7201-4fcb-84d8-e5db1397144a/storageconnectionextensions"
--->8---

Comment 5 Tal Nisan 2015-08-31 09:21:28 UTC
I will take it from here, thanks a lot Juan.

Comment 6 Elad 2015-09-22 09:35:59 UTC
Adding a storage connection under storageconnectionextensions for a host now works as expected

Verified using:
rhevm-3.6.0-0.16.master.el6.noarch
rhevm-restapi-3.6.0-0.16.master.el6.noarch

Comment 8 Allon Mureinik 2016-03-10 10:41:23 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

Comment 9 Allon Mureinik 2016-03-10 10:46:36 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE

Comment 10 Allon Mureinik 2016-03-10 12:03:11 UTC
RHEV 3.6.0 has been released, setting status to CLOSED CURRENTRELEASE