Testing Hardware Discovery with Sushy BMC Emulator
Sushy (sushy-tools) is an OpenStack Redfish emulator backed by libvirt.
It lets you test NICo’s site explorer hardware discovery without physical
BMC hardware. The site explorer connects to Sushy via standard Redfish,
detects the Sushy hardware type, and produces an exploration report for
the managed VM.
Sushy also supports Redfish power control and boot-source override, translating them into libvirt domain operations. This means NICo can power on/off VMs and set PXE boot via Redfish — the full provisioning flow works if DHCP/PXE network connectivity is available.
Prerequisites
- libvirt with QEMU/KVM
- Podman (to run the Sushy container)
- An OpenShift cluster (CRC works) with NICo deployed
Sushy Emulator Setup
Create a libvirt VM
Create a VM with a fixed UUID and MAC address. Sushy uses the VM UUID as the Redfish System ID.
Networking: The
defaultlibvirt network is sufficient for discovery. For full PXE provisioning, the VM must reach NICo’s DHCP/PXE services — configure a bridged network with DHCP relay or place the VM on the same L2 segment as the NICo DHCP server.
Configure Sushy
Create /etc/sushy-emulator/sushy-emulator.conf. This configuration
runs the emulator without authentication (SUSHY_EMULATOR_AUTH_FILE
is not set). The BMC credentials stored in Vault are accepted by the
Sushy vendor stub but are not actually verified by the emulator:
Generate a self-signed certificate with the host IP as a SAN:
Note: This development flow skips certificate verification. NICo’s Redfish clients currently accept invalid certificates, and the
curlexamples below use-k. The self-signed certificate provides transport encryption but is not verified by either party.
Patch the ServiceRoot template
The nv-redfish library requires a Links object in the Redfish
ServiceRoot. The default Sushy template does not include it. Create
/etc/sushy-emulator/root.json.
This file is a Jinja2 template — the {% if %} directives are
rendered by Sushy at request time:
Run Sushy as a systemd service
Create /etc/systemd/system/sushy-emulator.service.
Note:
--privilegedand host networking are required because Sushy needs access to the libvirt socket. Run this only on a development workstation, not on shared or production hosts.
The root.json bind-mount path depends on the Python version inside the
container image. Verify with podman run --rm <image> python3 --version
and adjust if needed.
Verify
You should see your VM listed as a Redfish System.
To verify from inside an OpenShift pod:
NICo Site Explorer Configuration
Add the following to the site explorer config in nicoApiSiteConfig:
bmc_proxy: The host IP and port that OpenShift pods can reach (notlocalhost). On CRC, the host’s LAN IP works.dpu_policy = "ignore": Sushy VMs have no DPUs.
Register the Expected Machine
Register the VM as an expected machine. The MAC address must match the
VM’s NIC, and bmc_ip_address provides the static BMC IP for the
site explorer to use with bmc_proxy.
Note: The credentials below are test-only placeholders for a local emulator. Do not reuse them in shared environments. Prefer injecting credentials via Vault rather than passing them on the command line, which exposes them in shell history and process listings.
The site explorer also needs:
- A network segment of type
underlaywith a prefix covering thebmc_ip_addressrange. - DHCP timestamps on the preallocated machine interfaces (set
last_dhcpin themachine_interfacestable, or call theDiscoverDhcpgRPC method).
Vault Credentials
Use vault kv put with @file syntax to store JSON objects (not strings).
Note: Replace the placeholder credentials below with values appropriate for your test environment.
The site explorer checks these three credentials at startup
(REQUIRED_SITE_DEFAULT_CREDENTIAL_KEYS) and fails if any are missing:
These are consumed later by BMC metadata workflows (credential rotation, factory-default lookups) and are not required for startup:
A Vault Kubernetes auth role for nico-api is also required:
What to Expect
Once everything is configured, the site explorer logs should show:
The exploration report contains:
EndpointType: BmcMachineSetupStatus.IsDone: true(Sushy has no real BIOS to configure)- One system and one chassis
Limitations
- PXE provisioning requires DHCP relay: Sushy supports Redfish power control and boot-source override (translated to libvirt operations), so NICo can set PXE boot and power on VMs. However, the VMs must be able to reach NICo’s DHCP/PXE services over the network for the full provisioning flow to work.
- No DPU support: Sushy VMs have no DPUs. Use
dpu_policy = "ignore". - No BIOS/lockdown: All BIOS setup and lockdown checks are stubbed as no-ops for the Sushy hardware type.
- No AccountService: Sushy does not implement the Redfish
AccountServiceendpoint. All credential operations (create user, change password) are accepted silently by the vendor implementation. - Single VM per Sushy instance: NICo’s site explorer selects one
system per exploration (multi-system Redfish endpoints are not
supported). Since Sushy exposes all libvirt domains through one
/Systemscollection, multiple expected machines routed throughbmc_proxyto the same Sushy endpoint will all discover the same system. To test multiple VMs, run one Sushy instance per VM on different ports.