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 1649927 - Unable to use Hammer to provision a VMware VM from Image with Storage Pod
Summary: Unable to use Hammer to provision a VMware VM from Image with Storage Pod
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: Nightly
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.7.0
Assignee: satellite6-bugs
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-14 19:39 UTC by Chris Roberts
Modified: 2021-05-04 14:53 UTC (History)
21 users (show)

Fixed In Version: hammer_cli_foreman-0.18.0
Doc Type: Known Issue
Doc Text:
Using the Hammer CLI, there are problems provisioning from an image using the VMware compute resource. As a workaround, specify the image_id in the `--compute-attributes` option in the Hammer CLI, for example, `--compute-attributes="image_id='500d7545-8e17-ce0f-4011-79c5c2c88e49'`.
Clone Of:
Environment:
Last Closed: 2020-04-14 15:54:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
PRoduction error log (17.27 KB, text/plain)
2019-08-28 09:20 UTC, Sanket Jagtap
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github theforeman hammer-cli-foreman pull 404 0 'None' closed Fixes #6159 - move image_id to be under the compute_attributes 2020-10-19 13:17:01 UTC
Red Hat Product Errata RHBA-2020:1455 0 None None None 2020-04-14 15:54:23 UTC

Description Chris Roberts 2018-11-14 19:39:31 UTC
Description of problem:
Trying to provision a VM from an image we get the following error:

Could not create the host:
  Failed to create a compute VMware (VMware) instance test-host3.toledo.satellite.lab.eng.rdu2.redhat.com: InvalidArgument: A specified parameter was not correct: spec.diskLocator[].datastoreId


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

Foreman 1.21
Katello 3.10

Expected results:
VM to provision correctly

Additional info:

The --help shows the wrong parameter:

  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
      firmware              automatic/bios/efi
      cluster               Cluster ID from VMware
      resource_pool         Resource Pool 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
      add_cdrom             Must be a 1 or 0, Add a CD-ROM drive to the virtual machine
      cpuHotAddEnabled      Must be a 1 or 0, lets you add memory resources while the machine is on
      memoryHotAddEnabled   Must be a 1 or 0, lets you add CPU resources while the machine is on
      start                 Must be a 1 or 0, whether to start the machine or not
      annotation            Annotation Notes

    --interface:
      compute_type        Type of the network adapter, for example one of:
                            VirtualVmxnet3,
                            VirtualE1000
                          See documentation center for your version of vSphere to find more details about available adapter types:
                            https://www.vmware.com/support/pubs/
      compute_network     Network ID from VMware

    --volume:
      name
      storage_pod         Storage Pod ID from VMware
      datastore           Datastore ID from VMware
      size_gb             Integer number, volume size in GB
      thin                true/false
      eager_zero          true/false
      mode                persistent/independent_persistent/independent_nonpersistent

Here is my command:

hammer> host create --name test-host3 --organization "Default Organization" --location "Default Location" --hostgroup RHEL7_redhat00 --compute-resource VMware --provision-method image --image RHEL7-Image --enabled true --managed true --compute-profile Test-VM --operatingsystem-id 3 --compute-attributes="start=1" --volume "name=harddisk1,storage_pod=Synology-Cluster,size_gb=50,thin=true,eager_zero=false,mode=persistent" --interface "managed=true,compute_type=VirtualVmxnet3,type=interface,domain_id=1,identifier=ens192,ip=10.8.106.200,subnet_id=1,primary=true,compute_network='VLAN-207'"

We can see from a build from the UI that storage_pod should be storagepod

volumes\":[{\"sizeGb\":50,\"datastore\":\"\",\"storagePod\":\"Synology-Cluster\"

Comment 4 Chris Roberts 2019-07-18 15:25:20 UTC
Fixed in:

https://github.com/fog/fog-vsphere/pull/217

Comment 6 Sanket Jagtap 2019-08-28 09:19:18 UTC
hammer> compute-resource image list --compute-resource-id 2
---|-------------|------------------|----------|-------------------------------------
ID | NAME        | OPERATING SYSTEM | USERNAME | UUID                                
---|-------------|------------------|----------|-------------------------------------
1  | rhel76cloud | RedHat 7.7       | root     | 503e09f0-955b-b2b8-930a-d9af42b1f978
2  | rhel76base  | RedHat 7.7       | root     | 503ea866-c3ce-7195-5757-75a6bb97b92e
---|-------------|------------------|----------|-------------------------------------
hammer> host create --compute-attributes="cpus=2,corespersocket=2,memory_mb=4028,firmware=bios,add_cdrom=0,cpuHotAddEnabled=0,memoryHotAddEnabled=0,resource_pool=Resources,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=ParaVirtualSCSIController,hardware_version=Default,start=1,annotation='This is great'" --compute-resource-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --interface="compute_network=dvportgroup-85,compute_type=VirtualVmxnet3" --location="Default Location" --name="cluster-hammer" --organization="Default Organization" --provision-method="image" --image-id 2  --root-password="dog8code" --volume="name=Hard disk,size_gb=10,thin=true,eager_zero=false,storage_pod=iSCSI-Cluster,mode=persistent"
Could not create the host:
  Failed to create a compute VMware (VMware) instance cluster-hammer.<domain>: undefined method `include?' for nil:NilClass


PFA log

Comment 7 Sanket Jagtap 2019-08-28 09:20:54 UTC
Created attachment 1608915 [details]
PRoduction error log

Comment 8 Marek Hulan 2019-09-03 06:30:23 UTC
Sanket, this looks more like a BZ 1571040. You probably need to specify (vmware template) path in different format, UUID should work. Can you please take a look?

Comment 9 Sanket Jagtap 2019-09-03 13:35:41 UTC
tried with passing different issue, still errored, 

hammer> compute-resource image list --compute-resource-id 2
---|------------|------------------|----------|-------------------------------------
ID | NAME       | OPERATING SYSTEM | USERNAME | UUID                                
---|------------|------------------|----------|-------------------------------------
1  | rhel76base | RedHat 7.7       | root     | 503ea866-c3ce-7195-5757-75a6bb97b92e
---|------------|------------------|----------|-------------------------------------
hammer>  host create --compute-attributes="cpus=2,corespersocket=2,memory_mb=4028,firmware=bios,add_cdrom=0,cpuHotAddEnabled=0,memoryHotAddEnabled=0,resource_pool=Resources,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=ParaVirtualSCSIController,hardware_version=Default,start=1,annotation='This is great'" --compute-resource-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --interface="compute_network=dvportgroup-85,compute_type=VirtualVmxnet3" --location="Default Location" --name="cluster-hammer" --organization="Default Organization" --provision-method="image" --image '503ea866-c3ce-7195-5757-75a6bb97b92e'  --root-password="dog8code" --volume="name=Hard disk,size_gb=10,thin=true,eager_zero=false,storage_pod=iSCSI-Cluster,mode=persistent"
Could not create the host:
  Error: image not found.
hammer> host create --compute-attributes="cpus=2,corespersocket=2,memory_mb=4028,firmware=bios,add_cdrom=0,cpuHotAddEnabled=0,memoryHotAddEnabled=0,resource_pool=Resources,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=ParaVirtualSCSIController,hardware_version=Default,start=1,annotation='This is great'" --compute-resource-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --interface="compute_network=dvportgroup-85,compute_type=VirtualVmxnet3" --location="Default Location" --name="cluster-hammer" --organization="Default Organization" --provision-method="image" --image-id '503ea866-c3ce-7195-5757-75a6bb97b92e'  --root-password="dog8code" --volume="name=Hard disk,size_gb=10,thin=true,eager_zero=false,storage_pod=iSCSI-Cluster,mode=persistent"
Could not create the host:
  Error: Option '--image-id': Numeric value is required..
  
  See: ' host create --help'.
hammer> host create --compute-attributes="cpus=2,corespersocket=2,memory_mb=4028,firmware=bios,add_cdrom=0,cpuHotAddEnabled=0,memoryHotAddEnabled=0,resource_pool=Resources,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=ParaVirtualSCSIController,hardware_version=Default,start=1,annotation='This is great'" --compute-resource-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --interface="compute_network=dvportgroup-85,compute_type=VirtualVmxnet3" --location="Default Location" --name="cluster-hammer" --organization="Default Organization" --provision-method="image" --image-id 1  --root-password="dog8code" --volume="name=Hard disk,size_gb=10,thin=true,eager_zero=false,storage_pod=iSCSI-Cluster,mode=persistent"
Could not create the host:
  Failed to create a compute VMware (VMware) instance cluster- undefined method `include?' for nil:NilClass

Comment 12 Ondřej Ezr 2019-09-19 12:24:58 UTC
The issue seems to be with the image lookup, but I am not able to reproduce it.

I believe there has been a change so now the --image-id param is expecting ID, not UUID (comment 6 and comment 9 command 3 should work, but comment 9 command 2 should not).

I've not been able to simulate your issue though. It means that the final image-id sent to vmware is blank, so it got lost, I would guess there can be OS version missmatch to blame?

Comment 20 Sanket Jagtap 2020-01-20 13:28:35 UTC
Build: Satellite 6.7 Snap9 



[root@qe-sat6-feature-rhel7 ~]# hammer -u admin -p changeme host create --compute-attributes="image_id=501e0c7e-d8ea-6bc1-a3c5-ccd292811d6f,cpus=2,corespersocket=2,memory_mb=4028,firmware=bios,add_cdrom=0,cpuHotAddEnabled=0,memoryHotAddEnabled=0,resource_pool=Resources,cluster=Satellite-Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=ParaVirtualSCSIController,hardware_version=Default,start=1,annotation='This is great'" --compute-resource-id="2" --hostgroup="RHEL 7 Server 64-bit HG" --interface="compute_network=dvportgroup-226,compute_type=VirtualVmxnet3" --location="Default Location" --name="cluster-hammer11" --organization="Default Organization" --provision-method="image"  --root-password="dog8code" --volume="name=Hard disk,size_gb=10,thin=true,eager_zero=false,storage_pod=iSCSI-Cluster,mode=persistent"
Host created.

The host was created Successfully with storage pod and storage assigned was from the pod

Comment 23 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


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