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).
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
- 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
- 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
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...
- 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
#Configure the build
meson setup build
#Compile
ninja -C build
#Install
sudo ninja -C build installConfigure build options using -D<option>=<value>:
| 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=trueThe 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.serviceQuery 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 ModelThe project includes a standalone firmware update utility (NVMeFwUpdate)
for updating NVMe drive firmware over NVMe-MI/MCTP.
- 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
- Download: Transfers firmware file to drive(s) in 4KB chunks
- Commit: Activates the new firmware on the drive
- Verification: Reports success or failure for each device
#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| 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 |
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
0: All firmware updates completed successfully1: One or more firmware updates failed or invalid arguments
- 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
- NVMeDevice: Main class managing individual NVMe drive
- NVMeMi: NVMe-MI protocol interface wrapper
- MCTPDiscovery: MCTP endpoint discovery and monitoring
- SoftwareInventoryManager: Firmware version tracking (optional)
- Daemon discovers MCTP endpoints with NVMe-MI capability
- Creates NVMeDevice instances for each discovered drive
- Polls drives periodically for status and health
- Exposes drive information via D-Bus interfaces
- Listens for MCTP endpoint addition/removal events
- Boost.Asio io_context for async operations
- Timer-based polling for drive health
- Event-driven MCTP endpoint monitoring
The service automatically discovers NVMe drives through MCTP. Configuration is primarily done through:
- Build-time options (see Build Options section)
- Entity Manager configuration for drive topology and associations
- MCTP daemon for endpoint discovery
The daemon automatically saves drive state information to a JSON file when drives are discovered. The state file includes:
- EID: MCTP Endpoint ID
- Location Code: Physical location from EntityManager (e.g., "NVMe E1.S Slot 0")
- Serial Number: Drive serial number
- Connectivity: MCTP connectivity status ("Available", "Degraded", or "Unknown") - only with in-kernel MCTP
Default location: /var/lib/nvidia-nvme-manager/nvme_drive_state.json
Configuration: The file path can be customized at build time using the
drive_state_file option:
meson setup build -Ddrive_state_file=/custom/path/drive_state.jsonExample state file:
[
{
"eid": 200,
"locationCode": "NVMe E1.S Slot 0",
"serialNumber": "S6RMNG0X502723",
"connectivity": "Available"
},
{
"eid": 201,
"locationCode": "NVMe E1.S Slot 1",
"serialNumber": "S6RMNG0X502724",
"connectivity": "Available"
}
]The state file is automatically updated when:
- New drives are discovered
- Drive information changes
- Service restarts
Required D-Bus Interfaces:
xyz.openbmc_project.EntityManager- For location codexyz.openbmc_project.NVMeDevice- For drive asset information
- C++23 standard
- Follow OpenBMC coding guidelines
- Use clang-tidy for linting (see
run-clang-tidy.sh)
.
├── include/ # Header files
│ ├── NVMeDevice.hpp
│ ├── NVMeMi.hpp
│ └── ...
├── src/ # Source files
│ ├── NVMeDevice.cpp
│ ├── NVMeDeviceMain.cpp
│ └── NVMeMi.cpp
├── tool/ # Utility tools
│ └── NVMeFwUpdate.cpp
├── service_files/ # Systemd service files
└── docs/ # Documentation
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA CORPORATION is strictly prohibited.
This is a proprietary NVIDIA project. For issues or contributions, please contact NVIDIA.