Bug 1695797

Summary: ConversionHost model is missing validations
Product: Red Hat CloudForms Management Engine Reporter: Daniel Berger <dberger>
Component: V2VAssignee: Fabien Dupont <fdupont>
Status: CLOSED CURRENTRELEASE QA Contact: Shveta <sshveta>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: 5.10.2CC: bthurber, dmetzger, simaishi, sshveta, ytale
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: v2v
Fixed In Version: 5.11.0.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1696437 (view as bug list) Environment:
Last Closed: 2019-12-13 15:09:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1696437    

Description Daniel Berger 2019-04-03 18:33:43 UTC
The ConversionHost model is missing important validations that would otherwise prevent potentially bad data from entering the system. This includes validating the presence of a name, associated resource and IP address.

To replicate, simply try to create a conversion host record without a name or associated resource.

Comment 4 Satoe Imaishi 2019-04-25 21:58:18 UTC
Also https://github.com/ManageIQ/manageiq/pull/18690

Comment 5 Shveta 2019-07-02 21:58:59 UTC
Create conversion host with REST API with missing resources like resource Id.


{ "name": "env-rhv43-01.cfme2.lab.eng.rdu2.redhat.com", 
  "resource_type": "ManageIQ::Providers::Redhat::InfraManager::Host",
  "resource_id": "",
  "conversion_host_ssh_private_key": "Bag Attributes\n <No Attributes>\n-----BEGIN PRIVATE KEY-----.....-----END PRIVATE KEY-----\n",
  "vmware_vddk_package_url": "http://10.11.5.7/~kkulkarn/VMware-vix-disklib-6.7.1-10362358.x86_64.tar.gz",
  "auth_user": "root" }

Validation is shown for resource Id.
Verified in 5.11.0.11.20190625161125_392c61e