Bug 1369925

Summary: Deployment name needs to validated against valid hostname rules
Product: Red Hat Quickstart Cloud Installer Reporter: James Olin Oden <joden>
Component: WebUIAssignee: John Matthews <jmatthew>
Status: NEW --- QA Contact: Dave Johnson <dajohnso>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: tsanders
Target Milestone: ---Keywords: Triaged
Target Release: 1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description James Olin Oden 2016-08-24 18:20:16 UTC
Description of problem:
I was doing a self hosted RHV deployment with the following name:

   comma, comma, comma, green lizard while in green shrubbery

As it was about to start configuring the self-hosted RHV the following error occurred:

   ===== Puppet run for host hypo-algorithmic4.b.b status reported as Error ======

When I looked on the host specified I found the following errors in /var/log/messages:

Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns)           --== HOSTED ENGINE CONFIGURATION ==--
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns)
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ ERROR ] Host name is not valid: comma--comma--comma--green-lizard-while-in-green-shrubbery-rhev-engine.b.b did not resolve into an IP address
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ ERROR ] Failed to execute stage 'Environment customization': Host name is not valid: comma--comma--comma--green-lizard-while-in-green-shrubbery-rhev-engine.b.b did not resolve into an IP address
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ INFO  ] Stage: Clean up
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ INFO  ] Generating answer file '/var/lib/ovirt-hosted-engine-setup/answers/answers-20160823210339.conf'
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ INFO  ] Stage: Pre-termination
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ INFO  ] Stage: Termination
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ ERROR ] Hosted Engine deployment failed
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: (/Stage[main]/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns)           Log file is located at /var/log/ovirt-hosted-engine-setup/ovirt-hosted-engine-setup-20160823210223-61dkqk.log
Aug 23 21:03:39 hypo-algorithmic4 puppet-agent[3573]: hosted-engine --deploy --config-append=/etc/qci/answers returned 1 instead of one of [0]

In particular this line stood out:

/Ovirt::Self_hosted::Setup/Exec[hosted-engine-setup]/returns) [ ERROR ] Host name is not valid: comma--comma--comma--green-lizard-while-in-green-shrubbery-rhev-engine.b.b did not resolve into an IP address

I tried to ping that address and got the following error:

   ping: IDN encoding failed: Output would be too large or too small

I began taking characters off the name of the self-hosted RHV and when I got to 72, it no longer gave that error (of course it could not resolve the address but that was expected).

I tried to do a non-self hosted RHV deployment with CFME on top with the same deployment name to see if it too experienced a similar problem.  It did not but that seems to be because the deployment name given only produced a 72 character host name.  If I took that name:

    comma--comma--comma--green-lizard-while-in-green-shrubbery-cfme

And then added one character to it:

    comma--comma--comma--green-lizard-while-in-green-shrubbery-cfme1

It produced the error:

   ping: IDN encoding failed: Output would be too large or too small

Version-Release number of selected component (if applicable):
QCI-1.0-RHEL-7-20160819.t.0

How reproducible:
Every time.

Steps to Reproduce:
1.  Do either a self hosted RHV deployment or a non self hosted RHV deployment with CFME whose deployment name is 72 characters.

Actual results:
It fails in puppet with the error concerning not being able to resolve the hostname of either the self hosted RHV or the CFME.

Expected results:
Expected the UI to not allow a deployment name that would generate a bad RHV self hosted host name or CFME hostname.