NVIDIA/nvidia-nvme-manager
C++
Captured source
source ↗NVIDIA/nvidia-nvme-manager
Description: Manage NVME drives via MCTP
Language: C++
License: Apache-2.0
Stars: 14
Forks: 4
Open issues: 0
Created: 2024-07-23T19:40:13Z
Pushed: 2026-06-13T15:49:55Z
Default branch: develop
Fork: no
Archived: no
README:
NVMe Device Manager for OpenBMC
A D-Bus based NVMe device management daemon for OpenBMC systems. This service discovers, monitors, and manages NVMe drives through the NVMe Management Interface (NVMe-MI) over MCTP (Management Component Transport Protocol).
Overview
This daemon provides comprehensive NVMe drive management capabilities including:
- Automatic Discovery: Discovers NVMe drives via MCTP endpoints
- Health Monitoring: Monitors drive health through SMART attributes and
status polling
- Drive Information: Exposes detailed drive information (model, serial,
firmware version, capacity, etc.)
- Secure Erase: Supports various sanitization methods (block erase,
overwrite, crypto erase)
- Firmware Inventory: Optional firmware version tracking and inventory management
- D-Bus Integration: Full integration with OpenBMC D-Bus infrastructure
Features
Drive Management
- NVMe-MI protocol support via libnvme-mi
- Real-time drive status and health monitoring
- SMART warning detection and Redfish event generation
- Drive association with system topology
- Drive State Persistence: Automatically saves drive state (EID, location
code, serial number) to JSON file
Supported Operations
- Identify drive (model, serial number, manufacturer, capacity)
- Query drive health and operational status
- Secure erase with progress tracking
- Link status detection
- Form factor detection
- Drive state tracking and persistence
D-Bus Interfaces
Exposes the following OpenBMC D-Bus interfaces:
xyz.openbmc_project.Inventory.Itemxyz.openbmc_project.Inventory.Item.StorageControllerxyz.openbmc_project.Inventory.Item.Drivexyz.openbmc_project.State.Decorator.Healthxyz.openbmc_project.State.Decorator.OperationalStatusxyz.openbmc_project.Nvme.Statusxyz.openbmc_project.Nvme.SecureErasexyz.openbmc_project.Nvme.Operation- And more...
Building
Prerequisites
- C++23 compatible compiler (GCC 12+ or Clang 15+)
- Meson build system (>= 1.1.1)
- libnvme and libnvme-mi libraries
- sdbusplus (OpenBMC D-Bus library)
- phosphor-logging
- Boost.Asio
- nlohmann-json
- systemd
Build Instructions
#Configure the build meson setup build #Compile ninja -C build #Install sudo ninja -C build install
Build Options
Configure build options using -D=:
| Option | Type | Default | Description | | ------------------------- | ------- | ------------------ | ----------- | | platform_drive_location | string | .../Baseboard_0 | Location | | platform_drive_prefix | string | NVMe_SSD_ | Drive name | | drive_sanitize_time | integer | 30 | Sanitize | | identify_rsp_length | integer | 384 | Identify | | inkernel_mctp | boolean | false | In-kernel | | firmware_inventory | boolean | false | FW inv | | drive_state_file | string | /var/lib/nvidia- | State file | | | | nvme-manager/... | |
Example:
meson setup build -Dinkernel_mctp=true -Dfirmware_inventory=true
Usage
Service Management
The daemon is managed through systemd:
#Start the service sudo systemctl start nvidia-nvme-manager.service #Enable on boot sudo systemctl enable nvidia-nvme-manager.service #Check status sudo systemctl status nvidia-nvme-manager.service
D-Bus Interface
Query NVMe drives via D-Bus:
#List all NVMe drives busctl tree xyz.openbmc_project.NVMeDevice #Get drive properties busctl introspect xyz.openbmc_project.NVMeDevice \ /xyz/openbmc_project/inventory/system/nvme/NVMe_SSD_0 #Read specific property(e.g., model) busctl get-property xyz.openbmc_project.NVMeDevice \ /xyz/openbmc_project/inventory/system/nvme/NVMe_SSD_0 \ xyz.openbmc_project.Inventory.Decorator.Asset Model
Firmware Update Tool
The project includes a standalone firmware update utility (NVMeFwUpdate) for updating NVMe drive firmware over NVMe-MI/MCTP.
Tool Features
- Parallel Updates: Update multiple NVMe drives simultaneously
- Chunked Transfer: Downloads firmware in 4KB chunks for reliability
- Retry Logic: Automatic retry for transient failures
- Event Logging: Generates Redfish-style events for update progress
- D-Bus Integration: Logs update events to OpenBMC logging infrastructure
Firmware Update Process
1. Download: Transfers firmware file to drive(s) in 4KB chunks 2. Commit: Activates the new firmware on the drive 3. Verification: Reports success or failure for each device
Tool Usage
#Update single drive NVMeFwUpdate /path/to/firmware.bin GB232 \ /xyz/openbmc_project/inventory/system/chassis/motherboard/drive 200 #Update multiple drives in parallel NVMeFwUpdate /path/to/firmware.bin GB232 \ /xyz/openbmc_project/inventory/system/chassis/motherboard/drive 200 201 202 #Enable verbose logging NVMeFwUpdate /path/to/firmware.bin GB232 \ /xyz/openbmc_project/inventory/system/chassis/motherboard/drive 200 201 -v
Command Arguments
| Argument | Description | | -------------------- | --------------------------------------- | | firmware_path | Path to the firmware binary file | | version | Version string identifier (e.g., GB232) | | object_path_prefix | D-Bus inventory object path prefix | | eid1 [eid2] ... | One or more MCTP Endpoint IDs to update | | -v, --verbose | Enable detailed logging output |
Event Logging
The tool generates D-Bus events at each stage:
- Target Determined: Firmware update target identified
- Transferring to Component: Download started
- Transfer Failed: Download encountered an error
- Await to Activate: Download complete, ready for activation
- Update Successful: Firmware committed successfully
- Apply Failed: Firmware commit failed
- Activate Failed: Firmware activation failed
Exit Codes
0: All firmware updates completed successfully1: One or more firmware updates failed or invalid arguments
Notes
- Requires MCTP endpoints to be configured and accessible
- Supports in-kernel MCTP when built with
-Dinkernel_mctp=true - Firmware file must be compatible with target NVMe devices
- Updates run in parallel threads for efficiency
Architecture
Components
- NVMeDevice: Main...
Excerpt shown — open the source for the full document.
Notability
notability 3.0/10Routine infrastructure tool, low traction.