Skip to content

Added JAWS PDU Support#34

Closed
mbuchmann-hpe wants to merge 2 commits intoOpenCHAMI:mainfrom
mbuchmann-hpe:JAWSSupport
Closed

Added JAWS PDU Support#34
mbuchmann-hpe wants to merge 2 commits intoOpenCHAMI:mainfrom
mbuchmann-hpe:JAWSSupport

Conversation

@mbuchmann-hpe
Copy link

@mbuchmann-hpe mbuchmann-hpe commented Jul 2, 2025

Summary and Scope

Adds JAWS PDU Support:
ServerTech PDUs do not use Redfish, but instead uses the JSON API Web Service (JAWS).
Instead of creating an interface which converts Redfish calls to JAWS, it was decided to add support for PCS to call JAWS directly.
Added the file jaws.go which takes care of the JAWS calls and monitoring of the PDU.
The URIs must be setup correctly in SMD (HSM) to detect these PDUs and make the correct calls.

Testing

Tested locally using the SMD setup on Tamarindo and the PDU from another local system. Able to detect PDUs, query and store power status and power on/off outlets.

Test Procedure

Using a ServerTech PDU, add the PDU to SMD/HSM. PCS should automatically discover the PDU and start to monitor it for power status.

Test using the following curl (these assume PCS is running on localhost:28007 and the PDU is x3000m0)

  1. Check all power status: curl http://localhost:28007/v1/power-status | jq
  2. Check power status of an outlet (outlet 17): curl http://localhost:28007/v1/power-status?xname="x3000m0p0v17" | jq
  3. Turn an outlet off (outlet 17): curl http://localhost:28007/v1/transitions -d '{"location":[{"xname":"x3000m0p0v17"}],"operation":"off"}'
  4. Check the transaction (use transaction id from power off): curl http://localhost:28007/v1/transitions/6d9ba49b-ba21-4ec6-b2ab-440d12693230 | jq
  5. Review power status
  6. Turn outlet back on: curl http://localhost:28007/v1/transitions -d '{"location":[{"xname":"x3000m0p0v17"}],"operation":"on"}'

Risks and Mitigations

Changes where carefully done to leave all current functionality in tact.
Environment variables must be set to enable the PDU monitoring (see Dockerfile).

@bmcdonald3
Copy link
Member

Could you list the commands that you used to test this so that I can attempt to replicate? It would help a lot if I knew what the intended way to use this was.

This is the standard process we are trying to move towards that was outlined in OpenCHAMI/roadmap#95. Thanks, sorry to be a stickler here...

@bmcdonald3
Copy link
Member

Taking this to Tamarindo, I am seeing:

# docker logs pcs
/bin/sh: /usr/local/bin/power-control: not found

Did you run this on Tamarindo?

@bmcdonald3
Copy link
Member

On second thought, I don't think this is specific to this PR, I think something might have gotten jumbled in the interim. Let me look into it more...

@bmcdonald3
Copy link
Member

How did you get this to query the PDUS from a remote machine? I finally fixed the build issue and am now seeing:

# docker logs pcs
2025/07/09 21:53:07 [DEBUG] GET http://localhost:27779/hsm/v2/Inventory/ComponentEndpoints?id=x3000m0p0v28&id=x3000m0p1v6&id=x3000m0p1v20&id=x3000m0p1v14&id=x3000m0p0v11&id=x3000m0p0v18&id=x3000m0p1v34&id=x3000m0p0v7&id=x3000m0p0v9&id=x3000m0p0v34&id=x3000m0p1v4&id=x3000m0p1v7&id=x3000m0p1v11&id=x3000m0p1v26&id=x3000m0p1v29&id=x3000m0p1v22&id=x3000m0p1v32&id=x3000m0p1v35&id=x3000m0p0v10&id=x3000m0p1v17&id=x3000m0p1v19&id=x3000m0p1v24&id=x3000m0p1v28&id=x3000m0p1v31&id=x3000m0p1v23&id=x3000m0p0v3&id=x3000m0p0v13&id=x3000m0p0v16&id=x3000m0p0v25&id=x3000m0p0v26&id=x3000m0p1v9&id=x3000m0p0v4&id=x3000m0p1v1&id=x3000m0p1v16&id=x3000m0p1v27&id=x3000m0p1v10&id=x3000m0p0v2&id=x3000m0p0v8&id=x3000m0p0v15&id=x3000m0p0v23&id=x3000m0p0v31&id=x3000m0p1v2&id=x3000m0p1v3&id=x3000m0p1v13&id=x3000m0p0v6&id=x3000m0p0v20&id=x3000m0p0v30&id=x3000m0p0v33&id=x3000m0p0v36&id=x3000m0p1v36&id=x3000m0p0v14&id=x3000m0p0v22&id=x3000m0p0v35&id=x3000m0p1v18&id=x3000m0p1v21&id=x3000m0p1v33&id=x3000m0&id=x3000m0p0v5&id=x3000m0p0v17&id=x3000m0p0v24&id=x3000m0p0v29&id=x3000m0p0v19&id=x3000m0p0v27&id=x3000m0p1v5&id=x3000m0p1v8&id=x3000m0p1v15&id=x3000m0p0v21&id=x3000m0p0v32&id=x3000m0p1v30&id=x3000m0p0v1&id=x3000m0p0v12&id=x3000m0p1v25&id=x3000m0p1v12
time="2025-07-09T21:53:07Z" level=info msg="JAWS Load: x3000m0" func=github.com/OpenCHAMI/power-control/v2/internal/domain.JawsMonitor file="/workspace/internal/domain/jaws.go:158"
2025/07/09 21:53:07 [DEBUG] GET https://x3000m0/jaws/monitor/outlets
2025/07/09 21:53:07 [ERR] GET https://x3000m0/jaws/monitor/outlets request failed: Get "https://x3000m0/jaws/monitor/outlets": dial tcp: lookup x3000m0 on 127.0.0.1:53: no such host

Which makes sense, given x3000m0 is on Gamora. I think you mentioned something about tunneling and changing the Docker environment or something?

@bmcdonald3
Copy link
Member

Looks like you need to add Signed-off-by: Michael Buchmann <michael.buchmann@hpe.com> to your commit message to get that to pass DCO

Signed-off-by: Michael Buchmann <michael.buchmann@hpe.com>
@alexlovelltroy
Copy link
Member

@mbuchmann-hpe and @bmcdonald3 What's the status of this one?

@bmcdonald3
Copy link
Member

Just getting back from vacation, but I think Mike decided he was going to close this one in favor of #45. I don't think we want this one open anymore, but I'm unable to close PRs here. @mbuchmann-hpe is that correct? Could you close this PR if so?

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.

3 participants