From c6ad66cf58dc5df8cc618662b363dac2a00afd2c Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 18 Oct 2019 13:59:44 +0200 Subject: [PATCH] ceph-volume: add Ceph's device id to inventory This will benefit the orchestrator and dashboard to show a unified view of devices with SMART data Signed-off-by: Sebastian Wagner (cherry picked from commit e70d6041c1a093ed5c2b77abe17e1ede533d9659) --- src/ceph-volume/ceph_volume/tests/test_inventory.py | 4 +++- src/ceph-volume/ceph_volume/util/device.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ceph-volume/ceph_volume/tests/test_inventory.py b/src/ceph-volume/ceph_volume/tests/test_inventory.py index 71cb027ed8759..9721fccdb6434 100644 --- a/src/ceph-volume/ceph_volume/tests/test_inventory.py +++ b/src/ceph-volume/ceph_volume/tests/test_inventory.py @@ -25,7 +25,8 @@ def device_report_keys(device_info): 'sectorsize': '512', 'size': 1999844147200.0, 'support_discard': '', - 'vendor': 'DELL'} + 'vendor': 'DELL', + 'device_id': 'Vendor-Model-Serial'} } ) report = Devices().json_report()[0] @@ -67,6 +68,7 @@ class TestInventory(object): 'sys_api', 'available', 'lvs', + 'device_id', ] expected_sys_api_keys = [ diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index 9e0f186090cc9..08692f5ea8404 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -62,6 +62,7 @@ class Device(object): 'available', 'path', 'sys_api', + 'device_id', ] pretty_report_sys_fields = [ 'human_readable_size', -- 2.39.5