Bug 1838631

Summary: GCP: Set validations for disk size
Product: OpenShift Container Platform Reporter: Aditya Narayanaswamy <anarayan>
Component: InstallerAssignee: Aditya Narayanaswamy <anarayan>
Installer sub component: openshift-installer QA Contact: Yang Yang <yanyang>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: gpei
Version: 4.5   
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
GCP returns a different error message when the value for diskSizeGB is set to less than 16GB (as the image size is 16GB) and more than 65537GB (Maximum disk size in GCp is 65536GB) and it takes time for these errors to be detected as the calls go to the GCP console before they are identified. Placed a check in the diskSizeGB field validation to detect these invalid values and report the appropriate error message quickly.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:40:55 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 Aditya Narayanaswamy 2020-05-21 13:20:35 UTC
GCP disk sizes must at least be the size of the image file of 16GB. Also, GCP restricts the max size to 65536GB and hence the validations must be set to produce the proper error messages.

Comment 3 Yang Yang 2020-05-27 09:20:13 UTC
Hi Aditya,

The disk size of 0 is not validated. The specified disk size of 0 is treated as default disk size of 128. Is it by design?

Except above issue, it looks good by verifying with 4.5.0-0.nightly-2020-05-27-075521

1. Set disksize to 15GB and install cluster, installer reports errors like:
+ ./openshift-install create manifests --dir '/home/jenkins/workspace/Launch Environment Flexy/workdir/install-dir'
level=fatal msg="failed to fetch Master Machines: failed to load asset \"Install Config\": invalid \"install-config.yaml\" file: [controlPlane.platform.gcp.diskSizeGB: Invalid value: 15: must be at least 16GB in size, compute[0].platform.gcp.diskSizeGB: Invalid value: 15: must be at least 16GB in size]"

2. Set disksize to 65537 and install cluster, installer reports errors like:
+ ./openshift-install create manifests --dir '/home/jenkins/workspace/Launch Environment Flexy/workdir/install-dir'
level=fatal msg="failed to fetch Master Machines: failed to load asset \"Install Config\": invalid \"install-config.yaml\" file: [controlPlane.platform.gcp.diskSizeGB: Invalid value: 65537: exceeding maximum GCP disk size limit, must be below 65536, compute[0].platform.gcp.diskSizeGB: Invalid value: 65537: exceeding maximum GCP disk size limit, must be below 65536]"

3. Set disksize to -1 and install cluster, installer reports errors like:
+ ./openshift-install create manifests --dir '/home/jenkins/workspace/Launch Environment Flexy/workdir/install-dir'
level=fatal msg="failed to fetch Master Machines: failed to load asset \"Install Config\": invalid \"install-config.yaml\" file: [controlPlane.platform.gcp.diskSizeGB: Invalid value: -1: must be at least 16GB in size, compute[0].platform.gcp.diskSizeGB: Invalid value: -1: must be at least 16GB in size]"

Comment 4 Aditya Narayanaswamy 2020-05-27 13:10:11 UTC
If the user does not set a value to that field then it's value is 0 by default which would be set to the default disk size the installer has for GCP. So, the system takes 0 as not set. Golang sets the value to 0 if there is no value set so I don't think this case can be checked.

Comment 5 errata-xmlrpc 2020-07-13 17:40:55 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, 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-2020:2409