questions about host-state-manager on x86 platform

Andrew Geissler geissonator at gmail.com
Fri Mar 29 01:49:48 AEDT 2019


On Thu, Mar 28, 2019 at 8:02 AM John Wang <wangzqbj at inspur.com> wrote:
>
> I found that on my machine (x86), phosphor-state-manager(host) doesn't work as expected.
> I have a problem when debugging. I hope someone can help me.
>
> When `obmcutil poweroff` is executed, it calls `obmc-host-shutdown at 0.target`
> and  will change the CurrentHostState by judging whether obmc-host-stop at 0.target is executed or not.

obmc-host-shutdown.target will call
xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service
This service calls phosphor-softpoweroff
(https://github.com/openbmc/phosphor-host-ipmid/tree/master/softoff)
This sends a message to the host, asking it to power down.
If the host does not ack the message within 30 seconds, then the
obmc-host-stop at 0.target will be started.
If the host acks the message, then they get 45 minutes to power down.

The good path is that the host will quiesce itself and send an inband
IPMI message to
ipmid indicating it can continue with the power down. ipmid will tell
the phosphor-softpoweroff
that it can exit, which will start the obmc-host-stop at 0.target

You should be able to verify the target dependencies in your
filesystem by looking at this:
ls -1 /lib/systemd/system/obmc-host-shutdown\@0.target.requires/
obmc-chassis-poweroff at 0.target
xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service

The obmc-chassis-poweroff at 0.target then requires the obmc-host-stop at 0.target
and some other services.
ls -1 /lib/systemd/system/obmc-chassis-poweroff\@0.target.requires/
obmc-host-stop at 0.target
op-power-stop at 0.service
op-powered-off at 0.service
op-wait-power-off at 0.service


> However,On my machine, obmc-host-stop at 0.target has never been executed.
>
> $systemctl status obmc-host-shutdown at 0.target
> obmc-host-shutdown at 0.target - Power0 Host Off
>    Loaded: loaded (/lib/systemd/system/obmc-host-shutdown at .target; static; vendor preset: enabled)
>    Active: active
>
> on5263m5 systemd[1]: Reached target Power0 Host Off.
>
> $systemctl status obmc-host-stop at 0.target
> Obmc-host-stop at 0.target - Stop Host0
>    Loaded: loaded (/lib/systemd/system/obmc-host-stop at .target; static; vendor preset: enabled)
>    Active: inactive (dead)
>
> There is such a comment in the code
>
> host-shutdown notifies host of shutdown and that leads to host-stop being
> called so initiate a host shutdown with the -shutdown target and consider the
> host shut down when the -stop target is complete
>
> But I have not figured out how -stop target is called.

My guess is either some targets/services are missing in your filesystem or
the host ack'd the power down command but did not send the power down
when it was done. You could verify this second part by waiting 45 minutes
to see if your system eventually powers down.

>
> In addition, if the shutdown is performed on the host operating system,
> is it impossible for host-state-manager to know that it is currently shut down?
> In this case, how is openbmc handled? Which module should I refer to?

The host sends down a command inband to indicate it's done with
the shutdown, which causes the BMC to continue with the shutdown.

>
> Thanks
>
> John


More information about the openbmc mailing list