I'm trying to run BMC commands via SSH to check the power status of the host, turn it on, and turn it off.
I can successfully SSH into the host and run some commands, for example:
$ cat /etc/os-release
ID="openbmc-phosphor"
NAME="Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro)"
VERSION="2.7.0-dev"
VERSION_ID="2.7.0-dev-571-g67efd9872"
PRETTY_NAME="Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) 2.7.0-dev"
BUILD_ID="2.7.0-dev"
OPENBMC_TARGET_MACHINE="talos"
I know the BMC versioning is probably out of date, but Raptor isn't making it easy to stay current (neither does Dell and other vendors).
Looking at the documentation, it seems obmcutil would be the right tool for the job, and it gives me some help:
obmcutil -h
But when I run one of the commands, I always get an error.
$ obmcutil osstate
/usr/bin/obmcutil: line 181: mapper: command not found
Are there any other commands I can run via SSH to check the status of power and power on a device when it's powered off?
For background, I'm using my Talos II for release engineering and running Ubuntu 20.04 and other operating systems under KVM (whichever I can get my hands on). I'm using Jenkins to automate tasks through SSH, especially patching and powering off devices. Power is expensive in California, with the most expensive time to run machines being the evening. Running homelab sets me back around $200+ extra a month. That's a lot of wasted beers -- or 4+ trips to the Zoo with my daughter. So I turn servers off when not in use. My Talos II consumes 85W+, so it doesn't run cheap. I need to figure out ways to power the host on when Jenkins needs it, such as building stuff for POWER and then gracefully power it down when not in use. I can shut down the operating systems via Jenkins but have no way to turn it back on.
I'm exploring how to automatically build and test BMC, which would involve Jenkins uploading and updating it. Since Jenkins (and other CI/CD tools I'm playing with) natively support SSH, I think it may be worthwhile to explore what else I can do when I SSH into the BMC.