Bug 2096605

Summary: [vsphere] no validation checking for diskType
Product: OpenShift Container Platform Reporter: jima
Component: InstallerAssignee: Rafael Fonseca <rdossant>
Installer sub component: openshift-installer QA Contact: jima
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: rdossant
Version: 4.11   
Target Milestone: ---   
Target Release: 4.11.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: 2022-08-10 11:17:47 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 jima 2022-06-14 08:04:14 UTC
Version: 4.11.0-0.nightly-2022-06-06-201913

Platform: vSphere IPI

What happened?
1. If user inputs an invalid value for platform.vsphere.diskType in install-config.yaml file, there is no validation checking for diskType and doesn't exit with error, but continues the installation, which is not the same behavior as in 4.10.

After all vms are provisioned, I checked that the disk provision type is thick.

2. If user doesn't set platform.vsphere.diskType in install-config.yaml file, the default disk provision type is thick, but not the vSphere default storage policy. On VMC, the default policy is thin, so maybe the description of diskType should also need to be updated.

$ ./openshift-install explain installconfig.platform.vsphere.diskType
KIND:     InstallConfig
VERSION:  v1

RESOURCE: <string>
  Valid Values: "","thin","thick","eagerZeroedThick"
  DiskType is the name of the disk provisioning type, valid values are thin, thick, and eagerZeroedThick. When not specified, it will be set according to the default storage policy of vsphere.


What did you expect to happen?
validation for diskType

How to reproduce it (as minimally and precisely as possible)?
set diskType to invalid value in install-config.yaml and install the cluster

Comment 1 Rafael Fonseca 2022-06-16 19:45:19 UTC
https://github.com/openshift/installer/pull/6019

Comment 4 jima 2022-06-22 01:39:53 UTC
Verified on 4.11.0-0.nightly-2022-06-21-040754

Set diskType to invalid value in install-config.yaml:
diskType: test:
$ ./openshift-install create manifests --dir ipi
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: platform.vsphere.diskType: Invalid value: "test": diskType must be one of [eagerZeroedThick thick thin] 

diskType: Thick:
$ ./openshift-install create manifests --dir ipi3
ERROR failed to fetch Master Machines: failed to load asset "Install Config": failed to create install config: invalid "install-config.yaml" file: platform.vsphere.diskType: Invalid value: "Thick": diskType must be one of [eagerZeroedThick thick thin] 

Set diskType to valid value in install-config.yaml:
diskType: eagerZeroedThick:
$ ./openshift-install create manifests --dir ipi2
INFO Consuming Install Config from target directory 
INFO Manifests created in: ipi2/manifests and ipi2/openshift 
$ yq r ipi2/manifests/cluster-config.yaml 'data.install-config' | yq r - platform.vsphere.diskType
eagerZeroedThick

If set diskType as "" in install-config.yaml, the result is the same as not setting diskType. 

The description update will be tracked in BZ https://bugzilla.redhat.com/show_bug.cgi?id=2098072, so move this bug to VERIFIED.

Comment 6 errata-xmlrpc 2022-08-10 11:17:47 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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/RHSA-2022:5069