我编写了一个脚本来获取最新 VirtualDisk 的 RAID 配置。
在一台服务器上我得到:
# omreport storage vdisk controller=0 -fmt ssv | awk '-F;' '/^ID/{print}/Virtual\s*Disk\s*[0-9]+;/{line=$0;value=$7}END{print line;print value}'
ID;Status;Name;State;Hot Spare Policy violated;Encrypted;Layout;Size;T10 Protection Information Status;Associated Fluid Cache State ;Device Name;Bus Protocol;Media;Read Policy;Write Policy;Cache Policy;Stripe Element Size;Disk Cache Policy
14;Ok;VirtualDisk16;Ready;Not Applicable;No;RAID-0;7,451.50 GB (8000987201536 bytes);No;Not Applicable;/dev/sdo;SAS;HDD;No Read Ahead;Write Through;Not Applicable;64 KB;Unchanged
RAID-0
#
在另一台服务器上,我得到:
# omreport storage vdisk controller=0 -fmt ssv | awk '-F;' '/^ID/{print}/Virtual\s*Disk\s*[0-9]+;/{line=$0;value=$7}END{print line;print value}'
ID;Status;Name;State;Hot Spare Policy violated;Virtual Disk Bad Blocks;Encrypted;Layout;Size;T10 Protection Information Status;Associated Fluid Cache State ;Device Name;Bus Protocol;Media;Read Policy;Write Policy;Cache Policy;Stripe Element Size;Disk Cache Policy
16;Ok;Virtual Disk 16;Ready;Not Applicable;No;No;RAID-0;3,725.50 GB (4000225165312 bytes);No;Not Applicable;/dev/sdp;SAS;HDD;Read Ahead;Force Write Back;Not Applicable;64 KB;Disabled
No
#
这两款服务器的区别在于PERC H730 Mini固件版本:
根据omreport system version
,第一个有PERC H730 Mini v25.5.2.0001
,第二个有PERC H730 Mini v25.5.0.0018
。
答案1
这可能取决于不同的omreport
固件版本。一般来说,在针对特定输出定制脚本时要小心谨慎,因为任何小的更改都可能破坏您的解析。