Thursday, May 2, 2013

Troubleshooting bad hard disk on Nutanix

stargate marks a disk offline if any command to it  takes more than 20 seconds.

Reasons that a disk could take more than 20 seconds to respond

1. bad sectors - sudo smartctl -a /dev/sdX1 -T permissive
2. bad adapter - sudo smartctl  -l sataphy /dev/sdc1
3. bad chassis
4. disk slow ( iostat from sysstats - data/logs/sysstat)
5. stargate.INFO will show the disk offline and gdb the stargate core file - stuck on fdatasync and pwrite
6. Mark the disk offline to see if goes offline again.

The following solution details, walks through the commands.
Solution
Here is an example of the outputs

1. io-stat: ( you can graph using Nagios- zk_leader:7777 or sysstats directory in /home/nutanix/data/logs)

IO on this disk was stuck for more than 20s which caused stargate to mark it offline. There were a bunch of writes ops in progress which were stuck on the pwrite/fdatasync system calls on this disk.

#TIMESTAMP 1366215700 : 04/17/2013 09:21:40 AM
Linux 2.6.35-30-server (NTNX-Ctrl-VM-3-NTNX)    04/17/2013      _x86_64_        (8 CPU)
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           8.10    0.95    6.14   45.96    0.00   38.85
Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await  svctm  %util
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda               0.00     9.00    0.00    8.40     0.00     0.07    16.57     0.00    0.24   0.24   0.20
sdb               0.00   100.80    4.60   10.80     0.19     0.43    82.29     0.04    2.60   2.21   3.40
sdc               0.00     0.00    0.00    1.40     0.00     0.70  1024.00    13.82 10674.29 714.29 100.00
sdd               0.00  1618.60    4.60   15.20     0.16     6.38   676.77     3.04  153.43  10.91  21.60
2. smartctrl -l sataphy output: check if it increments.

ATA Phy Event Counters (GP Log 0x11)
ID      Size     Value  Description
0x000a  2           83  Device-to-host register FISes sent due to a COMRESET
0x0001  2           38  Command failed due to ICRC error
0x0003  2            0  R_ERR response for device-to-host data FIS
0x0004  2           38  R_ERR response for host-to-device data FIS
0x0007  2            2  R_ERR response for host-to-device non-data FIS
3. lspci |grep -i sata: to find the type of controller
00:00:1f.2 Mass storage controller: Intel Corporation ICH10 6 port SATA AHCI Controller [vmhba0]

4. ncli disk ls - offline disks to see offline disks
Disk ID                   : 5946892
Storage Tier              : DAS-SATA
Host Name                 : 10.30.1.212
Mount Path                : /home/nutanix/data/stargate-storage/disks/9XG2WKG1
Online                    : false
Location                  : 6
5. stargate.ERROR:
E0417 09:21:49.258476  5468 extent_store.cc:546] notification=PathOffline mount_path=/home/nutanix/data/stargate-storage/disks/9XG2WKG1 ip_address=10.30.1.217 service_vm_id=17
F0417 09:21:49.263244  5468 extent_store.cc:667] Mount path /home/nutanix/data/stargate-storage/disks/9XG2WKG1 with disk id 5946892 marked offline
6. dmesg or sudo cat /var/log/messages on CVM
7. zeus_config_printer:
{
  "cluster_id": 1081,
  "disk_id": 5946892,
  "disk_size": 925779999948,
  "storage_tier": "DAS-SATA"
}


8. smartctl on disks
root@NTGTDC-Ctrl-VM-3:10.30.1.217:/var/log# smartctl  -a /dev/sdc1 -T permissive
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.35-30-server] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF INFORMATION SECTION ===
Serial Number:    9XG2WKG1
LU WWN Device Id: 5 000c50 04e7f347e
Firmware Version: SN02  <<<< SN03 is better.
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
=== START OF READ SMART DATA SECTION ===
SMART STATUS RETURN: incomplete response, ATA output registers missing
General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
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:                (  642) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        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:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 201) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x10bd) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   079   069   044    Pre-fail  Always       -       98874921
  3 Spin_Up_Time            0x0003   095   094   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       25
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   100   253   030    Pre-fail  Always       -       420367
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       516
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       23
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   098   076   000    Old_age   Always       -       26
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   076   060   045    Old_age   Always       -       24 (Min/Max 20/29)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       19
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       600
194 Temperature_Celsius     0x0022   024   040   000    Old_age   Always       -       24 (0 17 0 0 0)
195 Hardware_ECC_Recovered  0x001a   115   100   000    Old_age   Always       -       98874921
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   199   000    Old_age   Always       -       38
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.

9. gdb on core file: (stack trace output)
vim stargate.core.5425.6.20130417-092157.stack_trace.txt.gz - stuck on fdatasync or pwrite.

Thread 78 (Thread 5536):
#0  0x00007f8fd985a027 in fdatasync () from /home/nutanix/toolchain/x86_64-unknown-linux-gnu/1.3/lib/libc.so.6
Thread 77 (Thread 5558):
#0  0x00007f8fd9859868 in pwritev (fd=72, vector=0x3489f460, count=7, offset=15323) at ../sysdeps/unix/sysv/linux/pwritev.c:67

 10. ncli disk mark-online id=5946892
11. Commands to check the status disks from ESXi (on NX2400 ) -- esxcfg-scsidevs -A, lsscsi (centos)

12. s
udo hdparm --verbose -W0 /dev/sdf - if results in the errors, fix it by rebooting ESXi

13. 
sudo cluster/bin/repartition_disks -d /dev/sdX
sudo cluster/bin/clean_disks -p /dev/sdX1
sudo cluster/bin/mount_disks
genesis restart

14 udevadm info -q all -n /dev/sdf - verify you get all the info similar to working disk

15. 
 dd if=/dev/sdf of=/dev/null bs=1024 count=5 (read from disk)

1 comment: