In environments without IPMI (like VMs), compute nodes cannot be reset using ipmitool. Instead, OpenHPC uses runtime-emitted placeholders that the script prints to stdout during execution. An external monitoring process must wrap the script execution to intercept these lines and trigger a hypervisor-level reset.
Placeholder Format:
When the has_ipmi flag is 0, the script emits lines in the following format:
#<<< ohpc_reset:index,node_name,bmc_address >>>#
Example Output:
#<<< ohpc_reset:0,c1,192.168.1.101 >>>#
#<<< ohpc_reset:1,c2,192.168.1.102 >>>#
Implementation Example (Monitoring Wrapper):
#!/bin/bash
# Run recipe.sh and intercept ohpc_reset lines to trigger VM resets
bash recipe.sh 2>&1 | while IFS= read -r line; do
printf '%s\n' "$line"
pat='^#<<<[[:space:]]ohpc_reset:([0-9]+),([^,]+),(.+)[[:space:]]>>>#$'
if [[ "$line" =~ $pat ]]; then
idx="${BASH_REMATCH[1]}"
node_name="${BASH_REMATCH[2]}"
bmc_addr="${BASH_REMATCH[3]}"
echo ">>> Triggering reset for ${node_name} [${idx}] (${bmc_addr})" >&2
openstack server reboot --hard "${node_name}"
fi
done
#<<< ohpc_reset:0,c1,192.168.1.101 >>>#