Bug 1785620

Summary: [Hammer] host creation using hostgroup fails
Product: Red Hat Satellite Reporter: Kavita <kgaikwad>
Component: Compute ResourcesAssignee: Shira Maximov <mshira>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: high    
Version: 6.7.0CC: jyejare, mhulan, oprazak, pcreech, vijsingh
Target Milestone: 6.7.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-hammer_cli_foreman-0.19.6.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:28:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kavita 2019-12-20 13:19:34 UTC
Description

Recently, image-id removed from compute-attributes while creating host and instead now user needs to pass --image-id option while creating a host.
However host creation fails when user selects hostgroup.

How Reproducible:
-------------------
Always

Steps:
-------------------

hammer host create --name gceHammered3 --organization-id 1 --location-id 2 --hostgroup-id 1 --provision-method 'image' --volume 'size_gb=13' --managed true --compute-attributes 'machine_type=g1-small,network=default,associate_external_ip=true' --image-id 1 
Could not create the host:
  Missing arguments for 'id'

Actual Behaviour:
-------------------
Host create command gives a failure for 'id'.

Expected Behaviour:
--------------------
1. The host should be provisioned


Note that when I try to send "image-id" key-value inside --compute-attributes and removed --image-id option, I am able to provision a host.

Comment 1 Kavita 2019-12-20 13:19:39 UTC
Created from redmine issue https://projects.theforeman.org/issues/28541

Comment 6 Bryan Kearney 2019-12-31 13:04:36 UTC
Upstream bug assigned to mshira

Comment 7 Bryan Kearney 2019-12-31 13:04:38 UTC
Upstream bug assigned to mshira

Comment 9 Bryan Kearney 2020-01-16 15:04:46 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28541 has been resolved.

Comment 11 Jitendra Yejare 2020-01-21 10:52:00 UTC
Verified for GCE!

@Satellite 6.7 snap 9


Steps:
--------------

# hammer host create --name gceHammered3 --organization-id 1 --location-id 2 --hostgroup-id 1 --provision-method 'image' --volume 'size_gb=13' --managed true --compute-attributes 'machine_type=g1-small,network=default,associate_external_ip=true' --image-id 1
Host created.


Observation:
------------------
This time(snap 9), the image-id option just works perfectly fine along with the host group and without passing UUID of an image in computing attributes.


Note:
-----------------
The BZ status of Verification is dependent on other Compute Resources results and behaviors.

Comment 12 vijsingh 2020-01-21 10:56:12 UTC
Verified for AzureRM:


Steps:

____________________________
[root@qe-sat6-bm1 ~]# hammer host create --name hammerclihg2 --hostgroup HG1 --location-id 2 --organization-id 1 --image img_ft --provision-method image --operatingsystem-id 1
Host created.

[root@qe-sat6-bm1 ~]# hammer host create --name hammerclihg3 --hostgroup HG1 --location-id 2 --organization-id 1 --image img_ud --provision-method image --operatingsystem-id 1 --root-password dog8code
Host created.


[root@qe-sat6-bm1 ~]# hammer host create --name hammerclihg6 --hostgroup HG2 --location-id 2 --organization-id 1 --image img_ud --provision-method image --compute-profile-id 1  --operatingsystem-id 1 --root-password dog8code
Host created.
____________________________

Observation:
 - Able to provision VM using HG with '--image-id' option and without passing any UUID of an image in compute_attributes.

Comment 13 Lukáš Hellebrandt 2020-01-21 15:30:57 UTC
Verified for RHEV using similar steps.

Will verify the whole BZ once I test with VMWare tomorrow.

Comment 14 Lukáš Hellebrandt 2020-01-22 14:56:36 UTC
Verified also with VMWare, using Sat 6.7 snap 10. Also tested PXE based provisioning for regressions and found none. Together, we verified this BZ for 4 different CR types which is enough.

Comment 18 errata-xmlrpc 2020-04-14 13:28:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454