Bug 1707298
Summary: | Insufficient input validation for compute_attributes | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Roman Plevka <rplevka> |
Component: | Compute Resources - VMWare | Assignee: | Ondřej Ezr <oezr> |
Status: | CLOSED ERRATA | QA Contact: | Jitendra Yejare <jyejare> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.5.0 | CC: | bkearney, chrobert, cwelton, dvoss, ehelms, jyejare, mhulan, oezr, trichard, zhunting |
Target Milestone: | 6.6.0 | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | foreman-1.22.0.1-1 | Doc Type: | No Doc Update |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-10-22 19:52:01 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: |
Description
Roman Plevka
2019-05-07 08:45:38 UTC
Upstream bug assigned to oezr Upstream bug assigned to oezr The issue is reproduced on: Satellite 6.6.0 snap 6 RPMs: -------- foreman-1.22.0.1-1.el7sat.noarch foreman-vmware-1.22.0.1-1.el7sat.noarch tfm-rubygem-fog-vsphere-3.0.0-2.el7sat.noarch Ondrej, could you please take a look? Hey Ondrej, Basically, I tested this bugzilla using Nailgun and hence in my comment 11 you can see this : ``` In [38]: vcp.compute_attribute[0].read().vm_attrs['scsi_controllers'] Out[38]: [{'type': 'abcd', 'key': 1000}] ``` where vcp is Compute Profile nailgun object. So above it shows that I set the 'scsi_controllers' type to 'abcd' which. And then with that type I attempted to provision and it just failed with same error. So If I test with correct 'scsi_controllers' type as 'VirtualLsiLogicController' the provisioning works. Ok, so you have the scsi_controller defined on the Compute Profile. This BZ were not addressing such case as that have never worked. This only addresses the 'scsi_controller_type' API attribute - mainly passed from hammer (directly to `host create` command). It should be part of RFE for validation of Compute Attributes. Sorry for bit misleading Title and description. Hello Ondrej, This time I am getting some weird error: ``` # hammer host create --name vmhammer --compute-resource-id 1 --hostgroup-id 1 --location-id 2 --organization-id 1 --root-password passwd --compute-attributes "scsi_controller_type=VirtualLsiLogicController" --volume "datastore=Local-Ironforge,mode=Persistent,size_gb=10,thin=true" --compute-profile-id 4 Could not create the host: Failed to create a compute vmware_cr (VMware) instance vmhammer.satqe.lab.eng.rdu2.redhat.com: InvalidController: The device '1' is referring to a nonexisting controller '1,000'. ``` I can share setup with you if you want to debug. Hi Jitendra, this error is due to a controllers are explicitly empty in compute profile. This has never worked and doesn't work without the attribute eighter and thus cannot be considered a regression. Would be lovely to work though and I have filed a separate BZ for that - see BZ 1721334, but I do not consider it as part of this BZ. This is only about badly spelled controller type made the command to fail, but the correct value have not. Verified! @Satellite 6.6 snap 7 Steps: ---------- 1. Post hammer request to create a host with custom SCSI controller Type: # hammer -d host create --compute-attributes "cpus=1,corespersocket=1,memory_mb=1024,cluster=Satellite_Engineering,path=/Datacenters/RH_Engineering/vm/QE,guest_id=rhel7_64Guest,scsi_controller_type=VirtualLsiLogicController,hardware_version=Default,start=1" --compute-resource-id 1 --hostgroup-id 1 --interface "compute_network=qe-sat6-feature-rhel7,compute_type=VirtualVmxnet3" --location-id 2 --name="bugverify" --organization-id 1 --provision-method="build" --pxe-loader="PXELinux BIOS" --root-password="dog8code" --volume="name=Hard disk,size_gb=10,thin=true,eager_zero=false,datastore=Local-Ironforge" Observation: ------------- 1. The host request is submitted with "scsi_controller_type"=>"VirtualLsiLogicController" successfully. INFO 2019-06-19T02:47:39 HammerCLIForeman::Host::CreateCommand] Called with options: {"option_root_password"=>"***", "option_puppetclass_ids"=>[], "option_overwrite"=>true, "option_compute_attributes"=>{"cpus"=>"1", "corespersocket"=>"1", "memory_mb"=>"1024", "cluster"=>"Satellite_Engineering", "path"=>"/Datacenters/RH_Engineering/vm/QE", "guest_id"=>"rhel7_64Guest", "scsi_controller_type"=>"VirtualLsiLogicController", "hardware_version"=>"Default", "start"=>"1"}, "option_volume_list"=>[{"name"=>"Hard disk", "size_gb"=>"10", "thin"=>"true", "eager_zero"=>"false", "datastore"=>"Local-Ironforge"}], "option_interface_list"=>[{"compute_network"=>"qe-sat6-feature-rhel7", "compute_type"=>"VirtualVmxnet3"}], "option_location_id"=>2, "option_organization_id"=>1, "option_compute_resource_id"=>1, "option_hostgroup_id"=>1, "option_name"=>"bugverify", "option_pxe_loader"=>"PXELinux BIOS", "option_provision_method"=>"build"} 2. The host is created # hammer -u admin -p changeme host list | grep bugverify 14 | bugverify.satqe.lab.eng.rdu2.redhat.com | RedHat 7.6 | vmware_hg | 10.8.<ip.hidden> | 00:50:56:be:<mac:hidden> | Warning | rhel7_cv | DEV 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/RHSA-2019:3172 |