Bug 2022172

Summary: Unable to run openshift-install with a vcenter hostname that begins with a numeric character
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: InstallerAssignee: Aditya Narayanaswamy <anarayan>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: mstaeble
Version: 4.8   
Target Milestone: ---   
Target Release: 4.9.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
If the vcenter hostname begins with a numeric character, the installer validates it as invalid but it is possible to create a vcenter host with a numeric character. Relaxing the validation to allow for numeric characters.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-04 18:41:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2021607    
Bug Blocks: 2022171    

Description OpenShift BugZilla Robot 2021-11-11 00:47:16 UTC
+++ This bug was initially created as a clone of Bug #2021607 +++

Version:

$ openshift-install version
4.8.0 and up 

Platform:

#Please specify the platform type: aws, libvirt, openstack or baremetal etc.
vsphere 

Please specify:
IPI (automated install with `openshift-install`. If you don't know, then it's IPI)


What happened?

When creating a cluster / manifests with a vcenter hostname that begins with a number, validation fails with the following:

DEBUG       Loading Platform...
FATAL failed to fetch Master Machines: failed to load asset "Install Config": invalid "install-config.yaml" file: platform.vsphere.vCenter: Invalid value: "1your.vcenter.server": must be the domain name or IP address of the vCenter

What did you expect to happen?
cluster / manifests to be created succesfully

How to reproduce it (as minimally and precisely as possible)? Use the sample yaml from the documentation with a vcenter name that begins with a number

/usr/local/bin/openshift-install-4.8.17 create manifests --dir ~/ocp4/vtest --log-level=debug

Anything else we need to know?
This seems to be discussed here: https://github.com/openshift/installer/issues/5126

--- Additional comment from mstaeble on 2021-11-10 14:25:24 UTC ---

Setting the severity to high as this affects all users trying to install to a vCenter that starts with a number.

Comment 4 jima 2021-12-09 02:29:09 UTC
create install-config.yaml file and set platform.vsphere.vCenter value as "1aaa.bbb.ccc.vmwarevmc.com".

verified against 4.9.0-0.nightly-2021-12-08-041936 which includes the fix.
issue is fixed, move bug to VERIFIED.

since the vcenter domain name I used is flake one, so installer failed with expected error.
$ ./openshift-install create manifests --dir ipi
INFO Consuming Install Config from target directory 
INFO Manifests created in: ipi/manifests and ipi/openshift 

$ ./openshift-install create cluster --dir ipi
INFO Consuming Common Manifests from target directory 
INFO Consuming Master Machines from target directory 
INFO Consuming OpenShift Install (Manifests) from target directory 
INFO Consuming Openshift Manifests from target directory 
INFO Consuming Worker Machines from target directory 
INFO Obtaining RHCOS image file from 'https://rhcos-redirector.apps.art.xq1c.p1.openshiftapps.com/art/storage/releases/rhcos-4.9/49.84.202110081407-0/x86_64/rhcos-49.84.202110081407-0-vmware.x86_64.ova?sha256=' 
INFO Creating infrastructure resources...         
ERROR                                              
ERROR Error: error setting up new vSphere SOAP client: Post "https://1aaa.bbb.ccc.vmwarevmc.com/sdk": dial tcp: lookup 1aaa.bbb.ccc.vmwarevmc.com on 10.0.0.2:53: no such host 
ERROR                                              
ERROR   on ../../../../tmp/openshift-install--676089622/main.tf line 6, in provider "vsphere": 
ERROR    6: provider "vsphere" {                   
ERROR                                              
ERROR                                              
ERROR Failed to read tfstate: open /tmp/openshift-install--676089622/terraform.tfstate: no such file or directory 
FATAL failed to fetch Cluster: failed to generate asset "Cluster": failed to create cluster: failed to apply Terraform: failed to complete the change

Comment 7 errata-xmlrpc 2022-01-04 18:41:24 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 (OpenShift Container Platform 4.9.12 bug fix update), 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-2021:5214