Bug 999640
Summary: | REST-API: Adding and updating host by the API missing supported parameters | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Barak Dagan <bdagan> |
Component: | ovirt-engine-restapi | Assignee: | Yaniv Bronhaim <ybronhei> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Barak Dagan <bdagan> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.3.0 | CC: | acathrow, bazulay, bdagan, bronhaim, iheim, oramraz, pstehlik, Rhev-m-bugs, ybronhei, yeylon |
Target Milestone: | --- | ||
Target Release: | 3.3.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | infra | ||
Fixed In Version: | is15 | 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: | Infra | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Barak Dagan
2013-08-21 18:36:33 UTC
the code was already merged, y., please add ref. to the patches, thanks. The command "add host --name MyHost --address 11.11.11.11 --cluster-name MyCluster --ssh-fingerprint" doesn't specified with which authentication method to use, you should have --ssh-authentication-method parameter, that should be set to "PublicKey".. Please verify that you compiled the latest SDK and reply if it still doesn't work as expected (the expectation are the same as from the UI, if you copied the pk to host's .ssh authorized keys, it should allow adding the host) Setting it back to assigned until verification. If it works as expected, please close it as NOTABUG. (In reply to Yaniv Bronhaim from comment #2) > The command "add host --name MyHost --address 11.11.11.11 --cluster-name > MyCluster --ssh-fingerprint" doesn't specified with which authentication > method to use, you should have --ssh-authentication-method parameter, that > should be set to "PublicKey".. actually according to sdk docs [1], it should be ...ssh-authentication_type [1] Overload 2: @param host.name: string @param host.address: string @param host.ssh.password: string @param host.cluster.id|name: string [@param host.comment: string] [@param host.ssh.port: int] [@param host.ssh.fingerprint: string] [@param host.ssh.authentication_type: string] [@param host.port: int] [@param host.display.address: string] [@param host.storage_manager.priority: int] [@param host.power_management.type: string] [@param host.power_management.enabled: boolean] [@param host.power_management.address: string] [@param host.power_management.username: string] [@param host.power_management.password: string] [@param host.power_management.options.option: collection] { [@ivar option.name: string] [@ivar option.value: string] } [@param host.power_management.pm_proxy: collection] { [@ivar propietary: string] } [@param host.power_management.agents.agent: collection] { [@ivar type: string] [@ivar address: string] [@ivar user_name: string] [@ivar password: string] [@ivar options.option: collection] { [@param option.name: string] [@param option.value: string] } } [@param host.reboot_after_installation: boolean] [@param host.override_iptables: boolean] [@param expect: 201-created] [@param correlation_id: any string] > > Please verify that you compiled the latest SDK and reply if it still doesn't > work as expected (the expectation are the same as from the UI, if you copied > the pk to host's .ssh authorized keys, it should allow adding the host) > > Setting it back to assigned until verification. If it works as expected, > please close it as NOTABUG. Well, it must be an old version of the sdk, currently its authentication_methods, we renamed it everywhere. Your comment also doesn't state how to configure ssh.username btw. (In reply to Yaniv Bronhaim from comment #4) > Well, it must be an old version of the sdk, currently its > authentication_methods, we renamed it everywhere. Your comment also doesn't > state how to configure ssh.username btw. My comment was about the error given - asked for rootpassword when I was trying to use the ssh. According to comment #3, there is no ssh.username option anyway (In reply to Yaniv Bronhaim from comment #2) > The command "add host --name MyHost --address 11.11.11.11 --cluster-name > MyCluster --ssh-fingerprint" doesn't specified with which authentication > method to use, you should have --ssh-authentication-method parameter, that > should be set to "PublicKey".. > > Please verify that you compiled the latest SDK and reply if it still doesn't > work as expected (the expectation are the same as from the UI, if you copied > the pk to host's .ssh authorized keys, it should allow adding the host) > > Setting it back to assigned until verification. If it works as expected, > please close it as NOTABUG. versions: [root@vm-161-51 ~]# rpm -qa | grep rhevm | egrep 'cli|sdk' rhevm-sdk-python-3.3.0.11-1.el6ev.noarch rhevm-cli-3.3.0.5-1.el6ev.noarch Barak, That's an old rhevm-cli version, since 2013-07-15 you should install latest version of both sdk and cli build and check, you will see --ssh-authentication-method and --ssh-username, check the authentication-method to publicKey and try it on. please verify it and close the bug. you can also check with latest ovirt-cli Posted a fix in yaml file. Apparently the issue was correct and important, both updating and adding host operations were declared wrong in the rsdl scheme. All supported new fields should be exposed by the API. The attached patch adds it both to add and update operations. When is this patch going to be merged ? merged Verification failed: is15. Add host works with ssh-authentication_method, however auto complete and help are not updated with the new flag as can be seen below. [RHEVM shell]# info backend version: 3.3 sdk version : 3.3.0.13 cli version : 3.3.0.6 python version : 2.6.6.final.0 [RHEVM shell]# add host --name MyHosy --address MyIp --cluster-id MyCluster (AutoCompletion options:) root_password ssh-authentication_type ssh-fingerprint ssh-password ssh-port [RHEVM shell (connected.161.51)]# add host --name MyHosy --address MyIp --cluster-id MyCluster --ssh-authentication_type publicKey error: "authentication_type" is invalid argument segment. [RHEVM shell (connected.161.51)]# add host --name MyHosy --address MyIp --cluster-id MyCluster--ssh-authentication_method publicKey id : 12b1958a-df60-4196-8b69-4a5a4af9f547 name : MyHosy address : MyIp certificate-organization : certificate-subject : ... ssh-fingerprint : 6e:f7:4b:8b:1e:0c:3c:9c:f4:58:d2:39:36:41:3f:9a ssh-port : 22 status-state : installing help add host: Overload 1: * --name: string * --address: string * --root_password: string * --cluster-id|name: string Overload 2: * --name: string * --address: string * --ssh-password: string * --cluster-id|name: string * [--comment: string] * [--ssh-port: int] * [--ssh-fingerprint: string] * [--ssh-authentication_type: string] As I understand from Michael it must be an old sdk. authentication_type does not exist in last 3.3, 3.3.0 and master branches. Please be sure you check the last one. I'm not sure your authentication_method test worked, your line is: [RHEVM shell (connected.161.51)]# add host --name MyHosy --address MyIp --cluster-id MyCluster--ssh-authentication_method publicKey Without a space after MyCluster, so the cli just ignored the --ssh-authentication_method publicKey and used publicKey as default. As long as you see authentication_type you still use the old sdk 1) The sdk version was given - sdk version : 3.3.0.13. If it's still an old one, please make sure that a new one enters the new build. 2) As for the --ssh-authentication_method. Add host fails if it is omitted: [RHEVM shell]# add host --name MyHost --address MyIP --cluster-id MyCluster error: status: 400 reason: Bad Request detail: Cannot install Host with empty password. and works if the flag is added: [RHEVM shell]# add host --name MyHost --address MyIP --cluster-id MyCluster--ssh-authentication_method publicKey id : f748ba70-5433-4f5b-868c-f42ca7d76e8a name : MyHost address : MyIP ... ssh-fingerprint : 6e:f7:4b:8b:1e:0c:3c:9c:f4:58:d2:39:36:41:3f:9a ssh-port : 22 status-state : installing 3) As can be seen - the help file is not correct as well (#1 ?) barak, according to eedri: build@bob:/export/builds/is15$ ll |grep sdk -rw-rw-r-- 2 build build 486964 Sep 17 11:10 rhevm-sdk-java-1.0.0.22-0.1.el6ev.noarch.rpm -rw-rw-r-- 2 build build 2335328 Sep 17 11:10 rhevm-sdk-java-javadoc-1.0.0.22-0.1.el6ev.noarch.rpm -rw-rw-r-- 2 build build 335748 Sep 17 11:39 rhevm-sdk-python-3.3.0.14-1.el6ev.noarch.rpm so, you're using old sdk. verified on is15: [RHEVM shell]# info backend version: 3.3 sdk version : 3.3.0.14.*final-.1 cli version : 3.3.0.7.*final-.1 python version : 2.6.6.final.0 help add host .... Overload 2: * --name: string * --address: string * --cluster-id|name: string * [--comment: string] * [--ssh-port: int] * [--ssh-fingerprint: string] * [--ssh-authentication_method: string] * [--ssh-user-user_name: string] * [--ssh-user-password: string] auto completion add host .... [RHEVM shell]# add host --name MyHost --address MyIP --cluster-id MyCluster ssh-user-user_name ssh-authentication_method ssh-fingerprint ssh-port ssh-user-password missing authentication ... error: status: 400 reason: Bad Request detail: Cannot install Host with empty password. Backwards compatability .... [RHEVM shell]# add host --name MyHost --address MyIP --cluster-id MyCluster --root_password psswrd Closing - RHEV 3.3 Released Closing - RHEV 3.3 Released Closing - RHEV 3.3 Released |