正文
摘要
最近总遇到同一批机器的IO不一样的情况.
感觉可能跟硬件设备和Raid卡的设置不一样有关系.
所以今天学习研究了下storcli的命令.
希望能够进行一些数据的收集.
Storcli简介
storcli 是LSI公司官方提供的Raid卡管理工具,
storcli已经基本代替了megacli,是一款比较简单易用的小工具。
将命令写成一个个的小脚本,会将使用变得更方便。
注意 LSI已经被高通收购了.
这个软件其实非常强大.
飞腾基于百傲的BIOS其实是没有继承raid卡的,可能还需要单独处理呢.
第一步下载
最新的下载路径
https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/007.1912.0000.0000_Unified_StorCLI.zip
# 注意这个路径ESXi只支持6.0.0以上
# 如果是低版本的可以使用如下版本的安装介质
https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/1.20.15_StorCLI.zip
注意文件比较大 里面包含了很多安装介质
Windows与linux都很简单不在复述
ESXi的安装与简单查看
第一步: 打开ESXi主机的ssh服务.
选中物理机->打开配置->软件->安全配置文件->服务->SSH
第二步: 使用工具连接SSH服务上传文件
Storcli\Unified_storcli_all_os\VMware\VMwareOP\vmware-storcli.vib
或者是低版本的
如果版本不对需要先卸载再进行处理.
esxcli software vib remove -n vmware-esx-storcli-1.20.15
esxcli software vib install -v /vmware-storcli-007.0606.0000.0000.vib --no-sig-check
第三步: 安装
esxcli software vib install -v /vmware-esx-storcli-1.20.15.vib --no-sig-check
# 注意需要增加 no-sig-check 如果是低版本的.
查看Raid相关配置
# 说明一下 我拿ESXi5.5 做实验死活不行 6.7没问题.
cd /opt/lsi/storcli
./storcli /c0 show
结果简单分析:
Virtual Drives = 1
VD LIST :
=======
--------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
--------------------------------------------------------------
0/0 RAID6 Optl RW Yes RWTD - ON 32.743 TB
--------------------------------------------------------------
VD=Virtual Drive| DG=Drive Group|Rec=Recovery
Cac=CacheCade|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|dflt=Default|
RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady
B=Blocked|Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|
WB=WriteBack |AWB=Always WriteBack|
WT=WriteThrough|C=Cached IO|
D=Direct IO|sCC=Scheduled
Check Consistency
简单猜测
DG/VD disk group 0 和 virtual disk 0
RAID6 raid类型
Optl Optimal最佳.
Access RW 读写..
Cache RWTD Write Through and Direct IO
注意这个基本上是性能最差,但是安全性最好的设置.
磁盘情况
PD LIST :
=======
-------------------------------------------------------------------------------
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
-------------------------------------------------------------------------------
23:0 13 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:1 16 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:2 12 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:3 22 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:4 14 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:5 17 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:6 11 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:7 19 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:8 15 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:9 20 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:10 18 Onln 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
23:11 21 DHS 0 3.637 TB SATA HDD N N 512B ST4000NM000A-2HZ100 U -
-------------------------------------------------------------------------------
EID=Enclosure Device ID|Slt=Slot No|DID=Device ID|DG=DriveGroup
DHS=Dedicated Hot Spare
# 注意这个是专用热备盘的意思.
UGood=Unconfigured Good|GHS=Global Hotspare
UBad=Unconfigured Bad|Sntze=Sanitize|Onln=Online|Offln=Offline|Intf=Interface
Med=Media Type|SED=Self Encryptive Drive|PI=Protection Info
SeSz=Sector Size|Sp=Spun|U=Up|D=Down|T=Transition|F=Foreign
UGUnsp=UGood Unsupported|UGShld=UGood shielded|HSPShld=Hotspare shielded
CFShld=Configured shielded|Cpybck=CopyBack|CBShld=Copyback Shielded
UBUnsp=UBad Unsupported|Rbld=Rebuild
Raid卡的设备情况
Generating detailed summary of the adapter, it may take a while to complete.
CLI Version = 007.1912.0000.0000 Nov 23, 2021
Operating system = VMkernel 6.7.0
Controller = 0
Status = Success
Description = None
Product Name = AVAGO MegaRAID SAS 9361-8i
Serial Number = SKB3473897
SAS Address = 500605b011209ab0
PCI Address = 00:3b:00:00
System Time = 12/10/2022 14:22:29
Mfg. Date = 09/06/21
Controller Time = 12/10/2022 14:25:06
FW Package Build = 24.21.0-0132
BIOS Version = 6.36.00.3_4.19.08.00_0x06180203
FW Version = 4.680.00-8527
Driver Name = lsi_mr3
Driver Version = 7.702.13.00
Current Personality = RAID-Mode
Vendor Id = 0x1000
Device Id = 0x5D
SubVendor Id = 0x1000
SubDevice Id = 0x9361
Host Interface = PCI-E
Device Interface = SAS-12G
Bus Number = 59
Device Number = 0
Function Number = 0
Domain ID = 0
Security Protocol = None
Drive Groups = 1
设备为0个的情况
很多时候使用命令返回置为0 比如:
CLI Version = 007.1912.0000.0000 Nov 23, 2021
Operating system = Linux 3.10.0-1160.el7.x86_64
Status Code = 0
Status = Success
Description = None
Controller Count = 0
此时可以通过简单的命令来查看Raid的情况:
比如本次的为: INSPUR PM8204-2GB
Raid级别为: RAID-1(1+0)
dmesg | grep -i raid
结果为:
[ 6.442352] smartpqi 0000:17:00.0: RAID IU Timeout enabled
[ 6.465150] smartpqi 0000:17:00.0: added 13:1:0:0 4000000000000000 Direct-Access INSPUR LOGICAL VOLUME SSDSmartPathCap+ En+ RAID-1(1+0)
[ 6.477132] smartpqi 0000:17:00.0: added 13:2:0:0 0000000000000000 RAID INSPUR PM8204-2GB
[ 6.478346] scsi 13:2:0:0: RAID INSPUR PM8204-2GB 4.11 PQ: 0 ANSI: 5