|
Last updated on Friday 14th of April 2023 02:58:40 PM ©VMWare ©ESXi SMART featuresHow to perform a SMART check on your disks
S.M.A.R.T. technology allows to retrieve stats on the use of disks, which in turn allows to prevent data loss due to hardware flaws by anticipating them. ©ESXi includes some basic SMART checking that can be performed on the command line in the ©ESXi shell. The tool is very simple and will scan each disk and output basic and useful statistics. The general command to get the SMART table for a given disk is below
esxcli storage core device smart get -d [disk-id]
If you have some disks you would need to issue the above command for every disk in your system. Fortunately we can list all disks in a host by running the command below
esxcli storage core device list
Which will output something like
esxcli storage core device list
t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____0000000000000000000__00000001 Display Name: Local NVMe Disk (t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____0000000000000000000__00000001) Has Settable Display Name: true Size: 1907729 Device Type: Direct-Access Multipath Plugin: HPP Devfs Path: /vmfs/devices/disks/t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____0000000000000000000__00000001 Vendor: NVMe Model: INTEL SSDPE2ME02 Revision: 8DV1 SCSI Level: 7 Is Pseudo: false Status: on Is RDM Capable: false Is Local: true Is Removable: false Is SSD: true Is VVOL PE: false Is Offline: false Is Perennially Reserved: false Queue Full Sample Size: 0 Queue Full Threshold: 0 Thin Provisioning Status: yes Attached Filters: VAAI Status: unsupported Other UIDs: vml.05a1eaf1ef026b3fa253dfce8cdd1b0438f62e7302333e726b733a6f35017214d3 Is Shared Clusterwide: false Is SAS: false Is USB: false Is Boot Device: false Device Max Queue Depth: 1023 No of outstanding IOs with competing worlds: 32 Drive Type: physical RAID Level: NA Number of Physical Drives: 1 Protection Enabled: false PI Activated: false PI Type: 0 PI Protection Mask: NO PROTECTION Supported Guard Types: NO GUARD SUPPORT DIX Enabled: false DIX Guard Type: NO GUARD SUPPORT Emulated DIX/DIF Enabled: false t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____11111111111111111111__00000001 Display Name: Local NVMe Disk (t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____11111111111111111111__00000001) Has Settable Display Name: true Size: 1907729 Device Type: Direct-Access Multipath Plugin: HPP Devfs Path: /vmfs/devices/disks/t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____11111111111111111111__00000001 Vendor: NVMe Model: INTEL SSDPE2ME02 Revision: 8DV1 SCSI Level: 7 Is Pseudo: false Status: on Is RDM Capable: false Is Local: true Is Removable: false Is SSD: true Is VVOL PE: false Is Offline: false Is Perennially Reserved: false Queue Full Sample Size: 0 Queue Full Threshold: 0 Thin Provisioning Status: yes Attached Filters: VAAI Status: unsupported Other UIDs: vml.05bc2e686c6f6eb10c5a5d24dcedee26e6ec436efe92154d494810625aae7e8e64 Is Shared Clusterwide: false Is SAS: false Is USB: false Is Boot Device: false Device Max Queue Depth: 1023 No of outstanding IOs with competing worlds: 32 Drive Type: physical RAID Level: NA Number of Physical Drives: 1 Protection Enabled: false PI Activated: false PI Type: 0 PI Protection Mask: NO PROTECTION Supported Guard Types: NO GUARD SUPPORT DIX Enabled: false DIX Guard Type: NO GUARD SUPPORT Emulated DIX/DIF Enabled: false t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____2222222222222222222__00000001 Display Name: Local NVMe Disk (t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____2222222222222222222__00000001) Has Settable Display Name: true Size: 1907729 Device Type: Direct-Access Multipath Plugin: HPP Devfs Path: /vmfs/devices/disks/t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____2222222222222222222__00000001 Vendor: NVMe Model: INTEL SSDPE2ME02 Revision: 8DV1 SCSI Level: 7 Is Pseudo: false Status: on Is RDM Capable: false Is Local: true Is Removable: false Is SSD: true Is VVOL PE: false Is Offline: false Is Perennially Reserved: false Queue Full Sample Size: 0 Queue Full Threshold: 0 Thin Provisioning Status: yes Attached Filters: VAAI Status: unsupported Other UIDs: vml.05248bd4b1505f99d49d83a174040144d9e69cc6ef9b0e67eb9a23b29591668bfa Is Shared Clusterwide: false Is SAS: false Is USB: false Is Boot Device: false Device Max Queue Depth: 1023 No of outstanding IOs with competing worlds: 32 Drive Type: physical RAID Level: NA Number of Physical Drives: 1 Protection Enabled: false PI Activated: false PI Type: 0 PI Protection Mask: NO PROTECTION Supported Guard Types: NO GUARD SUPPORT DIX Enabled: false DIX Guard Type: NO GUARD SUPPORT Emulated DIX/DIF Enabled: false We can obtain each disk Id from the above output. In this example we have three SSD NVMe Intel disks. To extract the name or disk-id of each disk we can use some simple one liner bash command like this.
esxcli storage core device list | grep "Devfs Path:" | awk -F ': ' '{print $2}' | awk -F '/' '{print $NF}'
Then the above obtained list of disk ids can be passed to the SMART tool binary in a loop. D="$( esxcli storage core device list | grep "Devfs Path:" | awk -F ': ' '{print $2}' | awk -F '/' '{print $NF}' )"; for d in $D do echo -e "\nDISK:$d";esxcli storage core device smart get -d $d done Which will in turn produce this output.
DISK:t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____0000000000000000000__00000001
Parameter Value Threshold Worst Raw ------------------------ ---------- --------- ----- --- Health Status OK N/A N/A N/A Power-on Hours 15161 N/A N/A N/A Power Cycle Count 77 N/A N/A N/A Reallocated Sector Count 0 90 N/A N/A Drive Temperature 21 85 N/A N/A Write Sectors TOT Count 1174029000 N/A N/A N/A Read Sectors TOT Count 99545000 N/A N/A N/A DISK:t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____11111111111111111111__00000001 Parameter Value Threshold Worst Raw ------------------------ --------- --------- ----- --- Health Status OK N/A N/A N/A Power-on Hours 15110 N/A N/A N/A Power Cycle Count 80 N/A N/A N/A Reallocated Sector Count 0 90 N/A N/A Drive Temperature 21 85 N/A N/A Write Sectors TOT Count 371989000 N/A N/A N/A Read Sectors TOT Count 58795000 N/A N/A N/A DISK:t10.NVMe____INTEL_SSDXXXXXXXXXXX_SFF_NVME_2000GB____2222222222222222222__00000001 Parameter Value Threshold Worst Raw ------------------------ --------- --------- ----- --- Health Status OK N/A N/A N/A Power-on Hours 2573 N/A N/A N/A Power Cycle Count 23 N/A N/A N/A Reallocated Sector Count 0 90 N/A N/A Drive Temperature 22 85 N/A N/A Write Sectors TOT Count 495662000 N/A N/A N/A Read Sectors TOT Count 52416000 N/A N/A N/A |
|

