On Mon, Mar 26, 2018 at 5:00 AM Ratan Gupta <ratagupt@linux.vnet.ibm.com> wrote:
Hi,

I would be explaining a rough idea of how we plan to go about,
This is related to https://github.com/openbmc/openbmc/issues/2979

Please share your thoughts and feedback on this proposal.

=>we were planning to add the property in the chassis interface
   which tells that since how many hours chassis was powered on.

=>This property gets updated by internal timer which wakes up after
   an hour and updates this property if chassis is powered on.

    1) Should we set the uptime to 0 if chassis state has been
transitioned from
    PowerOn-->PowerOff

                              or

    2) Don't update this property for the chassis power off duration and
update
    this property when the chassis state changes to PowerOn.

    What is community view on this?

IMO, it depends on whether clients might be using this uptime to determine whether the host is on now; or maybe whether they might need to capture the latest uptime during some crash log that begins after the host goes down.  My gut feeling is that it's correct to set it to zero when it powers off, and start incrementing it again starting when it powers on.  But I also suppose it's not feasible to use uptime to determine current host state, if the value is stored in hours, since it would be almost one full hour before the value could report the host as "on"....

Is there a use case where someone might want to read the previous uptime, while the host is still down?
 

    Our opinion is that we should go with option 2 as other
implementation(AMI)
    does the same.

=> In factory reset case this property will reset to 0.

=>If BMC has been rebooted due to any reason,This property will not
   get updated for that duration and when BMC comes back,This timer
   kicks off and updates this property and it would be cumulative
   on what was the earlier value before BMC reboot.

=> Chassis object would be saved in nonvolatile storage to keep the last
POH counter value.

Would it make sense to store also the real time when it was last updated, so in case of BMC reboot like above, we could update the value to our best guess (assuming the host did not also restart while BMC was offline)?
 

=> Get functionality would be allowed,set would not be allowed from IPMI
interface.
 

Regards
Ratan Gupta