Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PDU support #27

Merged
merged 6 commits into from
Jul 15, 2024
Merged

Adding PDU support #27

merged 6 commits into from
Jul 15, 2024

Conversation

ErwanAliasr1
Copy link
Collaborator

This pull request is about adding the PDU support to hwbench & hwgraph.

This first version supports Raritan PDUs but can be extended to other brands.

@ErwanAliasr1 ErwanAliasr1 force-pushed the pdu branch 5 times, most recently from 175fbca to ab30e99 Compare July 10, 2024 14:45
@ErwanAliasr1 ErwanAliasr1 requested review from anisse and beorn- July 10, 2024 15:13
documentation/monitoring.md Outdated Show resolved Hide resolved
documentation/monitoring.md Outdated Show resolved Hide resolved
Custom vendors inherit from Vendor class.
If the default init is override, it must call the parent class init to
ensure all vendors behave the same.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
The monitoring config file is fully dedicated to the BMC.

This commit is about adding a "type" to each section to let room for
future monitoring components like PDU, CDU etc..

This commit is adding "type=BMC" for the current BMC examples.
The BMC code is also moved out of vendor.py to make it easier to read.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
Future work to add different type of monitoring devices like PDUs, CDUs,
etc.. requires a generic class to share some behavior.

This commit is moving parts of the BMC class into the generic
MonitoringDevice one.

It also creates a new find_sections() function to make the lookup of
given type of MonitoringDevice inside the configuration file.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
The current code is using get_ip() to retrieve BMC IP.
It uses ipmitool or ilorest to detect the BMC ip address.

This is a limitation since we possibly want to force the url instead of
an autodetect.

This commit is :
- renaming get_ip() to get_url()
  All drivers must return the BMC url and not its IP address

- ensure that BMC.get_url() returns an https:// string instead of an IP
  addr
- removes the "https://" append in connect_redfish()
  A test is now implemented to ensure drivers properly return a valid
  get_url()

- allow url to be defined in the monitoring.cfg file
  This gives more flexibility for future usage.

- add a mocked monitoring.cfg file
  A very simple configuration file is added to get the minimal BMC
  structure.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
This commit is about graphing PDU metrics.

The commit is very light since it only requires adding PDU as a new
source of power metrics and plot some specific graphs.

The code is very light at PDUs are just an additional source of data in
the existing data set.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
This commit add PDU as a type of monitoring device.

A monitoring.md documentation is added to detail how the monitoring
works and the way to use it.

PDU monitoring is optional and needs to be defined inside the monitoring
config file. It is possible to setup multiple PDUs configuration in the
same file.

This version implements a first driver for Raritan PDUs with Redfish
API.

At statup time the output looks like the following:

	Monitoring/PDU: initialize myPDUgroup with Raritan driver @ https://1url.pl/ Model: 'PX3-5722V-V2' FW: '4.2.0.5-50274' Serial: 'XXXXXXXXX'
	Monitoring/PDU: initialize myPDUdirect with Raritan driver @ https://url.pdu/ Model: 'PX3-5722V-V2' FW: '4.2.0.5-50274' Serial: 'XXXXXXXXX'
	Monitoring/BMC: Thermal metrics:1xCPU, 1xIntake
	Monitoring/BMC: Fans metrics:10xFan
	Monitoring/BMC: PowerConsumption metrics:65xCPU, 4xBMC
	Monitoring/BMC: PowerSupplies metrics:2xBMC
	Monitoring/PDU: PowerConsumption metrics:65xCPU, 4xBMC, 2xPDU

On the implementation side, the vendor drivers, like Raritan here, are
inheriting the PDU class and only override methods if necessary.

Signed-off-by: Erwan Velu <e.velu@criteo.com>
Copy link
Contributor

@anisse anisse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ErwanAliasr1 ErwanAliasr1 removed the request for review from beorn- July 15, 2024 16:22
@ErwanAliasr1 ErwanAliasr1 merged commit 1669f9f into main Jul 15, 2024
4 checks passed
@ErwanAliasr1 ErwanAliasr1 deleted the pdu branch July 15, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants