Version: $ openshift-install version openshift-v4.7.0-0.nightly-2020-11-16-091948-nightly Platform: GCP Please specify: * IPI What happened? Installing a cluster on GCP with custom instance types is not working anymore (was working in 4.6) This breaks running OSD clusters on 4.7, including osde2e tests. > controlPlane.platform.gcp.type: Invalid value: \"custom-4-16384\": instance type custom-4-16384 not found, compute[0].platform.gcp.type: Invalid value: \"custom-4-16384\": instance type custom-4-16384 not found custom-4-16384 is a valid custom machine type. See also https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#gcloud Seems like a new name-based validation of machine types has been introduced with https://github.com/openshift/installer/commit/0d74861bd7fa7cb28cde3f79fa63dc43704b69b2 . What did you expect to happen? successful cluster installation How to reproduce it (as minimally and precisely as possible)? using the OCM cli: > ocm create cluster --version 4.7.0-0.nightly-2020-11-16-091948-nightly mdewald-47-gcp --provider gcp --region us-east1 installer log: time="2020-11-16T15:56:18Z" level=debug msg="OpenShift Installer v4.7.0" time="2020-11-16T15:56:18Z" level=debug msg="Built from commit 8d9d7cb16bd681f5ff5ff1b22305d3a6d5466529" time="2020-11-16T15:56:18Z" level=debug msg="Fetching Master Machines..." time="2020-11-16T15:56:18Z" level=debug msg="Loading Master Machines..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Cluster ID..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Install Config..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading SSH Key..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Base Domain..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Platform..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Cluster Name..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Base Domain..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Platform..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Pull Secret..." time="2020-11-16T15:56:18Z" level=debug msg=" Loading Platform..." time="2020-11-16T15:56:18Z" level=info msg="Credentials loaded from environment variable \"GOOGLE_CREDENTIALS\", file \"/.gcp/osServiceAccount.json\"" time="2020-11-16T15:56:23Z" level=fatal msg="failed to fetch Master Machines: failed to load asset \"Install Config\": [controlPlane.platform.gcp.type: Invalid value: \"custom-4-16384\": instance type custom-4-16384 not found, compute[0].platform.gcp.type: Invalid value: \"custom-4-16384\": instance type custom-4-16384 not found]"
Simpler way to test (this manually): create an install-config by openshift-install create install-config --dir <install-dir> modify the install-config.yaml and replace the {} after GCP with: type: custom-4-16384 Then run: openshift-install create manifests --dir <install-dir> 4.7 is spitting out an error like this: FATAL failed to fetch Master Machines: failed to load asset "Install Config": [controlPlane.platform.gcp.type: Invalid value: "custom-4-16384": instance type custom-4-16384 not found, compute[0].platform.gcp.type: Invalid value: "custom-4-16384": instance type custom-4-16384 not found] Also, 'gcloud compute machine-types list' doesn't seem to return custom types.
We will need to add special handling for custom machine types. They are named using a specific format: [type-]custom-<cpu>-<memory> and defaults to N1 when no type is specified.
This can be tested by using the following custom machine types in the control plane section of the install-config: No errors as these are valid: n1-standard-4, custom-4-16384, n1-custom-4-16384 Google API 404 (not found): n1-dne-4, custom-2, custom-a, custom-2-b, n1-custom-2, n1-custom-a, n1-custom-2-b controlPlane.platform.gcp.type: Internal error: googleapi: Error 404: The resource 'projects/myproject/zones/us-west1-b/machineTypes/custom-2' was not found, notFound Google API Internal Error (invalidResourceUsage): custom-4-16383, n1-custom-4-16383, custom-3-16384, n1-custom-3-16384 controlPlane.platform.gcp.type: Internal error: googleapi: Error 400: Invalid resource usage: 'Memory should be a multiple of 256MiB, while 16383MiB is requested'., invalidResourceUsage controlPlane.platform.gcp.type: Internal error: googleapi: Error 400: Invalid resource usage: 'Number of vCPUs should be multiple of 2 if greater than 2, while 3 is requested'., invalidResourceUsage Invalid memory and CPU: n1-standard-2, custom-2-7680, n1-custom-2-7680, controlPlane.platform.gcp.type: Invalid value: "custom-2-7680": instance type does not meet minimum resource requirements of 4 vCPUs controlPlane.platform.gcp.type: Invalid value: "custom-2-7680": instance type does not meet minimum resource requirements of 15360 MB Memory
Verified with openshift-install-linux-4.7.0-0.nightly-2020-11-23-074526 FATAL failed to fetch Master Machines: failed to load asset "Install Config": compute[0].platform.gcp.type: Invalid value: "n1-custom-4-16383": instance type n1-custom-4-16383 not found FATAL failed to fetch Master Machines: failed to load asset "Install Config": compute[0].platform.gcp.type: Invalid value: "n1-dn2-4": instance type n1-dn2-4 not found FATAL failed to fetch Master Machines: failed to load asset "Install Config": [controlPlane.platform.gcp.type: Invalid value: "n1-standard-2": instance type does not meet minimum resource requirements of 4 vCPUs, controlPlane.platform.gcp.type: Invalid value: "n1-standard-2": instance type does not meet minimum resource requirements of 15360 MB Memory]
added automation for the changes here in OCP-36886
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