Server Discovery and First Boot
This document describes the discovery and first boot process for bare metal servers in IronCore's bare metal automation. The goal here is to provide a clear understanding of how bare metal servers are discovered and prepared for provisioning.
Server Discovery
The metal-operator supports two types of server discovery:
- DHCP-based discovery: This method uses FeDHCP to discover servers based on their DHCP requests.
- BMC-based discovery: This method uses the Baseboard Management Controller (BMC) to discover servers managed by a BMC.
DHCP-based Discovery
The DHCP-based discovery process works as follows:
- The BMC instance sends a DHCP request to the FeDHCP server.
- FeDHCP creates an
Endpointresource based on the DHCP request.
Here is an example of an Endpoint resource:
apiVersion: metal.ironcore.dev/v1alpha1
kind: Endpoint
metadata:
name: device-12345
spec:
macAddress: "00:1A:2B:3C:4D:5E"
ip: 192.168.100.10- The
EndpointReconcilerwatches for changes to theEndpointand looks up the MAC address in the MACAddress database to find a matching MAC address prefix end derive from that the initial credentials, protocol, and other information needed to create a BMC resource. - If a MAC address prefix is found in the database, the
EndpointReconcilercreates aBMCandBMCSecretresource.
Here is an example of a BMC resource:
apiVersion: metal.ironcore.dev/v1alpha1
kind: BMC
metadata:
name: my-bmc
spec:
endpointRef:
name: my-bmc-endpoint
bmcSecretRef:
name: my-bmc-secret
protocol:
name: Redfish
port: 8000
scheme: http
consoleProtocol:
name: SSH
port: 22- The
BMCReconcilerwatches for changes to theBMCresource and creates aServerresource based on the BMC information.
Here is an example of a Server resource:
apiVersion: metal.ironcore.dev/v1alpha1
kind: Server
metadata:
name: my-server
spec:
uuid: "123e4567-e89b-12d3-a456-426614174000"
power: "Off"
bmcRef:
name: my-bmcBMC-based Discovery
The BMC-based discovery process works similar to the DHCP-based discovery, but here a BMC resource is created directly by a user or an external system.
An example of a BMC resource using inline access credentials is as follows:
apiVersion: metal.ironcore.dev/v1alpha1
kind: BMC
metadata:
name: my-bmc-inline
spec:
access:
macAddress: "00:1A:2B:3C:4D:5E"
ip: "192.168.100.10"
bmcSecretRef:
name: my-bmc-secret
protocol:
name: Redfish
port: 8000
consoleProtocol:
name: SSH
port: 22The rest of the process is the same as in the DHCP-based discovery.
Discovery Boot
The first boot process (discovery boot) is triggered when a Server resource is created and is in the Initial state. That will cause the ServerReconciler to initialize the first boot process which looks like this:
- The
ServerReconcilercreates for everyServerresource which is in theInitialstate aServerBootConfiguration. An example of aServerBootConfigurationresource is as follows:
apiVersion: metal.ironcore.dev/v1alpha1
kind: ServerBootConfiguration
metadata:
name: my-server-boot-config
namespace: default
spec:
serverRef:
name: my-server
image: my-osimage:latest
ignitionSecretRef:
name: my-ignition-secretThe key fields here are:
image: The OS image to be used for booting the server. This image is configured in themetal-operatorand expects a valid IronCore OCI OS image.ignitionSecretRef: A reference to a Kubernetes secret that contains the Ignition configuration for the server. This Ignition is generated by themetal-operatorand contains in essence ametalprobeimage.metalprobeis an agent which is part of themetal-operatorproject that will be run on the server to extract additional information about the server. This image can also be configured in themetal-operator.
The
boot-operatorwatches for changes to theServerBootConfigurationresource and ensures the following:- It creates an iPXE or HTTP boot configuration based on the
ServerBootConfiguration. - It serves the boot configuration via HTTP and is presented to the server via DHCP.
- It serves the necessary Ignition files for the server to boot and configure itself. As soon as everything is ready to be served, the
boot-operatorwill set the status of theServerBootConfigurationtoReady.
- It creates an iPXE or HTTP boot configuration based on the
Serverwith aspec.Powerset toOnand aServerBootConfigurationinReadystate will trigger the server to boot.- The server will boot using the iPXE or HTTP boot configuration served by the
boot-operator. - The server will then apply the Ignition configuration and start the
metalprobeimage to gather additional information about the server. - The
metalprobewill report to a registry endpoint the extracted information about the server, which will be used by theServerReconcilerto update theServerstatus information and set theServerstate toAvailableif all expected information is available.
- The server will boot using the iPXE or HTTP boot configuration served by the
Once the discovery and first boot process is completed, the Server resource will be in the Available state and ready for further operations like provisioning custom software on it.