Skip to main content

Provision bare-metal servers with a Metal3 bastion

This guide is for an operator who must install the operating system on a set of bare-metal servers before a Kube-DC installation exists. After you read it, you can run Metal3 on one bastion host, install Ubuntu on every server through its BMC, and hand over servers that pass the installation guide host checks. To add workers to a running Kube-DC cluster with Cluster API, see Metal3 bare-metal worker nodes instead.

This is an advanced path. If your servers already run a supported Ubuntu release, start with the Quickstart.

The procedure was qualified on Dell PowerEdge blades in an M1000e chassis (13th generation with iDRAC8, and 14th generation with iDRAC9), behind Dell MXL blade switches. Hardware-specific steps name the hardware they apply to. Example: 12 blades in one chassis shows the commands, their output, and the time that each phase took on that hardware.

Provisioning erases disks

Ironic writes an image to a disk on each server, and its cleaning step erases disk metadata. Every server that the HBA connects to a SAN can see production LUNs. Read Protect SAN LUNs before you enroll a server that has a Fibre Channel or iSCSI connection.

How it works​

The bastion is one Linux host with a leg on every network that provisioning needs. It runs a single-node Kubernetes cluster with Ironic and the Bare Metal Operator (BMO). There is no Cluster API in this layout: each server is one BareMetalHost with an image, networkData, and userData.

The sequence for each server is:

  1. Prepare: you set the boot mode and the boot order through the BMC.
  2. Enroll: you apply a BareMetalHost without an image. BMO registers the BMC.
  3. Inspect: Ironic boots the Ironic Python Agent (IPA) ramdisk from virtual media. The ramdisk reports CPUs, memory, disks, and NICs.
  4. Check: you confirm that inspection saw only local disks, then pin the root disk.
  5. Provision: you add the image, networkData, and userData. IPA writes the image, and the server boots into the installed OS with its final network.
  6. Verify: you check the bonds, the address, DNS, egress, and the root disk.

The bastion is not part of the finished installation. After provisioning, the node network must have its own gateway, DNS, and NTP on the site firewall or router. See Take the bastion out of the data path.

The whole project has these stages:

  1. Survey the site.
  2. Prepare the bastion, the switches, and the server image.
  3. Prepare each server through its BMC, then enroll and provision it.
  4. Take the bastion out of the data path.
  5. Install Kube-DC on the provisioned servers.

Before you begin​

Survey the site​

Start from one Linux host that has the same connections as the servers, for example one server that you install by hand. That host becomes the bastion. Collect the facts in this section before you plan any address.

Find the BMC network. The BMC of the host reports its own address and VLAN to the OS:

sudo ipmitool lan print 1 | grep -E 'IP Address|Subnet Mask|Default Gateway IP|802.1q VLAN ID'

The other BMCs are usually on the same network. The bastion needs an interface on that network before it can reach them.

Find the VLANs on the server ports. Capture tagged frames on each NIC of the host for a few seconds:

sudo tcpdump -nn -e -c 200 -i <nic> vlan

<nic> is one NIC of the host. Each line shows the tag of one frame, for example vlan 100. The result is the list of VLANs that the switch port carries, and it shows which NICs have a link to which network.

Record each server. Write these facts for every server into one inventory file:

FactUse
BMC address, server model, BMC firmware version, and BMC licenseThe BMC driver, the firmware minimum, and virtual media. See Set the BMC address
MAC addresses of the two management NICs and the two trunk NICsbootMACAddress, the DHCP reservations, and the network data
Switch and port of each NICThe switch port configuration. See Build the port map from LLDP and MAC tables
Local RAID controller and its virtual diskThe root device hints
WWPNs of the HBA, if the server has oneSAN zoning. See Protect SAN LUNs
The OS and the workloads on the serverThe decision that the server can be erased

An authenticated Redfish request returns the model and the firmware versions. These requests are for a Dell iDRAC:

curl -sk -u <bmc-user> https://192.0.2.31/redfish/v1/Systems/System.Embedded.1 \
| jq '{Model, SKU, BiosVersion, PowerState}'
curl -sk -u <bmc-user> https://192.0.2.31/redfish/v1/Managers/iDRAC.Embedded.1 \
| jq '{FirmwareVersion}'

<bmc-user> is a BMC account. curl asks for its password. On an iDRAC, racadm license view shows the license.

In a blade chassis that assigns the addresses of each slot, read the MAC addresses and the WWPNs from the chassis manager, not from the adapter. See Check the servers after a chassis power loss for the command.

If you must update firmware first, verify the vendor signature or checksum of every file before you load it.

Networks​

Provisioning uses three networks. This guide uses these example values:

NetworkExampleCarried on the serverPurpose
BMC and provisioningVLAN 100, 192.0.2.0/24Untagged on the management NICsBMC (iDRAC) addresses, Ironic API, virtual media, IPA ramdisk
NodeVLAN 200, 10.10.0.0/16, gateway 10.10.0.1Tagged on the management bondRKE2 node IP, SSH, etcd, Geneve, Ceph
CloudVLAN 300, 198.51.100.0/24Tagged on the trunk bondKube-DC external network, after installation

The bastion needs an address on the BMC network and on the node network. It needs internet egress to pull images, either directly or through a firewall.

The BMCs must reach the Ironic endpoint and the image server. In the qualified chassis, a BMC could reach only addresses on its own network. Put the Ironic endpoint and the image server on the BMC network.

Host roles​

Kube-DC expects two kinds of host interface. Plan the bonds before you write any networkData:

  • Management bond: two NICs, one to each switch, mode active-backup. The provisioning VLAN is untagged on these ports, and the node VLAN is tagged. The node IP is on a VLAN interface of this bond.
  • Trunk bond: two NICs, one to each switch, mode 802.3ad (LACP). It has no IP address. Kube-OVN owns it after installation and uses it as EXT_NET_INTERFACE.

Use the same bond names on every server. Then the ProviderNetwork needs no per-node interface overrides.

Tested versions​

The procedure was tested with these versions:

ComponentVersion
RKE2 on the bastionv1.36.3+rke2r1
cert-managerv1.20.1
MetalLBv0.15.3
Ironic Standalone Operator (IrSO)v0.12.0 (Ironic 39.0)
Bare Metal Operatorv0.14.2
Server OSUbuntu 26.04 cloud image, kernel 7.0

Prepare the bastion​

Install RKE2​

Install a single-node RKE2 server. Disable the bundled ingress controllers. RKE2 1.36 deploys Traefik by default, with host ports 80 and 443 on every interface of the bastion, including an internet-facing one.

The RKE2 configuration is:

# /etc/rancher/rke2/config.yaml
node-name: bastion
node-ip: 10.10.0.5
disable: [rke2-ingress-nginx, rke2-traefik]
write-kubeconfig-mode: "0600"

Before you start RKE2, make sure that /etc/hosts contains 127.0.0.1 localhost. Without that line, RKE2 resolves localhost through public DNS, and its internal probes fail.

Keep the host firewall out of Kubernetes tables​

A host firewall on the bastion must own only its own tables. Do not use flush ruleset, and do not write to table ip nat or table ip filter. kube-proxy and the CNI keep their rules there. One reload of a firewall file that flushes the ruleset deletes the KUBE-* chains, and Ironic stops answering until kube-proxy and the CNI restart.

Use this pattern to replace only your own tables on every reload:

table inet filter
delete table inet filter
table ip bastion_nat
delete table ip bastion_nat

table inet filter {
chain input {
type filter hook input priority 0; policy drop;
iif "lo" accept
ct state established,related accept
meta l4proto { icmp, ipv6-icmp } accept
tcp dport 22 accept
ip saddr { 10.42.0.0/16, 10.43.0.0/16 } accept
iifname { "cni0", "flannel.1", "cali*" } accept
iifname "vlan100" udp sport 68 udp dport 67 accept
}
chain forward {
type filter hook forward priority 0; policy drop;
ct state established,related accept
ip saddr 10.42.0.0/16 accept
ip daddr 10.42.0.0/16 accept
}
}

The forward rules for the Pod CIDR are required. MetalLB addresses are translated to Pod addresses, so the traffic to Ironic passes through the forward chain, not the input chain.

Connect the bastion to both switches​

If the bastion has one uplink, a reload of that switch removes your only access to the site. Bond two NICs across both switches before you change any switch. Test the failover with an automatic restore, for example netplan try --timeout 120.

Install Ironic, BMO, and the image server​

Install the components in this order. Wait for each one to become ready:

  1. cert-manager.
  2. MetalLB, with a pool on the BMC network.
  3. The Ironic Standalone Operator.
  4. The Bare Metal Operator, configured to find the Ironic of IrSO.
  5. The Ironic TLS certificate.
  6. A LoadBalancer Service for Ironic.
  7. The Ironic resource.
  8. The image server.

Pin every vendored manifest, and verify its checksum each time you apply it. The Metal3 projects publish each release as one manifest. To download the tested releases of IrSO and BMO, run these commands:

curl -fsSLO https://github.com/metal3-io/ironic-standalone-operator/releases/download/v0.12.0/install.yaml
curl -fsSLO https://github.com/metal3-io/baremetal-operator/releases/download/v0.14.2/baremetal-operator.yaml
sha256sum install.yaml baremetal-operator.yaml

The tested files have these SHA-256 checksums:

FileSHA-256
install.yaml (IrSO v0.12.0)c3c60c4d1cd37ba8d8f0874ffb520d4a64b17f57923b16d578b8399c3d28c67c
baremetal-operator.yaml (BMO v0.14.2)a404645435f3d52663525db1008ce567980f4ad57f76dda0c670dc2aeb4cb24a

Apply each operator manifest with kubectl apply --server-side, then wait for its Deployments:

kubectl apply --server-side -f install.yaml
kubectl -n ironic-standalone-operator-system wait --for=condition=Available deploy --all --timeout=600s

Do not install IrSO from the main branch of its repository. An unpinned installation changes without notice.

MetalLB pool on the BMC network​

Announce the pool only on the BMC VLAN interface, and assign addresses only on request:

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: provisioning
namespace: metallb-system
spec:
addresses: [192.0.2.240-192.0.2.246]
autoAssign: false
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: provisioning
namespace: metallb-system
spec:
ipAddressPools: [provisioning]
interfaces: [vlan100]

Reserve the pool range with the network owner. An ARP sweep shows only the addresses that are in use at that moment. A firewall or a monitoring appliance can take an address from the range later.

Ironic behind MetalLB​

Run Ironic without host networking, and publish it through a LoadBalancer Service. The Ironic resource is:

apiVersion: ironic.metal3.io/v1alpha1
kind: Ironic
metadata:
name: ironic
namespace: baremetal-operator-system
spec:
version: "39.0"
networking:
disableHostNetwork: true
externalIP: 192.0.2.240
tls:
certificateName: ironic-tls
disableVirtualMediaTLS: true
deployRamdisk:
sshKey: "<ssh-public-key>"
extraKernelParams: "modprobe.blacklist=qla2xxx"
extraConfig:
- {group: conductor, name: inspect_wait_timeout, value: "3600"}
- {group: conductor, name: deploy_callback_timeout, value: "3600"}

Replace <ssh-public-key> with a key that lets you sign in to the IPA ramdisk for debugging. The other settings are explained in these places:

  • disableVirtualMediaTLS: iDRAC8 downloads the ISO over HTTP on port 6180. The Ironic API stays on TLS.
  • extraKernelParams: see Protect SAN LUNs.
  • inspect_wait_timeout and deploy_callback_timeout: see Slow virtual media.

The Service that publishes Ironic is:

apiVersion: v1
kind: Service
metadata:
name: ironic-external
namespace: baremetal-operator-system
annotations:
metallb.io/address-pool: provisioning
metallb.io/loadBalancerIPs: 192.0.2.240
spec:
type: LoadBalancer
selector:
ironic.metal3.io/app: ironic-service
ports:
- {name: api, port: 6385, targetPort: ironic-api}
- {name: images, port: 6180, targetPort: image-svc}
- {name: images-tls, port: 6183, targetPort: image-svc-tls}

Issue ironic-tls from a cert-manager CA. BMO connects to Ironic through the in-cluster Service, and the BMCs and the ramdisk use the external IP. The certificate needs both names:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ironic-tls
namespace: baremetal-operator-system
spec:
secretName: ironic-tls
secretTemplate:
labels:
environment.metal3.io/ironic-standalone-operator: "true"
dnsNames:
- ironic.baremetal-operator-system.svc
- ironic.baremetal-operator-system.svc.cluster.local
ipAddresses:
- 192.0.2.240
issuerRef: {name: <ca-issuer>, kind: Issuer}

<ca-issuer> is a cert-manager CA Issuer in the same namespace. The Secret must have the label in secretTemplate, or IrSO does not use it.

To connect BMO to the Ironic of IrSO, replace the BMO ironic ConfigMap. Put this kustomization.yaml in the directory that has baremetal-operator.yaml, and apply it with kubectl apply -k .:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- baremetal-operator.yaml
generatorOptions:
disableNameSuffixHash: true
configMapGenerator:
- name: ironic
namespace: baremetal-operator-system
behavior: replace
literals:
- IRONIC_NAME=ironic
- IRONIC_NAMESPACE=baremetal-operator-system

BMO then reads the endpoint, the credentials, and the CA of Ironic from the Ironic resource.

Without spec.database, Ironic keeps its state in a local SQLite database. That is sufficient on the bastion: the BareMetalHost resources hold the state of every server, and BMO registers the servers again after an Ironic restart.

Image server​

Serve the OS images over HTTP from the BMC network. Any static web server works. The qualified setup used an unprivileged nginx with a persistent volume, published through MetalLB on 192.0.2.241.

Check the stack​

To confirm that Ironic answers on the BMC network, run these commands:

kubectl -n baremetal-operator-system wait --for=condition=Ready certificate/ironic-tls --timeout=300s
kubectl -n baremetal-operator-system wait --for=condition=Ready ironic/ironic --timeout=900s
curl -sk https://192.0.2.240:6385/ | jq -r '.default_version.version'

The last command prints the API version of Ironic, for example 1.115. Also confirm from another device on the BMC network, for example a switch, that 192.0.2.240 answers. Then MetalLB announces the address on the BMC VLAN.

Give the IPA ramdisk an address​

The IPA ramdisk needs an IP address on the provisioning network. In the qualified setup, the ramdisk did not apply the static network data from preprovisioningNetworkDataName. It fell back to DHCP. Run a DHCP server on the bastion that answers only known MAC addresses and gives no router and no DNS server. Other devices on the BMC network then keep their own configuration.

The dnsmasq configuration is:

port=0
interface=vlan100
bind-interfaces
except-interface=lo
dhcp-range=192.0.2.221,static,255.255.255.0,30m
dhcp-ignore=tag:!known
dhcp-hostsfile=/etc/dnsmasq-ipa/hosts
dhcp-option=option:router
dhcp-option=option:dns-server
log-dhcp

Put one line for each server in the hosts file. List both management NIC MAC addresses on the line, so the server gets its address from whichever NIC asks first:

<mac-nic-a>,<mac-nic-b>,192.0.2.221,server-1-ipa,30m

Do not start the hosts file lines with dhcp-host=. In a hosts file, dnsmasq rejects that prefix with the error bad hex constant.

Keep the reservations after provisioning. You need them again to reprovision a server.

Prepare the switches​

Use an untagged provisioning VLAN on the management ports​

The IPA ramdisk cannot form an LACP bond. Dell OS9 switches forward nothing on an LACP member port that has no LACP partner. LACP fallback (lacp ungroup member-independent) did not help on MXL OS9 9.14 in Full-Switch mode.

Configure the management ports of each server as plain switch ports, not as LAG members:

  • the provisioning VLAN untagged;
  • the node VLAN tagged.

The installed OS then uses an active-backup bond on these two ports. Use LACP only on the trunk ports, which provisioning does not use.

Build the port map from LLDP and MAC tables​

Do not trust port descriptions, chassis slot names, or labels. In the qualified site, uplinks described as one device went to another, and chassis slot names did not match the installed hosts. A host moved between slots kept an old MAC address.

Build the port map from LLDP neighbors and from the MAC tables of both switches. Then generate the switch port descriptions and the chassis names from your inventory. Install lldpd in the server image so that the switches report the node names after provisioning.

Do not close a loop​

Before you join two blade switches with an inter-switch link (Dell VLT, or an MLAG), check how many uplinks each switch has into the core:

  • If spanning tree is off and both switches have their own uplinks, the new link closes a loop. Shut the uplinks of the peer in the same change that enables the inter-switch link.
  • If a peer switch has a cloned Layer 3 configuration, the same interface IP addresses and router ID appear twice after the join. Give the peer unique addresses first.
  • If the core bridges another VLAN into the cloud VLAN, the cloud VLAN reaches every server trunk with a different tag. Remove the bridge before you install Kube-DC.

Bring an uplink pair up only as one LACP group on both sides. A second uplink without a LAG creates a loop when spanning tree is off.

Prepare the server image​

Start from the Ubuntu cloud image, and verify the signed SHA256SUMS file before you use it. Kube-DC needs Linux 7.0 or later for Ceph, so use Ubuntu 26.04, or Ubuntu 24.04 with the HWE kernel.

Two changes are necessary on physical servers:

  • Install linux-generic and linux-firmware. The cloud image uses linux-image-virtual and has no NIC firmware. Without firmware, the bnx2x NICs of the M630 load without a link, and the provisioned server is not reachable.
  • Build a generic initramfs. Ubuntu 26.04 uses dracut. A kernel installed inside the image build VM gets a host-only initramfs with VirtIO drivers and no RAID driver. The server then stops in emergency mode at boot. Add the dracut configuration before you install the kernel, then regenerate all initramfs files.

The dracut configuration is:

# /etc/dracut.conf.d/90-generic.conf
hostonly="no"
add_drivers+=" megaraid_sas mpt3sas ahci nvme sd_mod "

To check an image, list the initramfs contents with lsinitrd and confirm that your storage driver is present.

Also install the packages and settings that Kube-DC hosts need:

  • chrony, curl, iptables, jq, ethtool, lldpd, nfs-common, open-iscsi, multipath-tools, and sg3-utils;
  • nf_conntrack in /etc/modules-load.d/;
  • net.ipv4.ip_forward=1, fs.inotify.max_user_watches=1524288, and fs.inotify.max_user_instances=4024 in /etc/sysctl.d/.

Do not replace /etc/resolv.conf, and do not disable systemd-resolved. The node must use the resolver that networkData sets. See DNS on the nodes.

If the servers connect to a SAN, use a multipath configuration that claims nothing by default (find_multipaths strict and a blacklist of every WWID). Deliver the allow-list for each array through userData to every node, control-plane nodes included.

Before you publish the image, clean it: run apt-get clean, empty /etc/machine-id, and run cloud-init clean --logs --seed. Compress the image and write its .sha256sum file. Put a time or a sequence number in the file name, not only a date. Two builds on one day otherwise get one name with two checksums.

Prepare each server through its BMC​

Do this preparation before a BareMetalHost exists for the server. A failed inspection leaves Ironic in control of the power, and Ironic turns the server off in the middle of any BIOS job.

Set the BMC address​

For Dell iDRAC8 and iDRAC9, use the idrac-virtualmedia driver:

bmc:
address: idrac-virtualmedia://192.0.2.31/redfish/v1/Systems/System.Embedded.1
credentialsName: server-1-bmc

Do not use redfish-virtualmedia for Dell servers. Metal3 does not support it for iDRAC. For other vendors, see the Metal3 supported hardware list.

Check the firmware first. Metal3 needs iDRAC8 2.75.75.75 or later and iDRAC9 6.10.30.00 or later. Virtual media needs an Enterprise or Datacenter license.

When you probe BMCs, stop at the first HTTP 401 response. Repeated failures lock the account. An unauthenticated iDRAC8 in a blade reports Redfish 1.4.0 and the chassis service tag, so it can look like a different model.

Set UEFI boot mode (Dell 13th generation)​

When Ironic sets UEFI through Redfish, the iDRAC stages Secure Boot settings together with the boot mode. On M630 blades, the BIOS and the iDRAC then failed to complete the job. The Lifecycle Controller logged UEFI0315 and RAC0561, and the job stopped at 34 percent.

Set the boot mode yourself, before you enroll the server:

  1. If a BareMetalHost from a failed attempt exists for the server, delete it. Do this only while the host is not provisioned and automated cleaning is disabled. Deleting a provisioned host deprovisions the server.
  2. Clear the job queue: racadm jobqueue delete -i JID_CLEARALL_FORCE.
  3. Set only the boot mode: racadm set BIOS.BiosBootSettings.BootMode Uefi.
  4. Create a BIOS job with a power cycle.
  5. Reseat the server from the chassis manager: racadm serveraction -m server-<n> reseat -f.

A soft iDRAC reset and an ordinary power cycle were not sufficient. If a pending value with a reseat does not apply, create the job and then reseat.

Put virtual media first in the boot order (Dell 13th generation)​

The M630 BIOS ignored the one-time boot from virtual CD that Ironic requests. It booted the network or the old OS instead. Put the virtual CD first in the permanent boot order:

  1. Attach virtual media: racadm set iDRAC.VirtualMedia.Attached Attached.
  2. Power-cycle the server. The device Optical.iDRACVirtual.1-1 appears in the boot sequence only while media is attached. Before that, the set command fails with PR14.
  3. Set the order with a BIOS job: Optical.iDRACVirtual.1-1, RAID.Integrated.1-1, NIC.PxeDevice.1-1.

An empty virtual CD is skipped, so the installed OS still boots. If the command fails with RAC0946 right after the boot mode job, wait until racadm getremoteservicesstatus reports ready, and try again.

After the first deployment, Ironic makes the local disk the first boot device. Before you reprovision an M630, stage the virtual-CD-first order again as a BIOS job without a reboot (racadm jobqueue create BIOS.Setup.1-1 with no -r). The job then applies during the power-on that Ironic starts.

Lifecycle Controller rules​

Follow these rules for every iDRAC job:

  • Clear the job queue before you start.
  • Wait until the Lifecycle Controller is ready before you create a job.
  • Poll each job until it is completed or failed.
  • If a virtual media insert returns HTTP 500 while a boot order job is staged, reset the iDRAC with racadm racreset soft. Ironic retries the insert.

Protect SAN LUNs​

A server whose HBA logs in to a SAN sees the LUNs of other hosts. Two Ironic defaults are dangerous on such a server:

  • Without root device hints, IPA picks the smallest disk of 4 GiB or more. That disk can be a SAN LUN.
  • With automatedCleaningMode: metadata, which is the default, IPA erases the metadata of every block device that it sees, SAN and multipath devices included.

Use all of these protections:

  1. Hide the HBA from the ramdisk. Add the HBA driver to the ramdisk kernel blacklist, for example modprobe.blacklist=qla2xxx for QLogic. Inspection then reports only local disks.
  2. Check inspection before provisioning. Fail the server if inspection reports a disk from a storage-array vendor, a disk larger than your local disks, a Fibre Channel transport, or more disks than you expect. Set online: false on a server that fails.
  3. Pin the root disk. During inspection, use hints that match only the local RAID controller, for example {vendor: DELL, model: PERC, minSizeGigabytes: 100}. After the check passes, pin the serial number of the virtual disk.
  4. Disable automated cleaning on every server that is not isolated from the SAN: automatedCleaningMode: disabled.

Do not let spec.raid change the RAID layout. BMO erases metadata when the RAID configuration changes. Create the virtual disks one time through the BMC before enrollment.

After installation, the OS sees the SAN again. Configure Ceph and the local-path provisioner to use only local disks.

Enroll and provision the servers​

Enroll a server for inspection​

Create a namespace for the hosts one time:

kubectl create namespace metal3

Create the BMC credentials Secret and a BareMetalHost without an image:

apiVersion: v1
kind: Secret
metadata:
name: server-1-bmc
namespace: metal3
type: Opaque
stringData:
username: <bmc-user>
password: <bmc-password>
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
name: server-1
namespace: metal3
spec:
online: true
bootMode: UEFI
bootMACAddress: <mac-nic-a>
bmc:
address: idrac-virtualmedia://192.0.2.31/redfish/v1/Systems/System.Embedded.1
credentialsName: server-1-bmc
disableCertificateVerification: true
automatedCleaningMode: disabled
rootDeviceHints: {vendor: DELL, model: PERC, minSizeGigabytes: 100}

The placeholders are:

  • <bmc-user> and <bmc-password>: a BMC account for Metal3. Generate the Secret from a protected file and apply it from standard input, so the password is not stored in a manifest.
  • <mac-nic-a>: the MAC address of the first management NIC, the one on the untagged provisioning VLAN.

disableCertificateVerification is necessary while the BMC has its factory certificate, which no CA signed. After you install a certificate from your CA on the BMC, remove the field.

Watch the inspection​

To follow a server, watch its BareMetalHost:

kubectl -n metal3 get bmh server-1 -w

The state changes from registering to inspecting, and then to available. On the qualified hardware, inspecting lasted 8 to 11 minutes.

Two more signals show progress while the state is inspecting. The first one is the number of ISO bytes that the BMCs read in the last 10 minutes:

kubectl -n baremetal-operator-system logs deploy/ironic-service -c httpd --since=10m \
| awk '/GET \/redfish\/boot-.*\.iso/ {b+=$10} END {print b+0}'

A value above 20 MB means that a BMC streams the ISO and the ramdisk is booting. A value near zero after several minutes means that the server booted another device.

The second signal is the DHCP reservation of the server. The ramdisk answers a ping to that address after it starts.

Check the disks that inspection found​

After the host reaches available, list the disks that the ramdisk reported:

kubectl -n metal3 get bmh server-1 -o json \
| jq -c '.status.hardware.storage[] | {name, vendor, model, serialNumber, sizeBytes, hctl}'

On a server that is safe to provision, the output has only the local RAID virtual disk:

{"name":"/dev/disk/by-path/pci-0000:02:00.0-scsi-0:2:0:0","vendor":"DELL","model":"PERC H730 Mini","serialNumber":"<root-disk-serial>","sizeBytes":299439751168,"hctl":"0:2:0:0"}

<root-disk-serial> is the value that you pin in the next steps. If the output has any other disk, stop and apply the rules in Protect SAN LUNs.

Write the network data​

Ironic's network data must have a network_id on every network entry. Match each link by MAC address, and set the bond and VLAN names yourself. NIC names change between models, for example eno1 on one model and eno1np0 on another, so do not depend on them.

This example creates the management bond with the node VLAN, and an IP-less trunk bond:

{
"links": [
{"id": "mgmt0", "type": "phy", "ethernet_mac_address": "<mac-nic-a>", "mtu": 9000},
{"id": "mgmt1", "type": "phy", "ethernet_mac_address": "<mac-nic-b>", "mtu": 9000},
{"id": "bond-mgmt", "name": "bond-mgmt", "type": "bond", "ethernet_mac_address": "<mac-nic-a>",
"bond_links": ["mgmt0", "mgmt1"], "bond_mode": "active-backup", "bond_miimon": 100, "mtu": 9000},
{"id": "vlan200", "type": "vlan", "vlan_link": "bond-mgmt", "vlan_id": 200,
"vlan_mac_address": "<mac-nic-a>", "mtu": 1500},
{"id": "trunk0", "type": "phy", "ethernet_mac_address": "<mac-nic-c>", "mtu": 9000},
{"id": "trunk1", "type": "phy", "ethernet_mac_address": "<mac-nic-d>", "mtu": 9000},
{"id": "bond-trunk", "name": "bond-trunk", "type": "bond", "ethernet_mac_address": "<mac-nic-c>",
"bond_links": ["trunk0", "trunk1"], "bond_mode": "802.3ad", "bond_miimon": 100,
"bond_xmit_hash_policy": "layer3+4", "mtu": 9000}
],
"networks": [
{"id": "node", "network_id": "node", "type": "ipv4", "link": "vlan200",
"ip_address": "10.10.0.11", "netmask": "255.255.0.0",
"routes": [{"network": "0.0.0.0", "netmask": "0.0.0.0", "gateway": "10.10.0.1"}]}
],
"services": [{"type": "dns", "address": "10.10.0.1"}]
}

<mac-nic-c> and <mac-nic-d> are the trunk NICs. On the node, this data becomes bond-mgmt, bond-mgmt.200, and bond-trunk.

The bonds have MTU 9000 only as parents. The node VLAN stays at 1500. Raise the node VLAN MTU only on all nodes at the same time, after you check the switches and the gateway.

Write the user data​

Use userData for the hostname, one admin user with an SSH key, and /etc/hosts:

#cloud-config
hostname: server-1
fqdn: server-1.nodes.internal
manage_etc_hosts: false
ssh_pwauth: false
disable_root: true
users:
- name: <admin-user>
groups: [sudo]
shell: /bin/bash
sudo: "ALL=(ALL) NOPASSWD:ALL"
lock_passwd: true
ssh_authorized_keys: ["<ssh-public-key>"]
write_files:
- path: /etc/hosts
permissions: "0644"
content: |
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
# BEGIN nodes.internal
10.10.0.11 server-1.nodes.internal server-1
10.10.0.12 server-2.nodes.internal server-2
# END nodes.internal
package_update: false
runcmd:
- [systemctl, restart, systemd-resolved]
- [systemctl, restart, systemd-sysctl]
- [modprobe, nf_conntrack]

<admin-user> is the account that you use for kube-dc bootstrap install. Do not add a 127.0.1.1 <hostname> line. The node name must resolve to its node IP. Generate the hosts block from one inventory file, and replace only the marked block when you add servers. The nodes then find each other without DNS.

Provision the server​

Store the network data and the user data of the server in two Secrets. BMO reads the keys networkData and userData:

kubectl -n metal3 create secret generic server-1-netdata --from-file=networkData=server-1-netdata.json
kubectl -n metal3 create secret generic server-1-userdata --from-file=userData=server-1-userdata.yaml

Add the image, the network data, and the user data to the BareMetalHost:

spec:
rootDeviceHints: {serialNumber: <root-disk-serial>, minSizeGigabytes: 100}
image:
url: http://192.0.2.241/ubuntu-2604-<build>.qcow2
checksum: http://192.0.2.241/ubuntu-2604-<build>.qcow2.sha256sum
checksumType: sha256
format: qcow2
networkData: {name: server-1-netdata, namespace: metal3}
userData: {name: server-1-userdata, namespace: metal3}

<root-disk-serial> is the serial number of the local virtual disk from the inspection data. <build> is the image build stamp.

checksum also accepts the SHA-256 value itself. If other people can write to the image server, use the value that you calculated on the build host.

IPA downloads the image over the network, not through virtual media. On the qualified hardware, writing the image took less than 2 minutes.

To provision many servers, start them about 90 seconds apart. In a shell loop that reads a host list, redirect the standard input of each background job from /dev/null. Otherwise the first ssh command reads the rest of the list.

Verify each server​

After the server answers on SSH, check these items:

  • The hostname, the kernel version, and cloud-init status.
  • bond-mgmt is active-backup and has an active member.
  • The node IP is on the node VLAN interface.
  • bond-trunk is 802.3ad and has two members in one aggregator.
  • The default route uses the node gateway.
  • Name resolution and HTTPS egress work.
  • The root file system is on the local disk.

These commands show most of the items:

hostname -f; uname -r; cloud-init status
grep -E '^Bonding Mode|Currently Active Slave' /proc/net/bonding/bond-mgmt
ip -4 -br addr show bond-mgmt.200
grep -E '^Bonding Mode|Slave Interface|Aggregator ID' /proc/net/bonding/bond-trunk
ip route show default
lsblk -sno NAME,SIZE,MODEL "$(findmnt -n -o SOURCE /)"

The output on a correct server looks like this example from an M640:

server-6.nodes.internal
7.0.0-43-generic
status: done
Bonding Mode: fault-tolerance (active-backup)
Currently Active Slave: eno3np2
bond-mgmt.200@bond-mgmt UP 10.10.0.16/16
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Slave Interface: eno1np0
Aggregator ID: 1
Slave Interface: eno2np1
Aggregator ID: 1
default via 10.10.0.1 dev bond-mgmt.200 proto static
sda1 557.2G
└─sda 558.4G PERC H730P Mini

Both trunk members must report the same Aggregator ID. Two different IDs mean that the switch did not bundle the ports. The last two lines show the partition of the root file system and its disk. The disk must be the local virtual disk, not a SAN LUN. On an M630, the same commands report the NIC names eno1 to eno4 and the disk 278.9G PERC H730 Mini.

Then disable the cloud-init network configuration, so that later changes to the netplan file stay:

echo 'network: {config: disabled}' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

Example: 12 blades in one chassis​

This example is the first use of the procedure. Twelve blades in one M1000e chassis ran another hypervisor, and each blade had a Fibre Channel HBA with paths to two production arrays. The names and addresses are replaced with the example values of this guide. The times are measured.

Hardware​

The chassis had these blades:

ServersModelBMCNIC driverLocal disk that inspection reported
10PowerEdge M630iDRAC8 2.86.86.86bnx2xOne PERC H730 Mini virtual disk, 299 GB
2PowerEdge M640iDRAC9 7.00.00.185i40eOne PERC H730P Mini virtual disk, 600 GB

A thirteenth blade was the bastion.

Order of work for one server​

Each server went through these steps:

  1. Prepare the BMC. Only the M630 blades needed the boot mode and the boot order steps.
  2. Change the two management switch ports from LAG members to plain ports.
  3. Add the DHCP reservation for the ramdisk, and reload dnsmasq.
  4. Apply the BareMetalHost without an image, and wait for available.
  5. Check the disks, and write the serial number of the local disk into the inventory.
  6. Apply the BareMetalHost with the image, and wait for provisioned.
  7. Wait for SSH on the node IP, and run the verification commands.

A script did steps 4 to 7 for one server, and one copy of the script ran for each server.

Time for each phase​

The first server took most of one working day, and it was provisioned several times. It showed these problems from Troubleshooting:

  • the BIOS job that stops when Ironic sets UEFI;
  • the one-time boot that the BIOS ignores;
  • the ramdisk without a network;
  • the image without NIC firmware;
  • the host-only initramfs.

Its inspection ran for 35 minutes over slow virtual media.

After those fixes, the next two servers ran at the same time and took about 30 minutes from BMC preparation to SSH. The last nine servers ran in parallel and were ready after about 1.5 hours in total.

BMO records the start and the end of each phase. To read them for one server, run this command:

kubectl -n metal3 get bmh server-1 -o json | jq -c '.status.operationHistory | {inspect, provision}'

The output has the start and end time of the last inspection and the last provisioning. On the first server, the inspection took 35 minutes and the provisioning took 13 minutes.

The other 11 servers reported these durations:

PhaseM630, 9 serversM640, 2 servers
Register the BMC1.0 to 1.5 minutes1.3 to 1.4 minutes
Inspect9.6 to 10.9 minutes7.7 to 8.4 minutes
Provision, until the state is provisioned2.7 to 3.0 minutes2.2 to 2.3 minutes

The BMC preparation of an M630 took the rest of the time for that server. The image was 3.8 GB.

Result​

Every server reached the state provisioned. This list is from 38 days after the run, and it shows three of the 12 servers:

NAME STATUS STATE CONSUMER BMC ONLINE ERROR AGE
server-1 OK provisioned idrac-virtualmedia://192.0.2.31/redfish/v1/Systems/System.Embedded.1 true 38d
server-2 OK provisioned idrac-virtualmedia://192.0.2.32/redfish/v1/Systems/System.Embedded.1 true 38d
server-6 OK provisioned idrac-virtualmedia://192.0.2.36/redfish/v1/Systems/System.Embedded.1 true 38d

The inspection of every server reported one local disk and no SAN LUN. The installed OS detected the SAN LUNs after its first boot, and multipath claimed none of them.

After the run, no server was provisioned again. A later full reinstallation of Kube-DC kept the installed OS. See Reinstall on servers that ran Kube-DC before.

DNS on the nodes​

Give each node only resolvers that return the internal view of the platform domain. Do not add a public resolver as a second server. systemd-resolved changes to the server that answered last. A public resolver returns NXDOMAIN for the platform names, and the node then fails to resolve them.

The installation guide requires *.<domain> and kube-api.<domain> to resolve to the front-door address from the servers and from the workstation. An entry in /etc/hosts does not satisfy that check, because in-cluster DNS forwards to the node resolvers.

Do not put the platform domain or its parent in the node search list.

If the platform domain has a local answer on your resolvers, the cert-manager DNS-01 propagation check can stop. It asks the local resolver for the _acme-challenge record and gets no answer. Set cert-manager to check through public resolvers only:

--dns01-recursive-nameservers-only
--dns01-recursive-nameservers=1.1.1.1:53,8.8.8.8:53

NTP on the nodes​

Ubuntu 26.04 uses NTS servers by default. NTS needs TCP port 4460 in addition to UDP port 123. If your firewall allows only UDP 123, point chrony at an NTP server on the node network, or allow TCP 4460.

Take the bastion out of the data path​

During provisioning, the bastion can be the gateway, DNS server, and NAT for the node network. Do not keep that layout. The bastion becomes a single point of failure for egress, DNS, and SSH, and every host-network connection of the platform passes through it.

Before you install Kube-DC, move these services to the site firewall or router:

ServiceNetworkNote
Gateway and NAT to the internetNode VLANAllow DNS, HTTP, HTTPS, and NTP to the registries and endpoints that the installation guide lists
Recursive DNS with the internal view of the platform domainNode VLANSee DNS on the nodes
NTP serverNode VLANSee NTP on the nodes
GatewayCloud VLANThis is EXT_NET_GATEWAY
Access to the storage array management APIsNode VLAN to the BMC VLANOnly the API ports, with source NAT to the firewall
Deny from the cloud VLANTo the node and BMC VLANsTenant addresses must never reach these networks

To move the gateway, use one of these methods:

  • The firewall takes over the gateway address. Remove the address from the bastion, then enable it on the firewall. The nodes do not change. Do the two steps in this order, and in the reverse order to roll back, so that two devices never answer for one address.
  • The firewall has its own address. Change the gateway and DNS server on each node, one node at a time, with an automatic rollback.

Arm a rollback timer before you change a route that your own session uses:

sudo systemd-run --unit=gw-rollback --on-active=600 \
ip route replace default via <old-gateway>
# change the route, verify, then keep the change:
sudo systemctl stop gw-rollback.timer

<old-gateway> is the gateway that works before the change.

After the move, the bastion keeps only Metal3 on the BMC network. It can stay as a jump host. Reinstall or retire it last, after you have another path to the servers.

Install Kube-DC on the provisioned servers​

The provisioned servers are ordinary Kube-DC hosts. Install the platform with the kube-dc CLI from the bastion, because the bastion reaches every node over SSH on the node network. The installation guide has the full procedure. This section gives the order for servers from this guide.

Before you start, complete these items:

Do these steps:

  1. Install RKE2 on the first control-plane node. Run the command with --dry-run first, review the plan, then run it without --dry-run:

    kube-dc bootstrap install server-1 --ssh-host <admin-user>@10.10.0.11 --name server-1 \
    --domain <domain> --preset <preset> --node-ip 10.10.0.11 --dry-run
  2. Join the other two control-plane nodes, one at a time:

    kube-dc bootstrap install server-2 --ssh-host <admin-user>@10.10.0.12 --name server-2 \
    --domain <domain> --preset <preset> --node-ip 10.10.0.12 \
    --join-server <admin-user>@10.10.0.11 --role server
  3. Join each worker:

    kube-dc bootstrap install server-4 --ssh-host <admin-user>@10.10.0.14 --name server-4 \
    --node-ip 10.10.0.14 --join-server <admin-user>@10.10.0.11 --role worker
  4. Fetch the kubeconfig of the new cluster, and check that it lists the nodes that you installed:

    kube-dc bootstrap fetch-kubeconfig <cluster> --ssh-host <admin-user>@10.10.0.11 \
    --domain <domain> --server https://10.10.0.11:6443
    kubectl --context <cluster> get nodes
  5. Continue with Phase 3 of the installation guide. Use bond-trunk as the external network interface.

The kubeconfig on the bastion then has two clusters. The context of the bastion cluster is default, the name that RKE2 gives it. The context of the Kube-DC cluster is <cluster>. Name the context in every kubectl command, so that a command for one cluster does not go to the other.

The placeholders are:

  • <admin-user>: the account from the user data. It has passwordless sudo.
  • <domain>: the platform domain.
  • <cluster>: the name of the Kube-DC cluster. Use the same name in kube-dc bootstrap init.
  • <preset>: the network preset. See Choose an installation network layout. Use the same domain and preset on every control-plane node.

--node-ip is the address of the node on the node VLAN. The nodes report NotReady until Phase 3 installs the CNI.

On the 12 qualified servers, the RKE2 step took about one minute for each node. Three workers ran at the same time, and all 12 nodes had RKE2 after about 5 minutes. kube-dc bootstrap init then ran for 28 minutes until every node was ready and the platform layers were healthy.

These rules apply to servers from this guide:

  • Select storage disks by a stable name. The installed OS detects the SAN LUNs, and the sdX names can change between boots. Give the installer only disks that you chose, by their /dev/disk/by-id/ paths. See Plan the storage layout.
  • Do not erase the servers to reinstall Kube-DC. The OS from this guide stays. See Reinstall on servers that ran Kube-DC before.

Operate the servers after installation​

The bastion keeps one BareMetalHost for each server. Use it to control the power, and to provision a server again. The commands in this section that read or change a BareMetalHost go to the bastion cluster. Add --context default to them if the current context is the Kube-DC cluster.

List the servers​

To see the state and the power status of every server, run this command:

kubectl -n metal3 get bmh

Restart a server​

To restart a server that runs a Kube-DC node, drain the node first. Then annotate its BareMetalHost:

kubectl -n metal3 annotate bmh server-11 reboot.metal3.io='{"mode":"soft"}'

BMO shuts the OS down, starts the server, and removes the annotation. Use {"mode":"hard"} only if the OS does not respond. After the node is Ready again, uncordon it in the Kube-DC cluster.

Add a server to the running cluster​

To add a server later, do the steps of this guide for that one server:

  1. Prepare its BMC and its two management switch ports.
  2. Add its DHCP reservation, then enroll, check, provision, and verify it.
  3. Add its name to the /etc/hosts block of every node.
  4. Join it as a worker with kube-dc bootstrap install and --join-server. Pass --rke2-version with the RKE2 version of the running cluster, which kubectl get nodes shows. Without the flag, the CLI installs its default version. See Install Kube-DC on the provisioned servers.

For worker pools that Cluster API scales, see Metal3 bare-metal worker nodes.

Provision a server again​

Provisioning writes the image to the root disk again. It does not erase the other disks, because automated cleaning is disabled. To provision a server that runs a Kube-DC node, do these steps:

  1. Drain the node, and remove it from the cluster. See Remove a node. If the node has Ceph OSD disks, remove those OSDs from Ceph first, and wait until Ceph reports that the data is safe. See the Rook OSD management guide. Do not erase a disk that Ceph still uses.
  2. Apply the BareMetalHost without image, networkData, and userData. Wait for the state available. On the qualified hardware, this step took about 30 seconds.
  3. On a Dell 13th generation server, stage the virtual-CD-first boot order. See Put virtual media first in the boot order.
  4. Apply the BareMetalHost with the image again, and verify the server.

Check the servers after a chassis power loss (Dell M1000e)​

In an M1000e chassis, the chassis controller (CMC) assigns the MAC addresses and the Fibre Channel WWPNs of each blade. Dell names this feature FlexAddress. The netplan file of the node, the switch port map, the DHCP reservations, and the SAN zoning all use the chassis-assigned addresses.

After a power loss of the whole chassis, 11 of the 12 blades started correctly. The iDRAC of one blade had no link to the CMC at power-on, and that blade started with its factory addresses. The OS booted, but the node had no network and no SAN paths.

After every chassis power event, check each slot on the CMC:

racadm getflexaddr -i <slot>

<slot> is the chassis slot number of the blade. A correct blade shows (active) in the chassis-assigned column of every NIC and Fibre Channel row:

<Fabric> <Type> <Server-Assigned> <Chassis-Assigned>
slot11-A1 10 GbE KR <factory-mac> <chassis-mac>(active)

<factory-mac> is the address that the adapter has from the factory, and <chassis-mac> is the address that the chassis assigns to the slot.

To repair a blade that does not show (active) there, do these steps:

  1. Restart the iDRAC of the blade. The server keeps running.
  2. Run the check again until every row shows (active).
  3. Restart the server through its BareMetalHost. See Restart a server.

The iDRAC restart is a Redfish action:

curl -sk -u <bmc-user> -X POST -H 'Content-Type: application/json' \
-d '{"ResetType": "GracefulRestart"}' \
https://192.0.2.41/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Manager.Reset

<bmc-user> is a BMC account with the right to reset the iDRAC. curl asks for its password.

A power cycle of the server without the iDRAC restart did not help. The blade started with its factory addresses again.

Safe operation rules​

Follow these rules during the whole project:

  • Do not change a switch through a path that crosses that switch. Use the console of the switch (for example, through the chassis manager) or a path that does not depend on it. A link change in the middle of an SSH session can disconnect the only operator.
  • Make every change reversible. Save the running switch configuration first. Use netplan try and rollback timers on hosts.
  • Do not do BIOS or iDRAC jobs while a BareMetalHost exists for the server. Delete the host while it is unprovisioned and cleaning is disabled, or detach it.
  • Do not leave a kernel VLAN interface on the trunk bond. After Kube-OVN takes the trunk, a VLAN interface such as bond-trunk.300 takes the frames that Open vSwitch needs. To test the cloud VLAN before installation, create the interface on one node, test, and delete it.
  • Generate files from one inventory. Generate the host list, the DHCP reservations, /etc/hosts, and the switch descriptions from one source. Do not edit generated files by hand.

Troubleshooting​

Slow virtual media​

Symptom: inspection times out. The server console shows GRUB still loading the boot partition.

Cause: iDRAC8 virtual media can transfer the IPA ISO at 1 to 118 MB per minute. The default inspection timeout is 30 minutes.

Fix: set inspect_wait_timeout and deploy_callback_timeout to 3600 in the Ironic resource. To see whether the BMC streams the ISO, add up the bytes of the GET /redfish/boot-*.iso requests in the Ironic httpd container log.

The server boots the old OS or the network instead of the ramdisk​

Symptom: Ironic reports that it set a one-time boot from virtual media, but the server boots another device. The ISO log shows only a few kilobytes.

Fix: put the virtual CD first in the permanent boot order. See Put virtual media first in the boot order.

The BIOS job stops when Ironic sets UEFI​

Symptom: the Lifecycle Controller logs UEFI0315 and RAC0561. The BIOS job stops at 34 percent. Retries fail with SYS011, JCP024, or PR34.

Fix: set the boot mode yourself, and reseat the server from the chassis manager. See Set UEFI boot mode.

The ramdisk has no network​

Symptom: the ramdisk boots, but it never reports to Ironic. The switch learns no MAC address on the port, or the ramdisk sends only an IPv6 router solicitation.

Cause: the management ports are LACP members, or the ramdisk ignored the static network data from preprovisioningNetworkDataName.

Fix: use plain switch ports with the provisioning VLAN untagged, and run the known-MAC DHCP server. See Give the IPA ramdisk an address.

The server is provisioned but has no network​

Symptom: the host reaches provisioned, but the node IP does not answer. The console shows the NICs without a link.

Fix: install linux-generic and linux-firmware in the image. See Prepare the server image.

The server stops in emergency mode​

Symptom: the console shows Entering emergency mode and rdsosreport.txt.

Fix: build a generic initramfs that contains the RAID driver. See Prepare the server image.

Reprovisioning stops in "provisioning"​

Symptom: a second deployment to the same server waits for about 25 minutes, and the server boots its installed OS.

Fix: stage the virtual-CD-first boot order before you provision again. See Put virtual media first in the boot order.

A node has no network and no SAN paths after a chassis power loss​

Symptom: after the chassis lost power, one blade boots to the login prompt, but its node IP does not answer and its multipath devices have no paths.

Cause: the blade started with its factory MAC addresses and WWPNs, not with the addresses that the chassis assigns.

Fix: restart the iDRAC of the blade, then restart the server. See Check the servers after a chassis power loss.