-
Notifications
You must be signed in to change notification settings - Fork 748
Get lifetime info for NVMe devices #6056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| """Get mount source device name. | ||
| Must be run in executor. | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In DataDisk disk_used we get the block device through D-Bus from OS Agent CurrentDevice property. I wonder if we should migrate to that as information source maybe? 🤔
I understand this code came from the eMMC code path, so if we migrate to OS Agent as information source this should be done in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for retrieving lifetime information from NVMe devices to include in the Supervisor API response. This extends the existing eMMC lifetime monitoring capability to also support NVMe storage devices, providing users with SSD health information.
Key Changes:
- Adds NVMe controller D-Bus interface support through UDisks2
- Implements NVMe lifetime detection using SMART attributes
- Refactors disk lifetime method to be async and support multiple device types
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
supervisor/dbus/udisks2/nvme_controller.py |
New D-Bus interface for NVMe controller operations and SMART data retrieval |
supervisor/dbus/udisks2/drive.py |
Enhanced drive interface to support NVMe controller detection and management |
supervisor/hardware/disk.py |
Refactored lifetime detection to be async and added NVMe support alongside existing eMMC support |
supervisor/host/info.py |
Updated to use async disk lifetime method |
supervisor/dbus/udisks2/__init__.py |
Added block device lookup by path and enhanced drive type checking |
supervisor/dbus/const.py |
Added NVMe-specific D-Bus constants and attributes |
tests/ |
Comprehensive test coverage for NVMe functionality including mocks and integration tests |
Comments suppressed due to low confidence (1)
supervisor/dbus/udisks2/nvme_controller.py:198
- The method name 'smart_get_attributes' should use PascalCase to match D-Bus naming conventions. It should be 'SmartGetAttributes'.
"smart_get_attributes", UDISKS2_DEFAULT_OPTIONS
Co-authored-by: Copilot <[email protected]>
agners
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Proposed change
Get lifetime info from NVMe devices to include in API response.
Supercedes #6035
Type of change
Additional information
Checklist
ruff format supervisor tests)If API endpoints or add-on configuration are added/changed: