ac2f67adadb527ea5c6e0804de5fded0146d2b6a
Refactored the single 1200-line es24n_conf.py into six modules plus a slim entry point, in preparation for the upcoming network-based config workflow. Each file has a clear, single responsibility: ui.py — ANSI colours, display primitives, input prompts serial_port.py — SerialPort class (termios/fcntl/select) models.py — IOMConfig and ShelfConfig dataclasses redfish.py — Redfish API client (shared by all workflows) workflow_serial.py — Serial-based IOM network configuration workflow workflow_firmware.py — IOM and Fabric Card firmware update workflow es24n_conf.py — Entry point and main menu only No functional changes. All imports verified. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ES24N IOM Configuration Tool
A single-file interactive CLI tool for configuring network settings and updating firmware on TrueNAS ES24N expansion shelf IOM (I/O Module) controllers.
Requirements
- Python 3 (standard library only — no external dependencies)
- A USB serial cable connected from the ES24N IOM1 port to the active TrueNAS controller
- Root or serial device group permissions
Usage
python3 es24n_conf.py
If the serial device is inaccessible, re-run with sudo:
sudo python3 es24n_conf.py
Features
Network Configuration
Connects to the IOM over a USB serial connection and configures each IOM's management network interface via the Redfish API.
- Supports both Static IP and DHCP configuration
- Configures IOM1 and IOM2 independently in a single session
- Displays current network settings before making any changes
Firmware Updates
Connects to each IOM directly over the network (not serial) and updates IOM and/or Fabric Card firmware via the Redfish API.
- Update IOM firmware, Fabric Card firmware, or both
- Displays current firmware versions before and after the update
- Polls update task progress automatically
Workflow
Configure a Shelf
- Connect the serial cable from the ES24N IOM1 port to the controller's USB port
- Run the tool and select Configure a new ES24N shelf
- The tool detects the serial device, opens the connection, and prompts for the BMC admin password
- Current network settings for IOM1 and IOM2 are displayed
- Choose to apply a new Static IP or DHCP configuration, or leave settings unchanged
- Changes are applied via Redfish PATCH requests over the serial loopback (
127.0.0.1)
Update Firmware
- Ensure this system has network access to the IOM management interfaces
- Run the tool and select Update IOM / Fabric Card Firmware
- Enter the admin password and IP addresses for IOM1 and IOM2
- Select what to update and provide the firmware file path(s)
- The tool uploads, applies, and monitors each update, then restarts the affected components
HA Systems: Update the passive IOM first. After updating both IOMs on one controller, initiate a TrueNAS failover and re-run the tool for the other controller.
Notes
- Setting a static IP requires two sequential Redfish PATCH requests due to a known ES24N firmware bug. The tool handles this automatically.
- Firmware uploads are performed over the network — uploading over the 115200-baud serial connection would be impractically slow.
- After applying network changes, verify each expander appears in TrueNAS under System Settings > Enclosure > NVMe-oF Expansion Shelves before disconnecting the serial cable.
Description
Languages
Python
100%