Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1679225

Summary: Unable to build VM with bootdisk option using hammer-cli-foreman
Product: Red Hat Satellite Reporter: Chris Roberts <chrobert>
Component: APIAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.2CC: ajambhul, apatel, dhlavacd, egolov, kgaikwad, lzap, mbacovsk, mhulan, mmccune, mshira, rabajaj, rvdwees
Target Milestone: 6.6.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: https://projects.theforeman.org/issues/26099
Whiteboard:
Fixed In Version: foreman-1.21.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-22 12:47:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Roberts 2019-02-20 16:10:22 UTC
Description of problem:
Trying to build a vm with hammer using bootdisk build method returns the following:

Error: Option '--provision-method': Value must be one of 'build', 'image'..

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

Satellite 6.4.2
Foreman-1.18.0.40
tfm-rubygem-hammer_cli-0.13.1.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.13.4.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.13.2.3-1.el7sat.noarch

How reproducible:


Steps to Reproduce:
1. Install Satellite 6.4.z
2. Setup hostgroup/compute resource/profile
3. Try to build vm with bootdisk

Actual results:

Error: Option '--provision-method': Value must be one of 'build', 'image'..

Expected results:

VM to build correctly

Additional info:

Patch here:

https://github.com/chris1984/hammer-cli-foreman/commit/a5734584598433f4d7071abc1b2b9fc871a2698b.patch

Comment 5 Bryan Kearney 2019-02-22 17:07:34 UTC
Upstream bug assigned to chrobert

Comment 6 Lukas Zapletal 2019-04-25 13:11:02 UTC
The problem was fixed in Foreman 1.21 and will be part of Satellite 6.6.

https://projects.theforeman.org/issues/25717

Comment 7 Bryan Kearney 2019-04-25 16:07:38 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/26099 has been resolved.

Comment 8 Jitendra Yejare 2019-06-13 08:48:56 UTC
Verified!

@ Satellite 6.6 snap 6

Steps:
----------
1. Installed Satellite.
2. Setup hostgroup/compute resource/profile.
3. Provision a vm with bootdisk option from hammer.


Observation:
--------------

# hammer host create --name vmhammer --compute-resource-id 1 --hostgroup-id 1 --location-id 2 --organization-id 1  --root-password dog8code --compute-profile-id 4 --provision-method bootdisk
Could not create the host

# curl -u admin:changeme -X GET --header "Content-Type:application/json" https://satellite/api/v2/hosts/7 --insecure

{"ip":"xx.xx.xx.xx","ip6":null,"environment_id":1, "name":"vmhammer.hostname.com", "environment_name":"production","last_report":null,"realm_id":null,"realm_name":null,"sp_mac":null,"sp_ip":null,"sp_name":null,"domain_id":1,"domain_name":"hostname.com","architecture_id":1,"architecture_name":"x86_64","operatingsystem_id":1,"operatingsystem_name":"RedHat 7.6","subnet_id":2,"subnet_name":"vmware_subnet","subnet6_id":null,"subnet6_name":null,"sp_subnet_id":null,"ptable_id":102,"ptable_name":"Kickstart default","medium_id":null,"medium_name":null,"pxe_loader":"PXELinux BIOS","build":true,"comment":null,"disk":null,"installed_at":null,"model_id":null,"hostgroup_id":1,"owner_id":4,"owner_name":"Admin User","owner_type":"User","enabled":true,"managed":true,"use_image":null,"image_file":"","uuid":"501ef0d7-8c40-b63b-1f9e-bc64fc6acb49","compute_resource_id":1,"compute_resource_name":"vmware_cr","compute_profile_id":4,"compute_profile_name":"vm_cp","capabilities":["build","image","bootdisk"],"provision_method":"bootdisk"}


Note:
------
1. Please ignore the stdout of hammer create as 'Could not create the host', its puppet issue in my setup. The host successfully provisioned even though this error displayed.
2. Some of the fields i hided from curl output for security reason and bigger output.

Comment 11 errata-xmlrpc 2019-10-22 12:47:16 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-2019:3172