-
Notifications
You must be signed in to change notification settings - Fork 7
Adding Support for JAWS PDU devices #45
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
base: main
Are you sure you want to change the base?
Conversation
|
Testing: PDU in SMD: Power status: Power off: Confirmed: Just need those commits signed. |
3745e96 to
6384bfd
Compare
Signed-off-by: Michael Buchmann <[email protected]>
Signed-off-by: Michael Buchmann <[email protected]>
6384bfd to
21eda97
Compare
alexlovelltroy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Two minor issues:
-
I don't understand the need for the GODEBUG environment variable and am suspicious that we don't actually want it in the production container.
-
The JAWS implementation appears to be fairly well compartmentalized. Can we move it to
pkgso other tools can use it?
alexlovelltroy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rainest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably separate concerns more, but if nothing else we should make sure we're handling all errors, and aborting on them immediately if we cannot expect to successfully proceed.
Signed-off-by: Michael Buchmann <[email protected]>
rainest
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I missed the TLS stuff previously. Do these devices usually have decent enough cert management that we can default to secure and provide a flag to skip JAWS TLS verification? Can we also limit the additional ciphers to them?
internal/domain/jaws.go
Outdated
| func JawsLoad(xname string, FQDN string, authUser string, authPass string) { | ||
| timeout := 20 | ||
| transport := &http.Transport{ | ||
| TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this earlier, hard coding this off seems iffy. What's the typical certificate management of these devices like? I'm not surprised if it's not great and winds up using self-signed certs often, but we should at add comments here indicating why this is off if so.
Ideally we actually default it on and make insecure an explicit opt-in.
We can also set
CipherSuites: []uint16{...}
here rather than setting tlsrakex=1, correct? Ideally we don't enable those across the board.
Unfortunately Golang's helper list functions return cipher suite structs while configuration wants their int representation, so we'd need our own helper to generate the longer list:
func jawsSuites() []uint16 {
suites := []uint16{tls.TLS_RSA_WITH_AES_128_GCM_SHA256, tls.TLS_RSA_WITH_AES_256_GCM_SHA384, tls.TLS_RSA_WITH_AES_128_CBC_SHA, tls.TLS_RSA_WITH_AES_256_CBC_SHA}
for _, c := range tls.CipherSuites() {
suites = append(suites, c.ID)
}
return suites
}
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)
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).