Skip to content

Conversation

@mdegat01
Copy link
Contributor

Proposed change

Get lifetime info from NVMe devices to include in API response.

Supercedes #6035

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to cli pull request:
  • Link to client library pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@mdegat01 mdegat01 requested a review from agners July 31, 2025 20:24
@mdegat01 mdegat01 added the new-feature A new feature label Jul 31, 2025
@mdegat01 mdegat01 mentioned this pull request Jul 31, 2025
14 tasks
"""Get mount source device name.
Must be run in executor.
"""
Copy link
Member

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.

@agners agners requested a review from Copilot August 4, 2025 08:13
Copy link
Contributor

Copilot AI left a 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

Copy link
Member

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@agners agners merged commit 22afa60 into main Aug 4, 2025
22 of 23 checks passed
@agners agners deleted the nvme-lifetime-info-2 branch August 4, 2025 11:53
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants