Bug 1908468

Summary: [Azure][4.7] Installer can't properly parse instance type with non integer memory size
Product: OpenShift Container Platform Reporter: Etienne Simard <esimard>
Component: InstallerAssignee: Jeremiah Stuever <jstuever>
Installer sub component: openshift-installer QA Contact: Etienne Simard <esimard>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: jstuever, mstaeble
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:45:31 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 Etienne Simard 2020-12-16 19:15:50 UTC
Version:

./openshift-install create cluster --dir ./invalid22/ --log-level debug
DEBUG OpenShift Installer 4.7.0-0.nightly-2020-12-14-080124 
DEBUG Built from commit ec982ecf5bd847add0f3af82b04f32251972701c 


Platform:

Azure

Please specify:

IPI

What happened?

Tried to test a cluster creation with Standard_D1_v2 as a machine type (3.5G of RAM)

~~~
FATAL failed to fetch Metadata: failed to load asset "Install Config": [compute[0].platform.azure.type: Invalid value: "Standard_D1_v2": instance type does not meet minimum resource requirements of 2 vCPUs, compute[0].platform.azure: Internal error: strconv.ParseInt: parsing "3.5": invalid syntax] 
~~~



What did you expect to happen?

We should be able to parse non int values as they can exist on Azure.

I would expect to see "compute[0].platform.azure: Invalid value: "Standard_D1_v2": instance type does not meet minimum resource requirements of 8 GB Memory" instead of "compute[0].platform.azure: Internal error: strconv.ParseInt: parsing "3.5": invalid syntax]"

How to reproduce?

Generate an install-config.yaml file for Azure and use Standard_D1_v2 as a machine type, then run the installer.

Comment 1 Jeremiah Stuever 2020-12-16 19:22:15 UTC
This is an side-effect of having reused code from other platforms where the assumption that these values are integers is valid. However, that is not the case with Azure where some memory values have decimal points. Should be easy enough to fix.

https://github.com/openshift/installer/blob/91402a22c47edd67c4b9802c4f2e47bfce3b3f39/pkg/asset/installconfig/azure/validation.go#L72

Comment 3 Etienne Simard 2021-01-18 18:43:58 UTC
Verified with: 

./openshift-install 4.7.0-fc.3
built from commit 0c58270fadf5683ac6e0198b1cced305badd9e6b
release image registry.ci.openshift.org/ocp/release@sha256:ce05fd235f0e59ea0114c73ef25abf838b9c3af103d9cb66aa7ba10eeacd8537

~~~
FATAL failed to fetch Metadata: failed to load asset "Install Config": [compute[0].platform.azure.type: Invalid value: "Standard_D1_v2": instance type does not meet minimum resource requirements of 2 vCPUs, compute[0].platform.azure.type: Invalid value: "Standard_D1_v2": instance type does not meet minimum resource requirements of 8 GB Memory] 
~~~

Comment 6 errata-xmlrpc 2021-02-24 15:45:31 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633