From: Joseph Sawaya Date: Mon, 19 Jul 2021 13:26:03 +0000 (-0400) Subject: mgr/rook: add supplemental information to device object in LSOFetcher X-Git-Tag: v17.1.0~1071^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=90bba5cf5592a02fb0c9deb4e70603dfc31a3a63;p=ceph.git mgr/rook: add supplemental information to device object in LSOFetcher This commit adds the PV name, node name, vendor and model to the Device object created in the LSOFetcher device method, this information is useful for adding OSDs. Signed-off-by: Joseph Sawaya --- diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 8d885591879..161377c1ac2 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -185,11 +185,18 @@ class LSOFetcher(DefaultFetcher): def device(self, i: Any) -> Tuple[str, Device]: node = i.metadata.labels['kubernetes.io/hostname'] device_discovery = self.lso_devices[i.metadata.annotations['storage.openshift.com/device-id']] + pv_name = i.metadata.name + vendor: str = device_discovery['model'].split()[0] if len(device_discovery['model'].split()) >= 1 else '' + model: str = ' '.join(device_discovery['model'].split()[1:]) if len(device_discovery['model'].split()) > 1 else '' device = Device( path = device_discovery['path'], sys_api = dict( size = device_discovery['size'], - rotational = '1' if device_discovery['property']=='Rotational' else '0' + rotational = '1' if device_discovery['property']=='Rotational' else '0', + node = node, + pv_name = pv_name, + model = model, + vendor = vendor ), available = device_discovery['status']['state']=='Available', device_id = device_discovery['deviceID'].split('/')[-1],