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

Fix SSD health percentage issue for vendor Virtium #407

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

stephenxs
Copy link
Collaborator

Description

Fix SSD health percentage issue for vendor Virtium device VSFDM8XC240G-V11-T

Motivation and Context

The SSD health percentage is calculated using 100 * (1 - NAND_endurance / Average_Erase_Count) or Remaining Life Left if either of the attributes is undefined.
On this device, NAND endurance is not defined, and Remaining Life Left is not recognized by SmartCmd or smartctl. We have to parse the health percentage using the ID of Remaining Life Left which is 231 according to the vendor.

How Has This Been Tested?

Unit test and manually test on different Virtium devices (VSFDM8XC240G-V11-T and StorFly VSF302XC016G-MLX1

Additional Information (Optional)

The output of smartctl for a VSFDM8XC240G-V11-T device

smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-18-2-amd64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     VSFDM8XC240G-V11-T
Serial Number:    61174-0181
Firmware Version: 0913-000
User Capacity:    240,057,409,536 bytes [240 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches
TRIM Command:     Available, deterministic, zeroed
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Wed Oct 18 09:39:47 2023 IDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever 
                                        been run.
Total time to complete Offline 
data collection:                (    0) seconds.
Offline data collection
capabilities:                    (0x73) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        No Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine 
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (  15) minutes.
Conveyance self-test routine
recommended polling time:        (   0) minutes.
SCT capabilities:              (0x0031) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000b   100   100   000    Pre-fail  Always       -       0
  5 Reallocated_Sector_Ct   0x0013   100   100   000    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       3821
 12 Power_Cycle_Count       0x0012   100   100   000    Old_age   Always       -       457
 14 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       469427376
 15 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       468862128
 16 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       1378
 17 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       1378
100 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       44800
168 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       0
170 Unknown_Attribute       0x0003   100   100   000    Pre-fail  Always       -       0
172 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       0
173 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       77
174 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       452
175 Program_Fail_Count_Chip 0x0012   100   100   000    Old_age   Always       -       11
181 Program_Fail_Cnt_Total  0x0012   100   100   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0012   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0023   056   241   000    Pre-fail  Always       -       44 (Min/Max 29/115)
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0012   100   100   000    Old_age   Always       -       0
199 UDMA_CRC_Error_Count    0x000b   100   100   000    Pre-fail  Always       -       0
202 Unknown_SSD_Attribute   0x0012   000   000   000    Old_age   Always       -       0
231 Unknown_SSD_Attribute   0x0013   100   100   000    Pre-fail  Always       -       100
232 Available_Reservd_Space 0x0013   100   100   000    Pre-fail  Always       -       0
234 Unknown_Attribute       0x000b   100   100   000    Pre-fail  Always       -       2642803776
235 Unknown_Attribute       0x000b   100   100   000    Pre-fail  Always       -       4359704832
241 Total_LBAs_Written      0x0012   100   100   000    Old_age   Always       -       3523545739
242 Total_LBAs_Read         0x0012   100   100   000    Old_age   Always       -       1097246431
247 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       4359704832
248 Unknown_Attribute       0x0012   100   100   000    Old_age   Always       -       11

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

The output of SmartCmd of a VSFDM8XC240G-V11-T device

SMART attributes 
 ID                    Attribute   High Raw    Low Raw Value Worst Threshold 
  1          Raw_Read_Error_Rate          0          0   100   100         0 
  5           Reserved_Attribute          0          0   100   100         0 
  9               Power_On_Hours          0       3821   100   100         0 
 12            Power_Cycle_Count          0        457   100   100         0 
 14           Reserved_Attribute          0  469427376   100   100         0 
 15           Reserved_Attribute          0  468862128   100   100         0 
 16           Reserved_Attribute          0       1378   100   100         0 
 17           Reserved_Attribute          0       1378   100   100         0 
100           Reserved_Attribute          0      44800   100   100         0 
168               NAND_Endurance          0          0   100   100         0 
170           Reserved_Attribute          0          0   100   100         0 
172           Reserved_Attribute          0          0   100   100         0 
173           Reserved_Attribute          0         77   100   100         0 
174           Reserved_Attribute          0        452   100   100         0 
175           Reserved_Attribute          0         11   100   100         0 
181           Total_Program_Fail          0          0   100   100         0 
187    Uncorrectable_Error_Count          0          0   100   100         0 
194          Temperature_Celsius        115         44    56   241         0 
197 Current_Pending_Sector_Count          0          0   100   100         0 
198           Reserved_Attribute          0          0   100   100         0 
199         UDMA_CRC_Error_Count          0          0   100   100         0 
202                   TRIM_Count          0          0     0     0         0 
231           Reserved_Attribute          0        100   100   100         0 
232           Reserved_Attribute          0          0   100   100         0 
234           Reserved_Attribute          0 2642803264   100   100         0 
235           Reserved_Attribute          1   64735680   100   100         0 
241           Total_LBAs_Written          0 3523545139   100   100         0 
242              Total_LBAs_Read          0 1097246431   100   100         0 
247           Reserved_Attribute          1   64735680   100   100         0 
248          Remaining_Life_Left          0         11   100   100         0 

@prgeor
Copy link
Collaborator

prgeor commented Oct 22, 2023

@stephenxs please attach the output of show platform ssd or ssdutil

@stephenxs stephenxs requested a review from prgeor October 23, 2023 01:29
@stephenxs
Copy link
Collaborator Author

@stephenxs please attach the output of show platform ssd or ssdutil

Hi @prgeor

VSFDM8XC240G-V11-T

show platform ssdhealth 
Device Model : VSFDM8XC240G-V11-T
Health       : 100.0%
Temperature  : 38C

StorFly VSF302XC016G-MLX

admin@sonic:~$ show platform ssdhealth 
Device Model : StorFly VSF302XC016G-MLX
Health       : 85.21000000000001%
Temperature  : 26C

@prgeor prgeor merged commit 6d804d6 into sonic-net:master Oct 23, 2023
4 checks passed
@stephenxs stephenxs deleted the fix-ssd-health branch October 23, 2023 23:49
stephenxs added a commit to stephenxs/sonic-platform-common that referenced this pull request Oct 24, 2023
jaganbal-a pushed a commit to jaganbal-a/for_PM_stats that referenced this pull request Oct 26, 2023
* Fix SSD health issue for a certain vendor

Signed-off-by: Stephen Sun <[email protected]>

* Remove a line

Signed-off-by: Stephen Sun <[email protected]>

---------

Signed-off-by: Stephen Sun <[email protected]>
stephenxs added a commit to stephenxs/sonic-platform-common that referenced this pull request Oct 28, 2023
@StormLiangMS
Copy link

@dgsudharsan thanks.

@stephenxs could you help to file separate PR for cherry pick conflict to 202305?

StormLiangMS pushed a commit that referenced this pull request Nov 2, 2023
Description
Fix SSD health percentage issue for vendor Virtium device VSFDM8XC240G-V11-T
This is to backport #407 to 202305 branch

Motivation and Context
The SSD health percentage is calculated using 100 * (1 - NAND_endurance / Average_Erase_Count) or Remaining Life Left if either of the attributes is undefined.
On this device, NAND endurance is not defined, and Remaining Life Left is not recognized by SmartCmd or smartctl. We have to parse the health percentage using the ID of Remaining Life Left which is 231 according to the vendor.

How Has This Been Tested?
Unit test and manually test on different Virtium devices (VSFDM8XC240G-V11-T and StorFly VSF302XC016G-MLX1
@dgsudharsan
Copy link
Collaborator

@dgsudharsan thanks.

@stephenxs could you help to file separate PR for cherry pick conflict to 202305?

Hi @StormLiangMS Here is the PR and its merged #408

@StormLiangMS
Copy link

ignore my ask, just found it, sorry folks. #408

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants