#!/bin/sh # Run on pxe-server as root from the directory containing these files. # Expects /etc/pve-vbmc/config.json to exist already (see config.example.json). set -eu cd "$(dirname "$0")" getent passwd pve-vbmc >/dev/null || useradd --system --no-create-home --shell /usr/sbin/nologin --user-group pve-vbmc install -m 0755 pve_vbmc.py /usr/local/bin/pve_vbmc.py install -m 0755 pve_redfish.py /usr/local/bin/pve_redfish.py install -m 0755 pve-vbmc-addrs.sh /usr/local/bin/pve-vbmc-addrs.sh install -m 0644 pve-vbmc@.service pve-redfish@.service pve-vbmc-addrs.service /etc/systemd/system/ chgrp pve-vbmc /etc/pve-vbmc/config.json && chmod 0640 /etc/pve-vbmc/config.json systemctl daemon-reload systemctl enable --now pve-vbmc-addrs.service # NOTE: on netplan/systemd-networkd hosts a later reconfigure flushes addresses added by the # service (seen in the lab: the BMCs stopped answering). Also list the BMC addresses under the # pxenet interface in /etc/netplan/*.yaml so they survive. for v in $(python3 -c 'import json;print(" ".join(str(b["vmid"]) for b in json.load(open("/etc/pve-vbmc/config.json"))["bmcs"]))'); do systemctl enable --now "pve-vbmc@$v.service" done # BMC entries with "redfish": "idrac" | "ilo" | "generic" also get a Redfish service on port 443 for v in $(python3 -c 'import json;print(" ".join(str(b["vmid"]) for b in json.load(open("/etc/pve-vbmc/config.json"))["bmcs"] if b.get("redfish")))'); do systemctl enable --now "pve-redfish@$v.service" systemctl restart "pve-redfish@$v.service" done systemctl --no-pager --type=service | grep -E "pve-vbmc|pve-redfish"