Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC: BIOS version & settings management #138

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

aobort
Copy link
Contributor

@aobort aobort commented Oct 3, 2024

Proposed Changes

This PR contains PoC implementation for management of server's BIOS version and settings:

  • API types
  • Controller
  • Service managing tasks (scan, apply settings, update version)

This approach fully separate concrete job implementation from the reconciliation flow.

To discuss

BootOrder

Do we need to move boot order field from server to serverBIOS CR? Semantically, yes. As it's one of BIOS settings.

BIOS settings in .status

From my perspective, it reasonable to reflect in .status.bios.settings only those settings which are set in .spec.bios.settings. This will make comparison of .spec and .status much easier.

Storing bios settings

Do we need custom type for bios setting:

type SettingsEntry struct {
    // +required
    Name string `json:"name"`
    
    // +required
    Value string `json:"value"`
        
    // +optional
    Unsupported bool `json:"unsupported,omitempty"`
}

to avoid attempting to apply settings which are not supported in the specified BIOS version? I.e.:

apiVersion: metal.ironcore.dev/v1alpha1
kind: ServerBIOS
metadata:
  name: foo
spec:
  scanPeriodMinutes: 30
  serverRef:
    name: bar
  bios:
    # changing both version and 'unsupported' flag in the same time
    version: 1.0.0  --> 2.0.0
    settings:
    - name: legacyboot
      value: enabled
      unsupported: false  --> true

upgrading from version 1.0.0 to 2.0.0 will lead to the bios setting responsible for legacy boot is deprecated/unsupported, thus it is explicitly marked as unsupported and will not be considered during settings applying.

}
}
}
reset, err := bmcClient.SetBiosAttributes(server.Spec.UUID, diff)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we apply bios settings/ boot order now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boot order: there is a question to discuss in the PR's description, whether we need to keep boot order in Server CR and keep its processing in server-controller, or we'll move it to ServerBIOS. Semantically we should move it to ServerBIOS.

Settings: lines 231-245 in serverbios-controller:

func (r *ServerBIOSReconciler) reconcileSettingsUpdate(
	ctx context.Context,
	log logr.Logger,
	serverBIOS *metalv1alpha1.ServerBIOS,
) (ctrl.Result, error) {
	log.V(1).Info("invoking settings update job")
	jobReference, err := r.createJob(ctx, log, serverBIOS, metalv1alpha1.ApplyBIOSSettingsJobType)
	if err != nil {
		return ctrl.Result{}, err
	}
	return r.patchJobReference(ctx, log, serverBIOS, metalv1alpha1.RunningJobRef{
		Type:   metalv1alpha1.ApplyBIOSSettingsJobType,
		JobRef: jobReference,
	})
}

The job implementation is in progress, hopefully will finish it today and push to PR.

@aobort aobort force-pushed the poc-firmware-controllers branch 4 times, most recently from 0aea100 to 958928c Compare November 4, 2024 10:52
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Nov 7, 2024
Signed-off-by: Artem Bortnikov <[email protected]>
Signed-off-by: Artem Bortnikov <[email protected]>
@aobort aobort linked an issue Nov 8, 2024 that may be closed by this pull request
Signed-off-by: Artem Bortnikov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change documentation Improvements or additions to documentation size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Draft] BIOS/Firmware Update
2 participants