Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1351109

Summary: Addition of new hosted-engine host via REST-API parameter is missing.
Product: [oVirt] ovirt-engine Reporter: Nikolai Sednev <nsednev>
Component: BLL.HostedEngineAssignee: Roy Golan <rgolan>
Status: CLOSED WORKSFORME QA Contact: meital avital <mavital>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, dfediuck, msivak, nsednev, rgolan, stirabos, ylavi
Target Milestone: ---Keywords: Triaged
Target Release: ---Flags: ylavi: ovirt-4.0.z?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-30 14:05:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1200469    

Description Nikolai Sednev 2016-06-29 09:36:14 UTC
Description of problem:
Addition of new hosted-engine host via REST-API parameter is missing.
Current REST-API addition of a new hosted-engine-host looks like as:

POST https://FQDN_of_the_engine_here/ovirt-engine/api/hosts/;deploy_hosted_engine=true

Headers:

Header name:     Header value:
Accept	         application/xml
Content-type	 application/xml
 
Body:
<host>
  <name>FQDN_of_the_added_host_here</name>
  <address>FQDN_of_the_added_host_here</address>
  <comment>FQDN_of_the_added_host_here</comment>
  <root_password>somepasswordhere</root_password>
</host>

There is no such parameter as "deploy_hosted_engine" exists, its being added as URL instead of being added as a parameter.
Same is for "undeploy_hosted_engine".


Version-Release number of selected component (if applicable):
Engine:
rhevm-doc-4.0.0-2.el7ev.noarch
rhevm-setup-plugins-4.0.0.1-1.el7ev.noarch
rhevm-spice-client-x64-msi-4.0-2.el7ev.noarch
rhevm-4.0.0.6-0.1.el7ev.noarch
rhev-release-4.0.0-19-001.noarch
rhevm-guest-agent-common-1.0.12-2.el7ev.noarch
rhevm-dependencies-4.0.0-1.el7ev.noarch
rhevm-branding-rhev-4.0.0-2.el7ev.noarch
rhevm-spice-client-x86-msi-4.0-2.el7ev.noarch
rhev-guest-tools-iso-4.0-2.el7ev.noarch
Linux version 3.10.0-327.22.2.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #1 SMP Thu Jun 9 10:09:10 EDT 2016
Linux 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.2 (Maipo)


Host:
mom-0.5.4-1.el7ev.noarch
ovirt-hosted-engine-ha-2.0.0-1.el7ev.noarch
ovirt-vmconsole-host-1.0.3-1.el7ev.noarch
ovirt-setup-lib-1.0.2-1.el7ev.noarch
qemu-kvm-rhev-2.3.0-31.el7_2.16.x86_64
libvirt-client-1.2.17-13.el7_2.5.x86_64
ovirt-engine-sdk-python-3.6.7.0-1.el7ev.noarch
rhev-release-4.0.0-19-001.noarch
ovirt-hosted-engine-setup-2.0.0.2-1.el7ev.noarch
ovirt-vmconsole-1.0.3-1.el7ev.noarch
vdsm-4.18.4-2.el7ev.x86_64
ovirt-host-deploy-1.5.0-1.el7ev.noarch
sanlock-3.2.4-2.el7_2.x86_64
Linux version 3.10.0-327.22.2.el7.x86_64 (mockbuild.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ) #1 SMP Thu Jun 9 10:09:10 EDT 2016
Linux 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 7.2 (Maipo)


How reproducible:
100%

Steps to Reproduce:
1.Deploy hosted-engine over NFS on one host.
2.Add additional hosted-engine-host using REST-API.
3.

Actual results:
deploy_hosted_engine is not added as a parameter in the body, but as continuation of an URL.

Expected results:
deploy_hosted_engine and undeploy_hosted_engine should be parameters inside the body.

Additional info:
Official documentation is missing the addition of hoste-engine-host: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.0/html-single/REST_API_Guide/#sect-REST_API_Guide-Hosts-Memory_Management , please consider on modifying our documentation accordingly.

Comment 1 Martin Sivák 2016-06-29 15:36:39 UTC
I am not sure you all properly understand what is written in the bug. It is possible to request hosted engine deploy just fine, but the argument is passed using the URL (/api/hosts;hosted_engine_deploy=true) and not inside the request body host object. This is a valid pattern in our REST API.

Now, personally I think it is wrong to do it like this too, but this is definitely not High severity as High is defined in BZ help as:

high-impact issues in which the customer's operation is disrupted, but there is some capacity to produce.


And that is not the case at all. This is a cosmetic issue where the argument is passed out of the main object. I am reducing the severity based on this.

Comment 5 Roy Golan 2016-06-30 07:39:59 UTC
This is a part of API design. The request to deploy a host or undeploy is not and attribute of the host, and that's not going to change.

Also, there is no way to interact with the API without authentication.

Unless I'm missing something this bug will be closed by EOD

Comment 6 Nikolai Sednev 2016-06-30 08:18:06 UTC
(In reply to Roy Golan from comment #5)
> This is a part of API design. The request to deploy a host or undeploy is
> not and attribute of the host, and that's not going to change.
> 
> Also, there is no way to interact with the API without authentication.
> 
> Unless I'm missing something this bug will be closed by EOD

My point was only that I'd rather would like to use deploy as a parameter than as continuation of an URL, if that is by design, please close the bug.

Comment 7 Martin Sivák 2016-06-30 08:22:45 UTC
(In reply to Roy Golan from comment #5)
> This is a part of API design. The request to deploy a host or undeploy is
> not and attribute of the host, and that's not going to change.

We should consider it though. REST is about state transfer, so we should interpret a provided HE host flag or HE score field as a request to deploy with HE support to be consistent. Nobody expect an additional argument for POST to be passed in the URL. I have only seen this approach used to control the amount of information (additional subcollections, filtering..), but never to trigger an action.

> Also, there is no way to interact with the API without authentication.

Correct. Nikolai, you logged in to the api using HTTP Basic auth and the browser remembers that. Try accessing the url without the deploy part or do GET and see. It will still work.

> Unless I'm missing something this bug will be closed by EOD

I agree, this is not a bug at all.

Comment 8 Nikolai Sednev 2017-05-11 11:22:44 UTC
Works by design.