Bug 988027 - Add host with public key with rest fails
Summary: Add host with public key with rest fails
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-api
Version: 3.3
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
: 3.3
Assignee: Yaniv Bronhaim
QA Contact:
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-24 14:43 UTC by Noam Slomianko
Modified: 2013-10-25 00:56 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-07-25 08:50:33 UTC
oVirt Team: ---
Embargoed:


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

Description Noam Slomianko 2013-07-24 14:43:55 UTC
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.1.17' failed make sure host is configured for password authenticatio"

log attached

Comment 1 Yaniv Bronhaim 2013-07-25 08:50:33 UTC
<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.