Bug 2035882

Summary: [BIOS setting values] Create events for all invalid settings in spec
Product: OpenShift Container Platform Reporter: Lubov <lshilin>
Component: Bare Metal Hardware ProvisioningAssignee: Bob Fournier <bfournie>
Bare Metal Hardware Provisioning sub component: baremetal-operator QA Contact: Lubov <lshilin>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: eglottma
Version: 4.10Keywords: Triaged
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:36:47 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:
Attachments:
Description Flags
HFS after scale down and schema none

Description Lubov 2021-12-28 10:18:41 UTC
Created attachment 1848059 [details]
HFS after scale down and schema

Description of problem:
On HPE setup. In HFS CR into Spec: Settings section added 3 parameters to change:
Spec:
  Settings:
    Admin Email:  ""     
    Server Name:    ""   
    Workload Profile:  Virtualization-PowerEfficient

2 first are String parameters that was successfully set before one by one nad needed to be set back to previous value (empty string)
The 3rd parameter is of Enumeration type, the value set to the one of allowable_values

After scaling down the machine:
1. No changes is done for the 2 String parameters
2. Error reported for the Enumeration parameter  
Events:
  Type    Reason            Age    From                                    Message
  ----    ------            ----   ----                                    -------
  Normal  ValidationFailed  177m   metal3-hostfirmwaresettings-controller  Invalid BIOS setting: Setting Workload Profile is not in the Status field

Version-Release number of selected component (if applicable):
4.10.0-0.nightly-2021-12-23-153012

How reproducible:


Steps to Reproduce:
0. $ oc project openshift-machine-api
1. Set parameters as described above in one of workers HFS CRs:
$ oc edit hfs openshift-worker-1
2. Annotate the worker for deletion and scale down the machineset
$ oc annotate machine ocp-edge-5jqsr-worker-0-mk5m4 machine.openshift.io/cluster-api-delete-machine=yes
$ oc scale --replicas=1 machineset ocp-edge-5jqsr-worker-0
3. After bmh was in preparing state for a few minutes and become available, check the values are changed in the HFS CR and in machine's BIOS
$ oc describe hfs openshift-worker-1
The real Bios values check in ilo

Actual results:
Setting failed (see description)

Expected results:
All 3 parameters should be set

Additional info:

Comment 3 Bob Fournier 2022-01-03 01:39:36 UTC
Lubov - the actual setting value is "WorkloadProfile" not "Workload Profile", you can see via the yaml by using "oc get hfs/openshift-worker-1 -o yaml". The "oc describe" command changes the formatting to split the name but that's not the actual name.

Can you retry it using "WorkloadProfile"?  BTW, the error message is correct in this case.

Comment 4 Lubov 2022-01-03 05:50:09 UTC
(In reply to Bob Fournier from comment #3)
> Lubov - the actual setting value is "WorkloadProfile" not "Workload
> Profile", you can see via the yaml by using "oc get hfs/openshift-worker-1
> -o yaml". The "oc describe" command changes the formatting to split the name
> but that's not the actual name.
> 
> Can you retry it using "WorkloadProfile"?  BTW, the error message is correct
> in this case.

In the schema:
    Workload Profile:
      allowable_values:
        GeneralPowerEfficientCompute
        GeneralPeakFrequencyCompute
        GeneralThroughputCompute
        Virtualization-PowerEfficient
        Virtualization-MaxPerformance
        LowLatency
        MissionCritical
        TransactionalApplicationProcessing
        HighPerformanceCompute(HPC)
        DecisionSupport
        GraphicProcessing
        I/OThroughput
        Custom
      attribute_type:  Enumeration
      read_only:       false

Is it bug in schema then?

Comment 5 Lubov 2022-01-03 05:50:58 UTC
Another problem: why other 2 parameters wasn't set?

Comment 6 Lubov 2022-01-03 05:50:58 UTC
Another problem: why other 2 parameters wasn't set?

Comment 7 Lubov 2022-01-03 05:57:46 UTC
> Another problem: why other 2 parameters wasn't set?
Now I see the names of 2 other parameters should be without spaces, but 
1. they as well listed in the schema with space
2. no error message re: them (In reply to Lubov from comment #6)

The summary: the schema supposed to provide the parameter description, so it should be accurate containing the name of a parameter

Comment 8 Bob Fournier 2022-01-03 13:03:58 UTC
(In reply to Lubov from comment #7)
> > Another problem: why other 2 parameters wasn't set?
> Now I see the names of 2 other parameters should be without spaces, but 
> 1. they as well listed in the schema with space
> 2. no error message re: them (In reply to Lubov from comment #6)
> 
> The summary: the schema supposed to provide the parameter description, so it
> should be accurate containing the name of a parameter

When using 'oc describe" the names are split if they just contain words, for example "SecureBootStatus" becomes "Secure Boot Status", while "SecureBootStatus1" stays as "SecureBootStatus1". The actual names can be seen in yaml when using, for example, "oc get hfs/openshift-worker-1 -o yaml" or "oc get firmwwareschema -o yaml". The actual BIOS settings do not contain spaces, this is true for both the hfs and the schema, so spaces shouldn't set in the spec.

So this isn't a bug, but its not entirely clear why "oc describe" splits the words, I'll do some research and update this before I close it.

As for why the other 2 parameters weren't set, is because their was an error with "Workload Profile" which was detected first so the validation failed.

Comment 9 Bob Fournier 2022-01-03 13:09:00 UTC
Also it looks like "oc edit" shows the names properly, i.e. not split into separate words for the status. These are the names that should be set in the spec.

Comment 10 Bob Fournier 2022-01-03 18:20:29 UTC
Since the "Workload Profile" was an incorrect names setting and not a bug, changing this to just be the issue in which events were only generated for one of the invalid spec settings.

Comment 13 Lubov 2022-01-25 08:24:38 UTC
verified on 4.10.0-0.nightly-2022-01-24-070025

Comment 16 errata-xmlrpc 2022-03-10 16:36:47 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