Platform Engineering · Lesson 111

Bare-Metal Provisioning, PXE, Image Pipelines, and the Hardware Lifecycle

Clouds hide the hardware; someone still racks it, powers it, cools it, installs it, patches its firmware, and retires it. Bare-metal provisioning turns a new server into a working node without hands on a keyboard: the server PXE-boots (or HTTP-boots) from the network, gets an IP from DHCP, loads an installer, and installs a golden image built by an image pipeline (Packer, or OS image builders) and configured by automation. Around it sit the BMC (out-of-band management through IPMI or Redfish), firmware and the hardware lifecycle, power and cooling budgets per rack, GPU servers with their own demands, and hybrid links to the cloud. This lesson follows one rack of GPU servers from delivery to production, and shows two failures: hand-built servers that drifted apart, and a rack that tripped its power budget.

Difficulty: Advanced · Know this first: Lesson 110, Lesson 28

What you will learn

By the end of this lesson you can work at four levels:

This page teaches it with a plain-language analogy, an animated diagram with normal and failure scenarios, a simulator, a quiz, basic, intermediate, advanced, and master checks, the expert detail ("Go deeper"), a production incident, a hands-on lab with commands and their output, and a production design exercise.

Run it as:

When it breaks, I check

One thing to remember

Where the time goes

This bar adds up hours from delivery to production. It is a worked example, not a measurement. The power and image hops are where racks trip and fleets drift.

Try it: plan the rack

Pick how servers are installed, how power is planned, and whether burn-in runs. The rack has two 32 A feeds at 230 V (about 7.4 kW each, kept under 80%).

11.2 kWrack peak draw
76%of the safe limit
noneconfiguration drift after a year

Check yourself

Three questions. No score is saved anywhere — this is just you against the material.

Basic to master

Bare-metal operations grow in four levels: reading hardware state, provisioning from the network, running image pipelines and burn-in, and managing a fleet through its lifecycle.

Basic — Read hardware state

At the basic level you can find out what a server is and how healthy it is.

  • dmidecode, lspci, lsblk, smartctl, ipmitool sensor.
  • The BMC: power state, console, the hardware event log.
  • The inventory record for the server.

Where it breaks: changing BIOS settings by hand on one server.

Try it: Basic

A node reboots at random. Where do you look first?

Now do it: Read a server's SEL with ipmitool sel list.

Intermediate — Provision from the network

At the intermediate level servers install themselves.

  • DHCP, TFTP or HTTP, iPXE; a provisioning tool (MAAS, Tinkerbell, Foreman, Ironic).
  • BMC on an isolated network; Redfish for power and boot order.
  • Configuration by Ansible or cloud-init after install.

Try it: Intermediate

How does the provisioning system make a server boot from the network?

Now do it: Set the boot device with ipmitool chassis bootdev pxe on a lab server.

Advanced — Image pipelines and burn-in

At the advanced level images are built and tested like software.

  • Packer or image builders with pinned kernel and drivers; tests; versioned releases.
  • Rolling image updates in waves with drain and canary nodes.
  • Burn-in with stress tests, GPU diagnostics, and error counters.

Try it: Advanced

Why pin the GPU driver to the kernel in the image?

Now do it: Check the kernel and driver versions on a GPU node.

Master — A fleet through its lifecycle

At the master level the fleet is planned from rack to retirement.

  • Power and cooling capacity per row and site; PUE tracked.
  • Firmware baselines and waves; failure rates per component and model.
  • Refresh and retirement plans; secure erasure; hybrid capacity with the cloud.

Trade-off: owning hardware is cheaper for steady, heavy use (often GPUs) and needs the people and automation to run it; the cloud is better for bursts and new experiments.

Try it: Master

When is owning GPU hardware usually cheaper than renting it in the cloud?

Now do it: Compare three-year costs for one GPU server at your utilisation.

Go deeper

Out-of-band control with Redfish and IPMI (read-only first; the last commands change power and boot state, so run them only on lab hardware):

curl -sk -u "$BMC_USER:$BMC_PASS" https://$BMC/redfish/v1/Systems/1 | jq '{PowerState, BiosVersion, Model, SerialNumber}'
curl -sk -u "$BMC_USER:$BMC_PASS" https://$BMC/redfish/v1/Chassis/1/Power | jq '.PowerControl[0].PowerConsumedWatts'
ipmitool -I lanplus -H $BMC -U $BMC_USER -E sensor | grep -Ei "temp|power|fan"
ipmitool -I lanplus -H $BMC -U $BMC_USER -E sel list | tail      # hardware event log
# changes state (lab only):
ipmitool -I lanplus -H $BMC -U $BMC_USER -E chassis bootdev pxe options=efiboot
ipmitool -I lanplus -H $BMC -U $BMC_USER -E power cycle

A minimal iPXE script served to new machines: it fetches a kernel and initramfs over HTTP and boots an installer with the server's MAC address so the provisioning system can pick its workflow.

#!ipxe
dhcp
set base http://provision.example.internal/images/gpu-node-v41
kernel ${base}/vmlinuz initrd=initrd.img ip=dhcp provision.mac=${net0/mac}
initrd ${base}/initrd.img
boot

A Packer template (HCL) for the image would pin the base OS release, install a specific kernel and the matching NVIDIA driver, enable chrony, apply hardening, and run tests (for example, that the driver module loads) before publishing. Rack power arithmetic: a 32 A feed at 230 V is about 7.4 kW; with two feeds for redundancy, keep total load under one feed's safe limit (often 80%, about 5.9 kW) if the rack must survive losing a feed, or under 80% of both if it need not.

One time it broke

This is a composite of a failure pattern that keeps repeating; the details are illustrative. The breaker and the burn-in.

Timeline

  • Day 016 GPU servers are racked in C14. The power plan uses the vendor's typical figure, measured at moderate load.
  • Day 1, 10:00Burn-in starts GPU stress on all 16 servers at once.
  • Day 1, 10:07Combined draw exceeds the circuit's rating; the breaker trips. The rack and a storage shelf sharing the circuit lose power.
  • Day 1–2The storage shelf is checked and resynced; BMC power caps are set on every GPU server; two servers move to another rack; burn-in repeats in two waves.

What changed after

Power plans use measured peak draw under full GPU load, BMC power caps are part of the provisioning workflow, high-draw racks have no shared circuits with storage, and burn-in ramps up in waves while power is watched.

Try it yourself, from scratch

Everything here runs on any Linux machine: your own laptop, WSL on Windows (run wsl --install in PowerShell once), or a small cloud VM. The Python needs only Python 3 and its standard library; check that you have it with python3 --version.

Before you start: Linux with root on a machine you own (a lab server or your own PC) for the hardware commands, and Python 3. Everything here only reads.

1. Linux commands

Type each one, read what it prints, and compare it with the note above it.

  1. What is this machine? Model, serial, BIOS, from the firmware tables.

    Privileged

    sudo dmidecode -s system-manufacturer; sudo dmidecode -s system-product-name; sudo dmidecode -s bios-version

    Options: -s prints a single string; -t memory or -t system print whole sections.

    Expect: The manufacturer, model, and BIOS version: what the inventory should record. Read-only (inside a VM it shows the hypervisor's values).

  2. List PCI devices with their drivers: GPUs and NICs, and whether a driver is bound.

    Read-only

    lspci -nnk | grep -A3 -Ei "vga|3d|ethernet" | head -20

    Options: -nn shows vendor and device IDs; -k shows the kernel driver in use.

    Expect: Each GPU and NIC with "Kernel driver in use"; a missing line means no driver is bound. Read-only.

  3. Check disk health and the kernel and driver versions that an image pipeline should pin.

    Privileged

    lsblk -d -o NAME,MODEL,SIZE,ROTA
    sudo smartctl -H /dev/sda 2>/dev/null || sudo smartctl -H /dev/nvme0 2>/dev/null
    uname -r; modinfo -F version nvidia 2>/dev/null || echo "no NVIDIA driver installed"

    Expect: Disks, a SMART health verdict (PASSED), the running kernel, and the GPU driver version if present. Read-only.

2. Python: rack.py

This program plans a rack of GPU servers against its power budget using idle and peak draw, with and without BMC power caps, and checks a small fleet for drift against the golden image: kernel, GPU driver, and BIOS versions that do not match the image are the "snowflakes" that cause hard-to-reproduce failures. Save it as rack.py, then run it.

# rack.py
FEED_KW = 32 * 230 / 1000            # one 32 A feed at 230 V
SAFE = 0.8                           # keep under 80% of a feed
REDUNDANT = False                    # True if the rack must survive losing a feed (then only one feed counts)
limit = FEED_KW * SAFE if REDUNDANT else 2 * FEED_KW * SAFE
SERVER = {"idle_kw": 1.6, "peak_kw": 6.5}

print(f"safe rack limit: {limit:.1f} kW ({'one feed, redundant' if REDUNDANT else 'both feeds'})")
for n, cap in ((4, None), (4, 2.8), (6, 2.8)):
    peak = n * (min(SERVER["peak_kw"], cap) if cap else SERVER["peak_kw"])
    idle = n * SERVER["idle_kw"]
    label = f"{n} servers" + (f", capped at {cap} kW" if cap else "")
    print(f"  {label:<26} idle {idle:4.1f} kW   peak {peak:5.1f} kW   {'OK' if peak <= limit else 'TRIPS at full load'}")
print()

GOLDEN = {"kernel": "6.8.0-48", "nvidia": "550.127.05", "bios": "2.19.1"}
FLEET = {
    "gpu-01": {"kernel": "6.8.0-48", "nvidia": "550.127.05", "bios": "2.19.1"},
    "gpu-02": {"kernel": "6.8.0-48", "nvidia": "550.127.05", "bios": "2.19.1"},
    "gpu-03": {"kernel": "6.8.0-51", "nvidia": "550.127.05", "bios": "2.19.1"},
    "gpu-04": {"kernel": "6.8.0-48", "nvidia": "550.90.07", "bios": "2.14.0"},
}
for node, facts in FLEET.items():
    drift = [f"{k} {v} (image {GOLDEN[k]})" for k, v in facts.items() if v != GOLDEN[k]]
    print(f"{node}: {'matches image v41' if not drift else 'DRIFT: ' + '; '.join(drift)}")

Run it, and you should see this output:

$ python3 rack.py
safe rack limit: 11.8 kW (both feeds)
  4 servers                  idle  6.4 kW   peak  26.0 kW   TRIPS at full load
  4 servers, capped at 2.8 kW idle  6.4 kW   peak  11.2 kW   OK
  6 servers, capped at 2.8 kW idle  9.6 kW   peak  16.8 kW   TRIPS at full load

gpu-01: matches image v41
gpu-02: matches image v41
gpu-03: DRIFT: kernel 6.8.0-51 (image 6.8.0-48)
gpu-04: DRIFT: nvidia 550.90.07 (image 550.127.05); bios 2.14.0 (image 2.19.1)

3. What to notice

4. Advanced: every step as one Bash script

The same Linux steps, made into a real script you can keep and run again. It uses the Bash features a production script needs: functions (one per step), an array of step names, arguments to choose steps, a case for options, exit codes recorded for each step, and a trap that prints a summary even when you stop it with Ctrl+C. Make a folder for this lesson (mkdir -p ~/labs/bare-metal-provisioning-pxe-image-pipelines-and-hardware-lifecycle && cd ~/labs/bare-metal-provisioning-pxe-image-pipelines-and-hardware-lifecycle) and save this as lab.sh.

#!/usr/bin/env bash
# The Linux steps of "Bare-Metal Provisioning, PXE, Image Pipelines, and the Hardware Lifecycle", as one script (save it as lab.sh).
#
#   ./lab.sh          run every step, in order
#   ./lab.sh 2 4      run only steps 2 and 4
#   ./lab.sh --list   list the steps
#
# The steps share one shell, so a later step can use what an earlier one set up (a folder,
# a variable, a container): run them all in order the first time. Your own scripts should
# start with "set -euo pipefail"; this one runs teaching commands, and some of them fail on
# purpose, so it records each step's exit code instead of stopping at the first failure.

STEPS=(
  'What is this machine? Model, serial, BIOS, from the firmware tables.'
  'List PCI devices with their drivers: GPUs and NICs, and whether a driver is bound.'
  'Check disk health and the kernel and driver versions that an image pipeline should pin.'
)

step_1() {
sudo dmidecode -s system-manufacturer; sudo dmidecode -s system-product-name; sudo dmidecode -s bios-version
}

step_2() {
lspci -nnk | grep -A3 -Ei "vga|3d|ethernet" | head -20
}

step_3() {
lsblk -d -o NAME,MODEL,SIZE,ROTA
sudo smartctl -H /dev/sda 2>/dev/null || sudo smartctl -H /dev/nvme0 2>/dev/null
uname -r; modinfo -F version nvidia 2>/dev/null || echo "no NVIDIA driver installed"
}

# print a step that has to be run by hand, instead of running it
by_hand() {
  echo "  (run this one yourself: $1)"
  sed 's/^/    /'
}

RESULTS=()
run_step() {
  local n=$1 start=$SECONDS code
  printf '\n== step %d of %d: %s\n' "$n" "${#STEPS[@]}" "${STEPS[n-1]}"
  "step_$n"
  code=$?
  RESULTS+=("step $n: exit code $code, $((SECONDS - start)) s")
}

summary() {
  echo
  echo "== summary"
  local r
  for r in "${RESULTS[@]}"; do echo "  $r"; done
}

case "${1:-}" in
  -h|--help) sed -n '2,6p' "$0"; exit 0 ;;
  --list) for i in "${!STEPS[@]}"; do echo "$((i + 1)). ${STEPS[i]}"; done; exit 0 ;;
esac

[ $# -eq 0 ] && set -- $(seq 1 "${#STEPS[@]}")
for n in "$@"; do
  if ! [[ $n =~ ^[0-9]+$ ]] || (( n < 1 || n > ${#STEPS[@]} )); then
    echo "there is no step '$n'; try --list" >&2
    exit 2
  fi
done
trap summary EXIT
trap 'echo; echo "stopped with Ctrl+C"; exit 130' INT
for n in "$@"; do run_step "$n"; done

Then make it executable and run it:

chmod +x lab.sh
./lab.sh --list     # the steps
./lab.sh            # every step, then a summary of exit codes and times
./lab.sh 2 3        # only steps 2 and 3

5. Learn the basics behind it

New to a feature used above? These W3Schools pages explain each one from zero, with examples you can run in the browser.

If you remember nothing else

Design exercise

Your company is building an on-premises GPU cluster of 64 servers in a colocation facility, connected to its cloud. Design how servers go from delivery to production and through their lifecycle.

Clarifying questions to ask

What is the source of truth? How are power and cooling planned per rack? How are BMCs managed and secured? How do servers install, and how are images built and updated? What does burn-in test? How are firmware, failures, and retirement handled? How does the cluster connect to the cloud?

Rough sizing

Say 64 servers with 8 GPUs each, up to about 10 kW per server at full load, racks with two 32 A feeds, a 5-year life, and a dedicated link to the cloud hub.

Shape of the answer

NetBox as the source of truth; racks planned from measured peak draw with BMC power caps (two to four servers per rack depending on feeds), no storage on GPU circuits; BMCs on an isolated management VLAN with vault-managed credentials and Redfish; Tinkerbell or MAAS for PXE installs of a Packer-built image with pinned kernel and NVIDIA driver; Ansible for role configuration; 24-hour burn-in with DCGM diagnostics and stress tests; nodes join Kubernetes with the GPU operator as canaries first; firmware baselines rolled out in waves with drains; failure tracking and warranty dates in the inventory; the cluster connected through Direct Connect or equivalent to the cloud hub.

Trade-offs to name

Fewer servers per rack costs floor space and saves trips and outages; automation takes weeks to build and pays back on the second rack; owning GPUs pays off only at high, steady utilisation.

Failure modes and how to troubleshoot them

Each row is one way this system went wrong in the diagram's scenarios. The hop number is where to look first.

ScenarioWhereEffectWhat goes wrong
Hand-built serversHop 5: Golden imageBreaksServers are installed by hand from a USB stick and configured by whoever is on shift. Over a year, kernel versions, GPU driver versions, BIOS settings, and sysctl values differ across the fleet.
Power budget ignoredHop 2: Power and coolingBreaksThe plan used figures for servers at rest. During burn-in all 16 GPU servers reach full load together and draw well over the circuit's rating. The breaker trips; the rack and a storage shelf on the same circuit go down.

How to troubleshoot

  1. Write down the symptom and when it started: what users see, which number moved, and what changed just before (a deploy, a config change, traffic).
  2. Walk the path in order, from the first hop to the last: Inventory → Power and cooling → BMC → PXE boot → Golden image → Configuration → Burn-in → Join the cluster → Lifecycle. The first hop whose evidence is wrong is where to dig.
  3. At that hop, run the read-only check from the diagram or the lab first; change nothing until the evidence points at a cause.
  4. Fix the smallest thing that restores service, or roll back the last change, and confirm the symptom is gone with the same check.
  5. Write down what you found and the check that would have caught it sooner, so the next person starts there.

References and review

The official documentation and standards behind this lesson. Versions and defaults change; when a command or field here differs from them, trust the official page.

Last updated . Next review due by November 2027. Found something out of date? Tell me.

Saved on this device, in this browser.
Next in this series · Lesson 112
Containers and Docker

I used to ship code by copying files onto a server and hoping the server had the right libraries. Sometimes it did. Sometimes it did not, and I found out at 2 AM. A container changed that deal for me.

Go to Lesson 112 →

Or browse the full course from the Lessons index.