Skip to content
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

Add storage counters related to errors #1091

Merged
merged 27 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions release/models/platform/.spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- yang/platform/openconfig-platform-cpu.yang
- yang/platform/openconfig-platform-ext.yang
- yang/platform/openconfig-platform-software.yang
- yang/platform/openconfig-platform-storage.yang
- yang/platform/openconfig-platform-fabric.yang
- yang/platform/openconfig-platform-pipeline-counters.yang
- yang/platform/openconfig-platform-integrated-circuit.yang
Expand All @@ -31,6 +32,7 @@
- yang/platform/openconfig-platform-ext.yang
- yang/platform/openconfig-platform-cpu.yang
- yang/platform/openconfig-platform-software.yang
- yang/platform/openconfig-platform-storage.yang
- yang/platform/openconfig-platform-fabric.yang
- yang/platform/openconfig-platform-pipeline-counters.yang
- yang/platform/openconfig-platform-integrated-circuit.yang
Expand Down
8 changes: 7 additions & 1 deletion release/models/platform/openconfig-platform-common.yang
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ submodule openconfig-platform-common {
"This modules contains common groupings that are used in multiple
components within the platform module.";

oc-ext:openconfig-version "0.29.0";
oc-ext:openconfig-version "0.30.0";

revision "2024-10-13" {
description
"Add storage state io-errors.";
reference "0.30.0";
}

revision "2024-10-13" {
description
Expand Down
164 changes: 164 additions & 0 deletions release/models/platform/openconfig-platform-storage.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
module openconfig-platform-storage {

yang-version "1";

// namespace
namespace "http://openconfig.net/yang/platform/storage";

prefix "oc-storage";

import openconfig-platform {
prefix oc-platform;
}
import openconfig-extensions {
prefix oc-ext;
}
import openconfig-yang-types {
prefix oc-yang;
}

// meta
organization
"OpenConfig working group";

contact
"OpenConfig working group
www.openconfig.net";

description
"This module defines data related to STORAGE components in the
OpenConfig platform model.

Portions of this code were derived from the following copyright holders.
References to each copyright holder are mentioned where related content
is used.

NVM Express Base Specification Revision 2.0a
https://nvmexpress.org/wp-content/uploads/NVMe-NVM-Express-2.0a-2021.07.26-Ratified.pdf
(c) Copyright 2007 to 2021 NVM Express, Inc. ALL RIGHTS RESERVED.
This NVM Express Base Specification, revision 2.0a is proprietary to the
NVM Express, Inc. (also referred to as “Company”) and/or its successors
and assigns.

S.M.A.R.T. Attribute: Reallocated Sectors Count | Knowledge Base
http://kb.acronis.com.";

oc-ext:openconfig-version "0.1.0";

revision "2024-08-26" {
description
"Initial revision.";
reference
"0.1.0";
}

// OpenConfig specific extensions for module metadata.
oc-ext:regexp-posix;
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

// identity statements
// typedef statements
// grouping statements
grouping storage-counters-state {
description
"Operational state for storage component statistics. These leaves
are derived from a list of commonly supported S.M.A.R.T. counters.
Note that while common, these attributes may not be supported by
all storage device vendors and media types.";

leaf soft-read-error-rate {
type oc-yang:counter64;
description
"Uncorrected read errors reported to the operating system. SMART ID
201.";
reference
"S.M.A.R.T. Attribute: Soft Read Error Rate / Off Track Errors (Maxtor)
| Knowledge Base. kb.acronis.com.";
}

leaf reallocated-sectors {
type oc-yang:counter64;
description
"Count of reallocated sectors. The raw value represents a count of
the bad sectors that have been found and remapped. SMART ID 5.";
reference
"S.M.A.R.T. Attribute: Reallocated Sectors Count | Knowledge Base -
kb.acronis.com";
}

leaf end-to-end-error {
type oc-yang:counter64;
description
"Count of parity errors which occur in the data path to the media.
SMART ID 184.";
reference
"Acronis Drive Monitor: Disk Health Calculation Knowledge Base -
kb.acronis.com";
}

leaf offline-uncorrectable-sectors-count {
type oc-yang:counter64;
description
"The total count of uncorrectable errors when reading/writing a
sector. SMART ID 198.";
reference
"Acronis Drive Monitor: Disk Health Calculation Knowledge Base -
kb.acronis.com";
}

leaf life-left {
type uint8;
description
"Indicates the approximate SSD life left, in terms of program/erase
cycles or available reserved blocks. A normalized value of 100
represents a new drive, with a threshold value at 10 indicating a need
for replacement. A value of 0 may mean that the drive is operating in
read-only mode to allow data recovery. SMART ID 231.";
reference
"SMART attribute details,
https://media.kingston.com/support/downloads/MKP_306_SMART_attribute.pdf";
}

leaf percentage-used {
type uint8;
description
"Contains a vendor specific estimate of the percentage of NVM
subsystem life used based on the actual usage and the manufacturer’s
prediction of NVM life. A value of 100 indicates that the estimated
endurance of the NVM in the NVM subsystem has been consumed, but may
not indicate an NVM subsystem failure. The value is allowed to exceed
100. Percentages greater than 254 shall be represented as 255.";
reference
"NVM Express Base Specification Revision 2.0a
https://nvmexpress.org/wp-content/uploads/NVMe-NVM-Express-2.0a-2021.07.26-Ratified.pdf";
}
}
grouping storage-state {
description
"Storage component state. These counters are derived from the
linux kernel block layer statistics in /sys/block/<dev>/stat.
Implementations which do not use the linux kernel to access
storage should provide equivalent counters.";
reference
"https://www.kernel.org/doc/Documentation/block/stat.txt";

container counters {
description
"A collection of storage specific statistics entitites.";

uses storage-counters-state;
}
}

// data definition statements
// augment statements
augment "/oc-platform:components/oc-platform:component/" +
"oc-platform:storage/oc-platform:state" {
description
"Adding storage data to component model";

uses storage-state;
}
}

14 changes: 9 additions & 5 deletions release/models/platform/openconfig-platform.yang
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ module openconfig-platform {
(presence or absence of a component) and state (physical
attributes or status).";

oc-ext:openconfig-version "0.29.0";
oc-ext:openconfig-version "0.30.0";

revision "2024-10-13" {
description
"Add storage state io-errors.";
reference "0.30.0";
}

revision "2024-10-13" {
description
Expand Down Expand Up @@ -94,13 +100,11 @@ module openconfig-platform {

revision "2024-01-30" {
description
"Add rules for controller-card power-off
Also introduces last-poweroff-reason container
and last-poweroff-time leaf";
"Updated description for component-power-type";
reference "0.25.0";
}

revision "2023-11-28" {
revision "2023-11-28" {
description
"Add model-name";
reference "0.24.0";
Expand Down
Loading