Bug 1649927
| Summary: | Unable to use Hammer to provision a VMware VM from Image with Storage Pod | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Chris Roberts <chrobert> | ||||
| Component: | Hammer | Assignee: | satellite6-bugs <satellite6-bugs> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Lukáš Hellebrandt <lhellebr> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | Nightly | CC: | apatel, avroy, bkearney, chrobert, dhlavacd, egolov, gtalreja, kgaikwad, ktordeur, mawerner, mbacovsk, mcorr, mhulan, mmccune, mshira, oezr, ofedoren, pcreech, rabajaj, sjagtap, spetrosi | ||||
| Target Milestone: | 6.7.0 | Keywords: | Triaged, UserExperience | ||||
| Target Release: | Unused | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| 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'`.
|
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: | |||||||
| Attachments: |
|
||||||
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 Created attachment 1608915 [details]
PRoduction error log
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? 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 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? 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 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 |
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\"