Skip to contentSkip to conversation

Total server power consumpion

DISCUSSION Alexander Soldatov 2 participants 2 messages Oct 18, 2018 – Oct 19, 2018

lore
Share & tools
lore
#0 lore raw

  Hi all,
We have faced with the problem of showing total server power consumption in the webui. Total power consumption is calculated as sum of the PSUs input powers. Input power values are read from PSU using PMBus protocol and are published in the Linux sysfs. We are using our proprietary PSU driver. So I have an idea. Driver should create virtual hwmon device with total power parameters. We could use standart phopshor-hwmon to publish total power in DBus.
  But the phosphor-hwmon requires the physical device path (calloutPath). This parameter is transmitted using %p option of the udev. There is no path for the virtual device. The phosphor-hwmon does not get calloutPath and exits with error.
  There are some questions:
  1. How is this problem solved in other projects (the Witherspoon etc.)?
  2. The Witherspoon server has 2,2 kW PSUs. The maximum value of power in linux sysfs on the 32 bit system is 2147483647 µW. How the correct power view is solved?
  3. How does the phosphor-hwmon use calloutPath besides logs info output?
  4. Does it make sense to give the phosphor-hwmon an ability to work with virtual devices?
Regards,
   Alexander Soldatov.

#1 lore raw
Quoted 2 lines · Alexander Soldatov

We have faced with the problem of showing total server power consumption in the webui. Total power consumption is calculated as sum of the PSUs input powers. Input power values are read from PSU using PMBus protocol and are published in the Linux sysfs. We are using our proprietary PSU driver. So I have an idea. Driver should create virtual hwmon device with total power parameters. We could use standart phopshor-hwmon to publish total power in DBus. But the phosphor-hwmon requires the physical device path (calloutPath). This parameter is transmitted using %p option of the udev. There is no path for the virtual device. The phosphor-hwmon does not get calloutPath and exits with error.

phosphor-hwmon has two arguments, -o (dev-path) or -p (path). You could use -p to specify the hwmon path directly.

Quoted 2 lines

There are some questions:
1. How is this problem solved in other projects (the Witherspoon etc.)?

Witherspoon's total power is reported by occ, which is handled by occ-hwmon driver.

Quoted 1 line

2. The Witherspoon server has 2,2 kW PSUs. The maximum value of power in linux sysfs on the 32 bit system is 2147483647 µW. How the correct power view is solved?

The code use unit64_t for Value property, so it is ok.

Quoted 2 lines

3. How does the phosphor-hwmon use calloutPath besides logs info output?
4. Does it make sense to give the phosphor-hwmon an ability to work with virtual devices?

It could work with -p argument.