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 1529252

Summary: hammer host create ignores --image-id
Product: Red Hat Satellite Reporter: Beat Rubischon <brubisch>
Component: HammerAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Akhil Jha <akjha>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.12CC: ajambhul, apatel, chrobert, dhlavacd, inecas, kgaikwad, ktordeur, lhellebr, mbacovsk, mhulan, mjia, mshira, oprazak, pcreech, rabajaj, sreber, vijsingh, yferszt
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
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: 2020-04-14 15:54:08 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:
Bug Depends On:    
Bug Blocks: 1316897, 1633345    

Description Beat Rubischon 2017-12-27 10:29:17 UTC
Description of problem:

Provisioning a new VMware based VM from an image using hammer ignores the parameter --image-id, the image from the compute profile is taken.

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

Satellite 6.2.12

How reproducible:

always

Steps to Reproduce:
1. Attach Satellite to vCenter
2. Store templates
3. Provision new machine

hammer host create \
  --name "${vm_hostname}" \
  --ip "${vm_ip}" \
  --organization-id "${orgid}" \
  --domain "${vm_domain}" \
  --subnet "${SubnetName}" \
  --location "${SubnetLocation}" \
  --hostgroup "${vm_hostgroup}" \
  --compute-resource-id "${compute_resource_id}" \
  --compute-profile-id "${compute_profile_id}" \
  --provision-method "image" --image-id "${vm_image_id}" --build true \
  --enabled true --managed true \
  --compute-attributes="cpus=${cpus},\
                        corespersocket=${corespersocket},\
                        cluster=${cluster},\
                        memory_mb=${memory_mb},\
                        guest_id=${ostype},\
                        scsi_controller_type=${scsi_controller_type},\
                        start=1" \
  --interface="managed=true,primary=true,provision=true,compute_name=eth0,\
               compute_type=${compute_type},\
               compute_network=${compute_network},\
               ip=${vm_ip}" \
  --volume="datastore=${datastore},\
            size_gb=${disksize_gb},\
            bootable=true,\
            name='Hard Disk'"

Actual results:

--image-id is ignored, image from --compute-profile-id is taken

Expected results:

--image-id is considered

Additional info:

Comment 8 Ivan Necas 2018-10-09 10:23:00 UTC
Connecting redmine issue https://projects.theforeman.org/issues/6159 from this bug

Comment 10 Shira Maximov 2018-12-23 09:27:10 UTC
*** Bug 1571086 has been marked as a duplicate of this bug. ***

Comment 11 Bryan Kearney 2019-05-20 10:06:03 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/6159 has been resolved.

Comment 12 Oleh Fedorenko 2019-10-08 15:43:51 UTC
*** Bug 1755146 has been marked as a duplicate of this bug. ***

Comment 13 Lukáš Hellebrandt 2020-02-28 12:47:59 UTC
Verified with Sat 6.7 snap 13.

Used reproducer from OP. Created a compute profile with image1, used hammer command with that compute profile and specified image2, image2 was used.

Comment 16 errata-xmlrpc 2020-04-14 15:54: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/RHBA-2020:1455