Bug 2003113

Summary: 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
Product: OpenShift Container Platform Reporter: Chinmay Deshpande <chdeshpa>
Component: InstallerAssignee: Andrea Fasano <afasano>
Installer sub component: OpenShift on Bare Metal IPI QA Contact: Ori Michaeli <omichael>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: afasano, omichael, rbartal, tmulquee
Version: 4.8Keywords: Triaged
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: All   
OS: Unspecified   
Whiteboard:
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
Story Points: ---
Clone Of:
: 2025862 2025901 (view as bug list) Environment:
Last Closed: 2022-03-10 16:09:11 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:
Bug Depends On:    
Bug Blocks: 2025862    

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