okurz / baremetal_support

A support service for baremetal testing
GNU General Public License v3.0
5 stars 4 forks source link

Power and boot device control #10

Open richiejp opened 4 years ago

richiejp commented 4 years ago

Everybody has scripts like the following:

# Ensure the power is set to on or off; wait and retry if necessary
# Usage: ./lib/ipmi/power.sh <on/off>

STATUS=$1
status=

while true; do
    $IPMI power $1
    sleep 3
    status=$($IPMI power status)
    case $status in
    "Chassis Power is $STATUS") exit 0;;
    "Chassis Power is"*) continue;;
    *) break;;
    esac
done

echo "power.sh: IPMI returned an unrecognized message:" $status

and

export IPMI="ipmitool -I lanplus -H frodo-sp.qa.suse.de"
say "Using IPMI command: " $IPMI

say "Ensuring PXE boot"
$IPMI chassis bootdev pxe "options=verbose=yes"
$IPMI chassis bootparam get 5

and the equivalent in os-autoinst.

Basically wrapping IPMI to reboot into PXE to do an unattended installation. Perhaps this could be implemented in support service? Assuming there is actual common ground. Also may abstract away none PXE/IPMI control methods.

frankenmichl commented 4 years ago

I actually like the idea. This may mean we need to add some non-volatile configuration for the machines. We could also try supporting redfish here, which most of our machines also support.

I think we should implement this.