one-time PXE boot from Linux on HP Proliant hardware
This should be possible with ipmitool. Just run:
ipmitool chassis bootdev pxe
And your next boot should be a PXE boot.
Edit: This doesn't seem to work for HP iLO2. However, you can SSH in to the iLO2 interface and reconfigure it there by issuing
set /system1/bootconfig1/bootsource5 bootorder=1
On systems that don't support booting from USB key it will be bootsource4
instead. For complete details, see the iLO2 Scripting Reference
You can issue this command as an argument to ssh
and that should work as well.
So I figured this out with the help of a coworker. Its a dirty, dirty hack, but it works! HP Proliants (at least now, at the end of 2009) will try to boot from a CDROM, then try the harddisk, then try a USB stick, and then they'll do a PXE boot. Since I am reimaging servers anyway, I've figured out that if we zap the boot sector anyway and immediately reboot, HP boxen will go through the boot process, bypass the harddisk because there's no MBR, and immediately PXE-boot. I've written a script that issues the dd commands thusly:
#!/bin/bash
# This is meant to assist in re-imaging a server. This will blow away the
# main partition of a given box, forcing it to pxe-boot next boot.
# Naturally, don't be an idiot and run this on a machine you DON'T want nuked
# from orbit
echo "Nuking from orbit will commence in 5 seconds. Ctrl-C if this NOT what you want."
echo "You have been warned!"
sleep 8
dd if=/dev/urandom of=/dev/cciss/c0d0 bs=512 count=2
dd if=/dev/urandom of=/dev/cciss/c0d0p1 bs=512 count=2
dd if=/dev/urandom of=/dev/cciss/c0d1p1 bs=512 count=2
dd if=/dev/urandom of=/dev/cciss/c0d2p1 bs=512 count=2
sync
echo "Nuke complete! Rebooting in 5..."
sleep 5
reboot
HTH! --Lee
Alternatively, use the tools from the HP Proliant Support Pack (rpm named hp-health) ... there's a CLI program called 'hpbootcfg' that will do exactly what you want: USAGE: bootcfg [-F -C -H -T] [-S -Q -R -P] [-r -d -n -b] -D Set Defaults everywhere
-F Floppy first
-C CD ROM first
-H Harddrive first
-T Tape first
-S one time boot to system configuration utility
-Q one time boot to quick configuration utility
-R one time boot to RBSU
-P one time boot to PXE
-r one time remote
-d one time remote dial out
-n one time remote network
-b bypass F1/F2