Bug 988027 - Add host with public key with rest fails
Add host with public key with rest fails
Status: CLOSED NOTABUG
Product: oVirt
Classification: Community
Component: ovirt-engine-api (Show other bugs)
3.3
x86_64 Linux
unspecified Severity unspecified
: ---
: 3.3
Assigned To: Yaniv Bronhaim
infra
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-24 10:43 EDT by Noam Slomianko
Modified: 2013-10-24 20:56 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-25 04:50:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Engine log (3.31 MB, text/x-log)
2013-07-24 10:43 EDT, Noam Slomianko
no flags Details

  None (edit)
Description Noam Slomianko 2013-07-24 10:43:55 EDT
Created attachment 777830 [details]
Engine log

Description of problem:
Adding the same host with public key works through the UI while it fails when invoked by the REST PAI

Version-Release number of selected component (if applicable):
3.3

How reproducible:
100%

Steps to Reproduce:
1. add server public key to hosts authorized_keys
2. call for post to /api/hosts with xml :
<host>
<cluster href="/api/clusters/INSERTID" id="INSERTID"/>
<name>bla</name>
<address>INSERT IP</address>
<root_password>1</root_password>
<ssh>
<port>22</port>
<authentication_type>publickey</authentication_type>
</ssh>
</host>

Actual results:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[var  action  add, var  type  host, vds cannot authenticate to server]</detail>
</fault>


Expected results:
Hosts added successfully


Additional info:
In the log it seems as if the engine tries to connect with password and not public key:
"Failed to authenticate session with host bla:
 javax.naming.AuthenticationException: SSH authentication to 'root@10.35.1.17' failed make sure host is configured for password authenticatio"

log attached
Comment 1 Yaniv Bronhaim 2013-07-25 04:50:33 EDT
<authentication_type>publickey</authentication_type> is unknown field, 

<authentication_method> should be used.. the question is why Noam decided to use authentication_type instead. Might be that I wrote it somewhere and it's misleading the user. If someone bumps into such usage please let me know. The full description described here: http://www.ovirt.org/Features/Ssh_Abilities

When the authentication method is not provided the default is to use password authentication, that's the reason for the printed error.

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