Bug 2003113 - OpenShift Baremetal IPI installer uses first three defined nodes under hosts in install-config for master nodes instead of filtering the hosts with the master role
Summary: OpenShift Baremetal IPI installer uses first three defined nodes under hosts ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.8
Hardware: All
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.0
Assignee: Andrea Fasano
QA Contact: Ori Michaeli
URL:
Whiteboard:
Depends On:
Blocks: 2025862
TreeView+ depends on / blocked
 
Reported: 2021-09-10 12:04 UTC by Chinmay Deshpande
Modified: 2022-04-06 09:31 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The baremetal installer picked up the first hosts defined in the install-config.yaml as masters, regardless of the role specified on the hosts. Consequence: If a host with the worker role was declared before a master one, it was erroneously picked up as a master. Fix: The installer filters the configured hosts by their role when selecting the masters. Result: Master/worker hosts can now be defined in any order in the install-config.yaml
Clone Of:
: 2025862 2025901 (view as bug list)
Environment:
Last Closed: 2022-03-10 16:09:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift installer pull 5205 0 None open [WIP] Bug 2003113: Skip workers while generating TF vars 2021-09-13 13:08:49 UTC
Red Hat Product Errata RHSA-2022:0056 0 None None None 2022-03-10 16:09:58 UTC

Comment 2 Steven Hardy 2021-09-10 12:17:03 UTC
Summary of the issue as I understand it following some discussions:


The baremetal hosts defined in the install-config is a list, where each host can have either `role: master` or `role: worker`

The installer uses terraform to deploy the master hosts, the number of hosts is defined via the controlPlane replicas value.

We generate a terraform variable containing these hosts, but AFAICS we just add all of them, without filtering on `role: master`

https://github.com/openshift/installer/blob/master/pkg/tfvars/baremetal/baremetal.go#L46

Consequently we end up consuming the first N hosts from that list, even if they're workers:

https://github.com/openshift/installer/blob/master/data/data/baremetal/masters/main.tf#L3

So, I think at a minimum we need to filter the tfvars hosts list to only contain masters.

We may also want to look at improving the validation to consider each role, e.g here we only consider the total count (which could mean terraform fails if e.g there's a role mistake that results on one master tagged as worker, the tfvars list will end up with too few hosts):

https://github.com/openshift/installer/blob/master/pkg/types/baremetal/validation/platform.go#L287

Comment 6 Tony Mulqueen 2022-01-11 11:10:08 UTC
@Andrea Can we please have Doc Text to assist in developing a Release Notes entry for this bug?
Thanks!

Comment 9 errata-xmlrpc 2022-03-10 16:09:11 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.10.3 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:0056


Note You need to log in before you can comment on or make changes to this bug.