A lightweight, single-file Python CLI tool for mounting ISO images over HTTP/HTTPS to Dell iDRAC via Redfish API, setting one-time boot to virtual CD, and rebooting the server.
Perfect for automating remote OS installations, rescue boots, and bare-metal provisioning on Dell PowerEdge servers.
- π Single-file script - Easy to deploy and use
- π Secure by default - TLS verification enabled (with option to disable)
- π Automatic retries - Handles transient network errors gracefully
- π Clear logging - Info and debug modes for troubleshooting
- π― Smart discovery - Automatically finds the correct VirtualMedia endpoint
- β‘ Fast execution - Completes in seconds with proper error handling
- π‘οΈ Exit codes - Scriptable with standard exit codes
- π‘ Smart power management - Automatically powers on if server is off, reboots if on
- Python 3.8 or higher
requestslibrary- Dell iDRAC9 or iDRAC10 with Redfish support
- Network access to both iDRAC and ISO URL
curl -O https://raw.githubusercontent.com/yourusername/redfish-iso/main/idrac_iso_tool.py
chmod +x idrac_iso_tool.pygit clone https://github.com/yourusername/redfish-iso.git
cd redfish-iso
chmod +x idrac_iso_tool.pypip install requestsOr with a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install requestspython idrac_iso_tool.py \
-H 10.0.0.25 \
-u root \
-p calvin \
-i http://repo.example.com/ubuntu-24.04.isopython idrac_iso_tool.py \
--host idrac.example.com \
--user admin \
--iso https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.isopython idrac_iso_tool.py -H 10.0.0.25 -u root -i http://repo.local/installer.iso
# Password prompt appears (hidden input)python idrac_iso_tool.py \
-H 10.0.0.25 \
-u root \
-p calvin \
-i http://repo.local/new-installer.iso \
--eject-firstpython idrac_iso_tool.py \
-H 10.0.0.25 \
-u root \
-p calvin \
-i http://repo.local/installer.iso \
--insecure| Option | Description |
|---|---|
-H, --host |
iDRAC hostname or IP address |
-u, --user |
iDRAC username |
-i, --iso |
HTTP(S) URL to ISO image |
| Option | Description | Default |
|---|---|---|
-p, --password |
iDRAC password (prompts if omitted) | - |
--insecure |
Disable SSL certificate verification | False |
--timeout |
Request timeout in seconds | 30 |
--debug |
Enable debug logging | False |
--eject-first |
Force eject existing media before insert | False |
--no-wait |
Don't wait for status confirmation | False |
--manager-id |
Manager ID | iDRAC.Embedded.1 |
--system-id |
System ID | System.Embedded.1 |
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Authentication or connection error |
| 2 | API error (invalid response, conflict, etc.) |
| 3 | Invalid arguments |
| 4 | Timeout |
#!/bin/bash
# deploy-server.sh
IDRAC_HOST="10.0.0.25"
IDRAC_USER="root"
IDRAC_PASS="calvin"
ISO_URL="http://repo.local/ubuntu-autoinstall.iso"
python idrac_iso_tool.py \
-H "$IDRAC_HOST" \
-u "$IDRAC_USER" \
-p "$IDRAC_PASS" \
-i "$ISO_URL" \
--eject-first
if [ $? -eq 0 ]; then
echo "Server is rebooting and will install Ubuntu"
else
echo "Failed to mount ISO"
exit 1
fi# .github/workflows/provision.yml
- name: Mount installation ISO
run: |
python idrac_iso_tool.py \
-H ${{ secrets.IDRAC_HOST }} \
-u ${{ secrets.IDRAC_USER }} \
-p ${{ secrets.IDRAC_PASSWORD }} \
-i https://repo.example.com/os-install.iso \
--insecure# Boot into rescue mode
python idrac_iso_tool.py \
-H server1-idrac.local \
-u admin \
-i https://boot.netboot.xyz/ipxe/netboot.xyz.iso \
--debug- Authenticate - Connects to iDRAC using Basic Authentication
- Discover - Finds the VirtualMedia CD endpoint via Redfish API
- Check State - Verifies current media status (ejects if
--eject-first) - Insert ISO - Mounts the ISO from the provided HTTP(S) URL
- Set Boot - Configures one-time boot override to CD
- Check Power State - Determines if server is powered on or off
- Power On/Reboot - Powers on (if off) or reboots (if on) the server
- Verify - Waits for confirmation (unless
--no-wait)
Smart Power Management: The tool automatically detects the server's power state. If the server is powered off, it executes a startup from CD. If the server is already running, it performs a reboot.
GET /redfish/v1
GET /redfish/v1/Systems/System.Embedded.1
GET /redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia
GET /redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD
POST /redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia
POST /redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.EjectMedia
PATCH /redfish/v1/Systems/System.Embedded.1
POST /redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset
# Verify credentials
curl -k -u root:calvin https://10.0.0.25/redfish/v1
# Try with correct credentials
python idrac_iso_tool.py -H 10.0.0.25 -u root -p correct_password -i http://...# For production: Add CA certificate to system trust store
# For testing only: Use --insecure flag
python idrac_iso_tool.py -H 10.0.0.25 -u root -p calvin -i http://... --insecure# Force eject before inserting new media
python idrac_iso_tool.py -H 10.0.0.25 -u root -p calvin -i http://... --eject-first# Increase timeout for slow networks
python idrac_iso_tool.py -H 10.0.0.25 -u root -p calvin -i http://... --timeout 60# Enable debug logging to see all API calls
python idrac_iso_tool.py -H 10.0.0.25 -u root -p calvin -i http://... --debug- Dell PowerEdge R640, R650, R750 (iDRAC9)
- Dell PowerEdge R660, R760 (iDRAC10)
- Python 3.8, 3.9, 3.10, 3.11, 3.12
- Any Dell server with iDRAC9 or iDRAC10
- Redfish 1.x compatible iDRAC firmware
- Never commit passwords to version control
- Use environment variables or secure vaults for credentials
- Enable TLS verification in production (
--insecureshould only be used for testing) - ISO URLs over HTTP are warned about (use HTTPS when possible)
- The tool does not store or cache credentials
export IDRAC_HOST="10.0.0.25"
export IDRAC_USER="root"
export IDRAC_PASS="calvin"
python idrac_iso_tool.py \
-H "$IDRAC_HOST" \
-u "$IDRAC_USER" \
-p "$IDRAC_PASS" \
-i http://repo.local/installer.iso- HTTP/HTTPS only - NFS and CIFS shares are not supported
- Single host - No multi-node orchestration (use shell loops or Ansible)
- No ISO upload - ISO must be hosted on accessible HTTP(S) server
- One-time boot only - Persistent boot configuration not supported
Contributions are welcome! Please feel free to submit a Pull Request.
git clone https://github.com/yourusername/redfish-iso.git
cd redfish-iso
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt# Syntax check
python3 -m py_compile idrac_iso_tool.py
# Type hints check (if mypy installed)
mypy idrac_iso_tool.py
# Test help output
python idrac_iso_tool.py --helpMIT License - See LICENSE file for details
Created for automating Dell PowerEdge bare-metal provisioning
- π Report Issues
- π¬ Discussions
- π Wiki