AMD DASH support and Powerhookd Release

Hi MAAS community! Finally I added AMD DASH support via webhook, and developed a little daemon for it, I copy the readme. Project is hosted here.

Powerhookd

A small Rust server with the following features:

  • Openapi and swagger ui.
  • Integrates with MAAS via WebHook power interface.
  • Implements AMD Dash management interface.
  • TLS support
  • Simple Token authentication with CLI to issue tokens.
  • Modular for adding any other power interfaces.

Installation instructions

The packages are currently generated for Ubuntu jammy via Launchpad and can be installed:

sudo add-apt-repository ppa:valletech/powerhookd
sudo apt update
sudo apt install powerhookd

Configuration

Powerhookd configuration lives in /etc/powerhookd. The file powerhookd.yaml includes instructions.

You can configure the listening IP and port, TLS parameters and token security secret.

API tokens are issued using the Command Line Interface. Call powerhookd --help for details, be aware that by default, it will look
for the configuration file in current directory.

Installed package will integrate with Systemd and Journald.

AMD Dash Power Driver

The DASH implementation has been developed using the DASH Client in -jdo mode,
where json objects are streamed via standard input and obtained via standard output.

Nomenclature and match the DASH CLI Developer Guide as much as possible.

It is required to have the Dash Client installed, which can be downloaded from AMD Manageability Software.

The reference equipment used for implementation is ASRock industrial 4x4.

MAAS Configuration

Before configuring MAAS, it is recommended to test the endpoints in the swager-ui OpenAPI Console, observing logs with journalctl -f -u powerhookd.service.

Endpoint configuration will then be:

https://powerhookd_ip:8099/power_on/host_ip
https://powerhookd_ip:8099/power_off/host_ip
https://powerhookd_ip:8099/power_status/host_ip

And other settings:

  • Default Regular expressions
  • Power Token as generated from CLI, description string will be displayed in logs.
  • SSL Validation disabled if running with self signed cert generated at install

OpenAPI console and integration

Swagger UI is deployed at https://localhost:8099/swagger-ui
Use this UI to test the endpoints.
It is also possible to generate the openapi.json using the cli interface powerhookd --spec. You can use this spec to generate
a client library in your favorite language, see opean api generator for details.

Roadmap

The following features are being considered to be implemented in the future:

  • Delivery of packages for other Ubuntu distributions and snap.
  • Generic MQTT Power Driver.
  • POE Driver for ARM targets using Mikrotik REST API.

Other potential features of interest:

  • MAAS System ID mapping.
  • DASH System discovery.
  • DASH IP-Range or Subnet inventory entry.

Contributing and Source Code

The project sources and CD/CI pipelines are hosted in gitlab.com.

Related Projects

This module is part of a broader initiative for Decentralized Infrastructure / Edge Industrial computing clusters.

License and Copyright

Powerhookd is Open Source, Apache License Version 2.0.

©2024 Valletech AB, Authors and Contributors.

During the implementation I realized that it would be nice to have the (PXE) mac address of the host in the webhook request, and not only the systemID. That would allow for DASH discovery to automatically map the interfaces to individual systems.