2013年5月23日木曜日

kvmによる仮想マシン"-cpu host"オプションで性能向上する場合がある

kvmのゲストマシンのチューニングをするために、以下のページを眺めていたら、
http://www.linux-kvm.org/page/Tuning_KVM

こんな、記述を発見しました。

Modern processors come with a wide variety of performance enhancing features such as streaming instructions sets (sse) and other performance-enhancing instructions. These features vary from processor to processor. 
QEMU and KVM default to a compatible subset of cpu features, so that if you change your host processor, or perform a live migration, the guest will see its cpu features unchanged. This is great for compatibility but comes at a performance cost. 
To pass all available host processor features to the guest, use the command line switch
 qemu -cpu host
なるほど-cpu hostをつければ、CPUの高速演算機能が使えて、性能が向上するかもしれないのか…

ということで試してみました。

"-cpu host"が無いゲストマシン

# egrep model /proc/cpuinfo
model           : 2
model name      : QEMU Virtual CPU version 1.4.1
model           : 2
model name      : QEMU Virtual CPU version 1.4.1
# egrep flags /proc/cpuinfo
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni cx16 popcnt hypervisor lahf_lm
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni cx16 popcnt hypervisor lahf_lm
"-cpu host"があるゲストマシン
# egrep model /proc/cpuinfo
model           : 45
model name      : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
model           : 45
model name      : Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz 
# egrep flags /proc/cpuinfo
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm xsaveopt tsc_adjust
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm xsaveopt tsc_adjust
CPUの認識のされ方、見えてるflagの数が違います。

実際にlinpackベンチマークを採ってみました。

"-cpu host"が無いゲストマシン 13.0GFlops
# cat lin_xeon64.txt
Thu May 23 18:59:36 JST 2013
Intel(R) Optimized LINPACK Benchmark data
Current date/time: Thu May 23 18:59:36 2013
CPU frequency:    1.991 GHz
Number of CPUs: 2
Number of cores: 2
Number of threads: 2
Parameters are set to:
Number of tests: 15
Number of equations to solve (problem size) : 1000  2000  5000  10000 15000 18000 20000 22000 25000 26000 27000 30000 35000 40000 45000
Leading dimension of array                  : 1000  2000  5008  10000 15000 18008 20016 22008 25000 26000 27000 30000 35000 40000 45000
Number of trials to run                     : 4     2     2     2     2     2     2     2     2     2     1     1     1     1     1  
Data alignment value (in Kbytes)            : 4     4     4     4     4     4     4     4     4     4     4     1     1     1     1  
Maximum memory requested that can be used=3873852256, at the size=22000
=================== Timing linear equation system solver ===================
Size   LDA    Align. Time(s)    GFlops   Residual     Residual(norm) Check
1000   1000   4      0.073      9.1585   1.125766e-12 3.839152e-02   pass
1000   1000   4      0.058      11.5232  1.125766e-12 3.839152e-02   pass
1000   1000   4      0.058      11.5443  1.125766e-12 3.839152e-02   pass
1000   1000   4      0.059      11.2817  1.125766e-12 3.839152e-02   pass
2000   2000   4      0.440      12.1283  4.992673e-12 4.343014e-02   pass
2000   2000   4      0.440      12.1421  4.992673e-12 4.343014e-02   pass
5000   5008   4      6.610      12.6155  2.427966e-11 3.385603e-02   pass
5000   5008   4      6.605      12.6248  2.427966e-11 3.385603e-02   pass
10000  10000  4      51.994     12.8258  8.998519e-11 3.172969e-02   pass
10000  10000  4      51.965     12.8330  8.998519e-11 3.172969e-02   pass
15000  15000  4      174.335    12.9087  2.187028e-10 3.444605e-02   pass
15000  15000  4      173.510    12.9702  2.187028e-10 3.444605e-02   pass
18000  18008  4      298.936    13.0083  2.887995e-10 3.162709e-02   pass
18000  18008  4      298.826    13.0131  2.887995e-10 3.162709e-02   pass
20000  20016  4      409.500    13.0260  3.701985e-10 3.277068e-02   pass
20000  20016  4      408.885    13.0456  3.701985e-10 3.277068e-02   pass
22000  22008  4      544.380    13.0417  4.627267e-10 3.389291e-02   pass
22000  22008  4      544.508    13.0386  4.627267e-10 3.389291e-02   pass
Performance Summary (GFlops)
Size   LDA    Align.  Average  Maximal
1000   1000   4       10.8769  11.5443
2000   2000   4       12.1352  12.1421
5000   5008   4       12.6201  12.6248
10000  10000  4       12.8294  12.8330
15000  15000  4       12.9395  12.9702
18000  18008  4       13.0107  13.0131
20000  20016  4       13.0358  13.0456
22000  22008  4       13.0402  13.0417
Residual checks PASSED
End of tests
Done: Thu May 23 19:53:14 JST 2013

"-cpu host"があるゲストマシン 28.1GFlops
# cat lin_xeon64.txt
Thu May 23 18:58:46 JST 2013
Intel(R) Optimized LINPACK Benchmark data
Current date/time: Thu May 23 18:58:46 2013
CPU frequency:    1.991 GHz
Number of CPUs: 2
Number of cores: 2
Number of threads: 2
Parameters are set to:
Number of tests: 15
Number of equations to solve (problem size) : 1000  2000  5000  10000 15000 18000 20000 22000 25000 26000 27000 30000 35000 40000 45000
Leading dimension of array                  : 1000  2000  5008  10000 15000 18008 20016 22008 25000 26000 27000 30000 35000 40000 45000
Number of trials to run                     : 4     2     2     2     2     2     2     2     2     2     1     1     1     1     1  
Data alignment value (in Kbytes)            : 4     4     4     4     4     4     4     4     4     4     4     1     1     1     1  
Maximum memory requested that can be used=3873852256, at the size=22000
=================== Timing linear equation system solver ===================
Size   LDA    Align. Time(s)    GFlops   Residual     Residual(norm) Check
1000   1000   4      0.040      16.7342  1.029343e-12 3.510325e-02   pass
1000   1000   4      0.033      20.1526  1.029343e-12 3.510325e-02   pass
1000   1000   4      0.033      20.1592  1.029343e-12 3.510325e-02   pass
1000   1000   4      0.033      20.1368  1.029343e-12 3.510325e-02   pass
2000   2000   4      0.277      19.2876  4.298950e-12 3.739560e-02   pass
2000   2000   4      0.275      19.4285  4.298950e-12 3.739560e-02   pass
5000   5008   4      3.235      25.7781  2.581643e-11 3.599893e-02   pass
5000   5008   4      3.219      25.9008  2.581643e-11 3.599893e-02   pass
10000  10000  4      24.330     27.4089  9.603002e-11 3.386116e-02   pass
10000  10000  4      24.457     27.2672  9.603002e-11 3.386116e-02   pass
15000  15000  4      80.958     27.7979  2.042799e-10 3.217442e-02   pass
15000  15000  4      80.941     27.8037  2.042799e-10 3.217442e-02   pass
18000  18008  4      139.266    27.9224  2.894987e-10 3.170367e-02   pass
18000  18008  4      139.108    27.9542  2.894987e-10 3.170367e-02   pass
20000  20016  4      191.221    27.8951  4.097986e-10 3.627616e-02   pass
20000  20016  4      191.229    27.8940  4.097986e-10 3.627616e-02   pass
22000  22008  4      252.595    28.1068  4.548092e-10 3.331299e-02   pass
22000  22008  4      252.600    28.1062  4.548092e-10 3.331299e-02   pass
Performance Summary (GFlops)
Size   LDA    Align.  Average  Maximal
1000   1000   4       19.2957  20.1592
2000   2000   4       19.3581  19.4285
5000   5008   4       25.8395  25.9008
10000  10000  4       27.3381  27.4089
15000  15000  4       27.8008  27.8037
18000  18008  4       27.9383  27.9542
20000  20016  4       27.8946  27.8951
22000  22008  4       28.1065  28.1068
Residual checks PASSED
End of tests
Done: Thu May 23 19:25:57 JST 2013

"-cpu host"無しで 13.0GFlops、有りで 28.1GFlops。


だいぶ違いますね。

使っている便利マークソフトが、Intelで最適化されたLinpackなので、最新のCPUの高速演算機能を使い倒せるようになっているのだと思います。


この他、sysbenchのcpuテストや、Unixbenchで比べてみましたが、"-cpu host"有り無しでの性能差はありませんでした。


そうすると、ものによっては、最適化によってCPUの機能(sse4やavx等)が使い倒せれば、速くなるということなのかもしれません。

MegaRAIDのStorCLIを試してみました。

みなさんこんにちは!

今日も相変わらず良い天気ですね。そろそろ、長袖のシャツでは暑く感じることも多くなってきました。

さて、本日は、LSIのRAIDカードの管理ユーティリティーツール、StorCLIについて、ご紹介したいと思います。
皆さんは、RAIDカードの管理ユーティリティーと言ったら、何を思い浮かべますか?
多くの方は、綺麗なGUIツールでRAIDのアレイ削除を行ったり、Webブラウザーを使って管理することを思い浮かべるかもしれません。

今回ご紹介するのは、そういうものではなくて、sshログインしたサーバ上でコマンドラインでRAIDの設定を行う、ソフトウェアです。
古くは、3wareのtw_cliであったり、Adaptecのarcconf、LSIのmegacliをご存知の方にとっては、お馴染みかもしれません。

私個人的には、tw_cliは使いこなしており、その後、arcconfなども使っておりましたが、LSIのmegacliはあまり使いやすいとは感じておりませんでした。
つい最近、LSIのサイトでドライバなどを探していた時に、たまたま、StorCLIという比較的新しいツールがリリースされていましたので、試しに使ってみました。

インストールは以下の通り
# wget http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/1.03.11_StorCLI.zip
# unzip 1.03.11_StorCLI.zip
# cd StorCli_All_OS/Linux/
# alien  -t storcli-1.03.11-1.noarch.rpm
# tar tvf storcli-1.03.11.tgz
drwxr-xr-x root/root         0 2013-05-23 01:57 ./
drwxr-xr-x root/root         0 2013-05-23 01:57 ./opt/
drwxr-xr-x root/root         0 2013-05-23 01:57 ./opt/MegaRAID/
drwxr-xr-x root/root         0 2013-05-23 01:57 ./opt/MegaRAID/storcli/
-rwxr-xr-x root/root   4956856 2013-01-30 19:25 ./opt/MegaRAID/storcli/storcli64
-rwxr-xr-x root/root   4907676 2013-01-30 19:25 ./opt/MegaRAID/storcli/storcli
# tar  xf storcli-1.03.11.tgz  -C /
# tree /opt/      
/opt/
`-- MegaRAID
    `-- storcli
        |-- storcli
        `-- storcli64
2 directories, 2 files

storcli64が64bit Linux用のバイナリです。早速、コマンドを叩いてみると、
# /opt/MegaRAID/storcli/storcli64
     Storage Command Line Tool  Ver 1.03.11 Jan 30, 2013
     (c)Copyright 2012, LSI Corporation, All Rights Reserved.

help - lists all the commands with their usage. E.g. storcli help
help - gives details about a particular command. E.g. storcli add help
List of commands:
Commands   Description
-------------------------------------------------------------------
add        Adds/creates a new element to controller like VD,Spare..etc
delete     Deletes an element like VD,Spare
show       Displays information about an element
set        Set a particular value to a property
start      Start background operation
stop       Stop background operation
pause      Pause background operation
resume     Resume background operation
download   Downloads file to given device
expand     expands size of given drive
insert     inserts new drive for missing
transform  downgrades the controller
/cx        Controller specific commands
/ex        Enclosure specific commands
/sx        Slot/PD specific commands
/vx        Virtual drive specific commands
/dx        Disk group specific commands
/fx        Foreign configuration specific commands
/px        Phy specific commands
/bbu       Battery Backup Unit related commands
Other aliases : cachecade, freespace, sysinfo
Use a combination of commands to filter the output of help further.
E.g. 'storcli cx show help' displays all the show operations on cx.
Use verbose for detailed description E.g. 'storcli add  verbose help'
Use 'page=[x]' as the last option in all the commands to set the page break.
X=lines per page. E.g. 'storcli help page=10'

Command options must be entered in the same order as displayed in the help of
the respective commands.
新しいCLIツールと聞いて薄々感づいていましたが、どうやら、tw_cliと構文がそっくりです。
3wareは、2009年にLSIに買収されたのですが、使い易いと評判だった3wareのCLIの良い部分を、既存のMegaraidのプロダクトラインでも使えるようにしたのでしょう。

コントローラの情報を表示してみます。
# /opt/MegaRAID/storcli/storcli64 show
Status Code = 0
Status = Success
Description = None
Number of Controllers = 1
Host Name = 151
Operating System  = Linux3.8.8-64kvmh01
System Overview :
===============
----------------------------------------------------------------
Ctl Model   Ports PDs DGs DNOpt VDs VNOpt BBU  sPR DS  EHS ASOs
----------------------------------------------------------------
  0 9266-8i     8   6   0     0   0     0 Msng On  1&2 Y      2
----------------------------------------------------------------
Ctl=Controller Index|DGs=Drive groups|VDs=Virtual drives|Fld=Failed
PDs=Physical drives|DNOpt=DG NotOptimal|VNOpt=VD NotOptimal|Opt=Optimal
Msng=Missing|Dgd=Degraded|NdAtn=Need Attention|Unkwn=Unknown
sPR=Scheduled Patrol Read|DS=DimmerSwitch|EHS=Emergency Hot Spare
Y=Yes|N=No|ASOs=Advanced Software Options|BBU=Battery backup unit
コントローラ0番が9266-8i であることがわかりますね。ポート数は8で、現在接続されているドライブは6本、BBUはMissing … あってます。
下の方に書いてある、説明が地味に便利ですね。

コントローラ0番の情報を、さらに詳しく見てみましょう。
# /opt/MegaRAID/storcli/storcli64 /c0 show
Controller = 0
Status = Success
Description = None
Product Name = LSI MegaRAID SAS 9266-8i
Serial Number = SV22625074
SAS Address =  500605b0050719c0
Mfg. Date = 07/03/12
System Time = 05/23/2013 02:16:39
Controller Time = 05/22/2013 17:16:38
FW Package Build = 23.9.0-0018
BIOS Version = 5.38.00_4.12.05.00_0x05180000
FW Version = 3.220.35-1998
Driver Name = megaraid_sas
Driver Version = 06.504.01.00-rc1
Controller Bus Type = N/A
PCI Slot = N/A
PCI Bus Number = 6
PCI Device Number = 0
PCI Function Number = 0
Physical Drives = 6
PD LIST :
=======
----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp
----------------------------------------------------------------------------
252:0    39 JBOD  -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:1     8 JBOD  -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:2    38 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:3     9 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:4    37 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:5    11 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 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|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

ああ、良いですね、いろんな情報とれてます。文法は、tw_cliそのまんまですね。
せっかくですので、RAIDのアレイを作ってみましょう…まずは、ヘルプを…
# /opt/MegaRAID/storcli/storcli64 add help      
     Storage Command Line Tool  Ver 1.03.11 Jan 30, 2013

     (c)Copyright 2012, LSI Corporation, All Rights Reserved.


storcli /cx add vd type=raid[0|1|5|6|00|10|50|60]
 [Size=,,..|all] [name=,..] 
 drives=e:s|e:s-x|e:s-x,y,e:s-x,y,z [PDperArray=x][SED]
 [pdcache=on|off|default][pi][DimmerSwitch(ds)=default|automatic(auto)|
 none|maximum(max)|MaximumWithoutCaching(maxnocache)][wt|wb][nora|ra]
 [direct|cached] [CachedBadBBU|NoCachedBadBBU] [cachevd]
 [Strip=<8>] [AfterVd=X] 
 [Spares = [e:]s|[e:]s-x|[e:]s-x,y] [force]
storcli /cx add vd each type=raid0 [name=,..] [drives=e:s|e:s-x|e:s-x,y]
 [SED] [pdcache=on|off|default][pi] [DimmerSwitch(ds)=default|automatic(auto)|
 none|maximum(max)|MaximumWithoutCaching(maxnocache)] [wt|wb] [nora|ra]
 [direct|cached] [CachedBadBBU|NoCachedBadBBU]
 [Strip=<8>] 
storcli /cx add vd cachecade Type = raid[0,1,10] drives = [e:]s|[e:]s-x|
 [e:]s-x,y [WT| WB] [assignvds = 0,1,2]
storcli /cx[/ex]/sx add hotsparedrive [DGs=] [enclaffinity] [nonrevertible]
なるほど… スロット2,3,4のドライブを使って、RAID5のアレイ=バーチャルドライブを作ってみます。

# /opt/MegaRAID/storcli/storcli64 /c0 add vd type=raid5  drives=252:2,252:3,252:4
Controller = 0
Status = Success
Description = Add VD Succeeded
うまくいったみたいなので、確認します。

# /opt/MegaRAID/storcli/storcli64 /c0 show
Controller = 0
Status = Success
Description = None
Product Name = LSI MegaRAID SAS 9266-8i
Serial Number = SV22625074
SAS Address =  500605b0050719c0
Mfg. Date = 07/03/12
System Time = 05/23/2013 02:36:32
Controller Time = 05/22/2013 17:36:30
FW Package Build = 23.9.0-0018
BIOS Version = 5.38.00_4.12.05.00_0x05180000
FW Version = 3.220.35-1998
Driver Name = megaraid_sas
Driver Version = 06.504.01.00-rc1
Controller Bus Type = N/A
PCI Slot = N/A
PCI Bus Number = 6
PCI Device Number = 0
PCI Function Number = 0
Drive Groups = 1
TOPOLOGY :
========
--------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT       Size PDC  PI SED DS3  FSpace
--------------------------------------------------------------------------
 0 -   -   -        -   RAID5 Optl  N  446.125 GB enbl N  N   none N    
 0 0   -   -        -   RAID5 Optl  N  446.125 GB enbl N  N   none N    
 0 0   0   252:2    38  DRIVE Onln  N  223.062 GB enbl N  N   none -    
 0 0   1   252:3    9   DRIVE Onln  N  223.062 GB enbl N  N   none -    
 0 0   2   252:4    37  DRIVE Onln  N  223.062 GB enbl N  N   none -    
--------------------------------------------------------------------------
DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present
Virtual Drives = 1
VD LIST :
=======
-----------------------------------------------------------
DG/VD TYPE  State Access Consist Cache sCC       Size Name
-----------------------------------------------------------
0/0   RAID5 Optl  RW     No      RaWTD -   446.125 GB    
-----------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|B=Blocked|Consist=Consistent|
Ra=Read Ahead Adaptive|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
Physical Drives = 6
PD LIST :
=======
----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp
----------------------------------------------------------------------------
252:0    39 JBOD  -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:1     8 JBOD  -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:2    38 Onln  0  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U

252:3     9 Onln  0  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:4    37 Onln  0  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U

252:5    11 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 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|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

ドライブグループ0番と、バーチャルドライブ0番が、今作成したRAID5のアレイ=VDです。DG=0の情報だけを見るには、次のようにします。

# /opt/MegaRAID/storcli/storcli64 /c0/d0 show
Controller = 0
Status = Success
Description = Show Diskgroup Succeeded

TOPOLOGY :
========
--------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT       Size PDC  PI SED DS3  FSpace
--------------------------------------------------------------------------
 0 -   -   -        -   RAID5 Optl  N  446.125 GB enbl N  N   none N    
 0 0   -   -        -   RAID5 Optl  N  446.125 GB enbl N  N   none N    
 0 0   0   252:2    38  DRIVE Onln  N  223.062 GB enbl N  N   none -    
 0 0   1   252:3    9   DRIVE Onln  N  223.062 GB enbl N  N   none -    
 0 0   2   252:4    37  DRIVE Onln  N  223.062 GB enbl N  N   none -    
--------------------------------------------------------------------------
DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present
VD=0の情報だけを見るには、以下のようにします。

# /opt/MegaRAID/storcli/storcli64 /c0/v0 show
Controller = 0
Status = Success
Description = None

Virtual Drives :
==============
-----------------------------------------------------------
DG/VD TYPE  State Access Consist Cache sCC       Size Name
-----------------------------------------------------------
0/0   RAID5 Optl  RW     No      RaWTD -   446.125 GB    
-----------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|B=Blocked|Consist=Consistent|
Ra=Read Ahead Adaptive|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
ライトキャッシュの設定がWTになっているので、AWBに変えてみます。
root@151:~# /opt/MegaRAID/storcli/storcli64 /c0/v0 set wrcache=AWB
Controller = 0
Status = Success
Description = None
Detailed Status :
===============
---------------------------------------
VD Property Value Status  ErrCd ErrMsg
---------------------------------------
 0 wrCache  AWB   Success     0 -    
---------------------------------------
確認は次のようにします。
root@151:~# /opt/MegaRAID/storcli/storcli64 /c0/v0 show
Controller = 0
Status = Success
Description = None

Virtual Drives :
==============
------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache  sCC       Size Name
------------------------------------------------------------
0/0   RAID5 Optl  RW     No      RaAWBD -   446.125 GB    
------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|B=Blocked|Consist=Consistent|
Ra=Read Ahead Adaptive|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
AWB Always WriteBackに変わりました。

次に、ホットスペアドライブを設定してみます。まずはヘルプで、コマンドシンタックスを確認します。
# /opt/MegaRAID/storcli/storcli64 /c0/e252/s5 add help
     Storage Command Line Tool  Ver 1.03.11 Jan 30, 2013
     (c)Copyright 2012, LSI Corporation, All Rights Reserved.

NAME: Add Hot Spare Drive
SYNTAX: storcli /cx[/ex]/sx add hotsparedrive [DGs=]
        [enclaffinity] [nonrevertible]
DESCRIPTION: This command creates a hotspare drive.
OPTIONS:
DGs          - Specifies the drive group to which the hotspare drive is
               dedicated.
enclaffinity - Specifies the enclosure to which the hotspare is associated
               with. If this option is specified, affinity is set; if it is
               not specified, there is no affinity.NOTE Affinity cannot be
               removed once it is set for a hotspare drive.
nonrevertible- Sets the drive as a nonrevertible hotspare.
CONVENTION:
/cx - specifies a controller where X is the controller index.
/ex - specifies a enclosure where X is the enclosure device ID.
/sx - specifies a physical drive where X is the slot number.

そしてスロット5番のドライブをホットスペアに設定します。
# /opt/MegaRAID/storcli/storcli64 /c0/e252/s5 add hotsparedrive
Controller = 0
Status = Success
Description = Add Hot Spare Succeeded.
確認してみます。
root@151:~# /opt/MegaRAID/storcli/storcli64 /c0/e252/s5 show
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.

Drive Information :
=================
----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp
----------------------------------------------------------------------------
252:5    11 GHS   -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 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|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
スロット5番のドライブがグローバルホットスペアになったようです。

グローバルホットスペアの機能を確認するために、今RAID5のアレイの作成に用いたドライブの内、スロット2番のドライブをオフラインにしてみます。
# /opt/MegaRAID/storcli/storcli64 /c0/e252/s2 set offline
Controller = 0
Status = Success
Description = Set Drive Offline Succeeded.
バーチャルドライブの状態を見てみます。


# /opt/MegaRAID/storcli/storcli64 /c0/v0 show all
Controller = 0
Status = Success
Description = None

/c0/v0 :
======
------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache  sCC       Size Name
------------------------------------------------------------
0/0   RAID5 Dgrd  RW     Yes     RaAWBD -   446.125 GB    
------------------------------------------------------------
Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|B=Blocked|Consist=Consistent|
Ra=Read Ahead Adaptive|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

PDs for VD 0 :
============
----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp
----------------------------------------------------------------------------
252:5    11 Rbld   0 223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:3     9 Onln   0 223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:4    37 Onln   0 223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 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|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

VD0 Properties :
==============
Strip Size = 256 KB
Span Depth = 1
Number of Drives Per Span = 3
Disk Cache Policy = Enabled
Encryption = None
Data Protection = Disabled
Active Operations = None
Exposed to OS = Yes
Creation Date = 22-05-2013
Creation Time = 05:28:54 PM
Emulation type = None
vd0はDegradedとなり、ホットスペアにしてあったスロット5番のドライブがvd0に加わり、Rebuild状態になっていることがわかります。


最後にvd0を削除してみます。
root@151:~#  /opt/MegaRAID/storcli/storcli64 /c0/v0 del        
Controller = 0
Status = Success
Description = Delete VD succeeded


#  /opt/MegaRAID/storcli/storcli64 /c0/e252/s2-5 show
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.

Drive Information :
=================
----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp
----------------------------------------------------------------------------
252:2    38 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:3     9 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:4    37 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 U
252:5    11 UGood -  223.062 GB SATA SSD N   N  512B INTEL SSDSC2CW240A3 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|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
スロット2,3,4,5のドライブが、最初の状態Unconfigured Goodに戻りました。

以上、見てきたように、StorCLIの使い方について試してみました。
3wareのtw_cliに慣れた管理者の方には、直感的で大変使い易いのではないかと思います。


参考までにStorCLIのダウンロードリンクと、リファレンスマニュアルへの直リンクを貼っておきます。
StorCLI
http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/1.03.11_StorCLI.zip
リファレンスマニュアル
http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/StorCLI_RefMan_revf_.pdf