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.
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.
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
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.
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.
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.