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 1571086 - can't use hammer CLI to create a new host in VMware
Summary: can't use hammer CLI to create a new host in VMware
Keywords:
Status: CLOSED DUPLICATE of bug 1529252
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1316897
TreeView+ depends on / blocked
 
Reported: 2018-04-24 05:48 UTC by matt jia
Modified: 2024-01-06 04:25 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-23 09:27:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description matt jia 2018-04-24 05:48:14 UTC
Description of problem:

Can't create a new host by using hammer CLI with Vmware compute options.

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

6.3

How reproducible:

Normal

Steps to Reproduce:

use a hammer command like this 

hammer -d  host create \
  --name "lonlxt90014" \
  --organization "NOMURA" \
  --location "rnd" \
  --hostgroup-id 22 \
  --content-source-id 1 \
  --compute-resource-id 3 \
  --provision-method image \
  --image "RHEL7.4-16042018" \
  --ip xx.xx.xxx.xx
  --subnet-id 1 \
  --managed true \
  --interface="compute_type=VirtualVmxnet3, \
               compute_network=network-44"  \
  --compute-attributes="cpus=1, \
                        corespersocket=2, \
                        memory_mb=2048,
                        cluster='Woking RND', \
                        path='/Datacenters/Woking RND/vm/Discovered virtual machine',guest_id=rhel6_64Guest,hardware_version=vmx-08" \
  --volume="size_gb=60, \
            datastore=ESX_DataStore_ISO, \
            name='Hard disk 1', \
            thin=true, eager_zero=false,mode=persistent"

Actual results:

[ERROR 2018-04-20 07:26:04 Exception] Failed to create a compute lonwst90002.rndeurope.nom (VMware) instance lonlxt90014.nomura.com: undefined method `include?' for nil:NilClass


Expected results:

Creating a new host should see no errors.


Additional info:

If a compute profile is given, it works. UI also works.

Comment 2 matt jia 2018-04-24 07:05:29 UTC
After digging a little bit more, it seems like the image_id is not populated in the /usr/share/foreman/app/models/concerns/orchestration/compute.rb:77:in `setCompute'

As I understand, it should use the given image's id. 

On the other hand, the hammer CLI accepts --image-id. Will this be used as the image id of the compute attributes? SIt seems like the image id can be set with  --compute-attributes, but the doc doesn't mention it.

hammer host create --help

  VMWare:
    --compute-attributes:
      cpus                  Cpu count
      corespersocket        Number of cores per socket (applicable to hardware versions < 10 only)
      memory_mb             Integer number, amount of memory in MB
      cluster               Cluster id from VMware
      path                  Path to folder
      guest_id              Guest OS id form VMware
      scsi_controller_type  Id of the controller from VMware
      hardware_version      Hardware version id from VMware
      start

Comment 5 Marek Hulan 2018-04-26 06:33:24 UTC
I guess tha same would happen for other CRs as well. Matt, could you please try using --image-id as you suggest in comment 2? Also try it as an attribute of compute_attributes hash, I'd expect this should work. I haven't looked to API code yet, but perhaps it's just documentation issue.

Comment 6 matt jia 2018-04-26 07:01:10 UTC
Hi Marek,

Using --image-id gives me the same error. Using it as an attribute of compute_attributes hash works. It would make more sense that the API can
populate the image_id attribute of compute_attributes from the given --image/--image-id.

Comment 9 Shira Maximov 2018-12-05 13:31:23 UTC
I saw the same issue in 
https://bugzilla.redhat.com/show_bug.cgi?id=1633345
please try to add image_id under --compute-attributes section.

Comment 10 Shira Maximov 2018-12-23 09:27:10 UTC

*** This bug has been marked as a duplicate of bug 1529252 ***

Comment 11 Red Hat Bugzilla 2024-01-06 04:25:29 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.