背景
私のインフラストラクチャには、とりわけ、3つのESXi 5.5サーバーがあり、QLogic QLA200アダプターを使用して、HP StorageWorks 2 / 8qスイッチを介して、光学経由でHP MSA1000 SAN(すでに10年前の鉄)に接続されています。 もちろん、ストレージは非常に生産的ですが、ボリュームも非常に控えめです。 仮想化は現在の傾向であるため、ブロックアクセスを備えた光学系を介して接続された、非常に大規模なストレージを取得することが非常に望まれていました。 なぜそれがブロック状であるのかは説明しません-このトピックのホリバーはノアの箱舟から始まりましたが、これはこの記事の主題には当てはまりません。 よくあることですが、予算ではブランドソリューションを購入することすらできないため、「クレイジーハンド」プログラムのヒーローにしかなれません。
それほど長くない研究の結果、SCSTの目標は次の理由で選ばれました。
- 高性能
- 安定性
- Centos(Linuxサーバーの標準)にインストールする機能
- QLogic FCアダプターのサポート
- VAAIサポート
次に、ハードウェアをピックアップする必要がありました。 ビンでは、6個のバスケットを備えた2Uサーバー、4個の3TBドライブ(下位のもの、2個はWD Green)、QLogic 2460 FCアダプター( SCSTはQLogic 22xx / 23xx / 24xx / 25xx / 26xxアダプターをサポート )が見つかりました 。
Centos 7 + FC SCSTバンドルの既製のマニュアルを検索しても何も得られなかったので、かなり長い間情報を1つずつ収集する必要がありました。 その結果、すべてが判明し、新しいディスクを購入する準備ができて満足しています。
アクション
Centos 7のインストールと基本構成は、最小アセンブリで実行します(これは私の好みです。任意のアセンブリをインストールできます)。 誰もが独自の「基本設定」を持っているので、詳細には触れません。 更新することを忘れないでください:
[root@localhost ~]# yum update -y [root@localhost ~]# reboot
FCアダプターの名前とそのRISC IDを確認します。
[root@localhost ~]# dmesg | grep -E 'qla2xxx .* QLogic | Found an ISP'
次のようなものが得られます。
[ 1.881084] qla2xxx [0000:05:04.0]-001d: Found an ISP2422 irq 24 iobase 0xffffc90001e06000. [ 2.901460] qla2xxx [0000:05:04.0]-00fb:1: QLogic QLA2460 - PCI-X 2.0 Single Channel 4Gb Fibre Channel HBA.
RISC IDはISP2422で、モデルはQLogic QLA2460です。
次に、 ここから QConvergeConsoleCLIユーティリティとアダプターの最新ファームウェアをダウンロードしてインストールする必要があります 。 .BINファームウェアファイルを抽出し、RISC IDに従って名前を変更し(下の表を参照)、サーバーの/ lib / firmwareに配置します。 ほとんどの場合、すでにそのようなファイルがあるので、既存のファイルを置き換えるだけです。
RISC ID-ファームウェア
ISP 21XX-ql2100_fw.bin
ISP 22XX-ql2200_fw.bin
ISP 2300-ql2300_fw.bin
ISP 2322-ql2322_fw.bin
ISP 24XX-ql2400_fw.bin
ISP 25XX-ql2500_fw.bin
ISP 2031-ql2600_fw.bin
ISP 27XX-ql2700_fw.bin
私の場合、ql2400_fw.bin
アダプターのファームウェアの更新:
[root@localhost ~]# /opt/QLogic_Corporation/QConvergeConsoleCLI/qaucli -fc -b all /lib/firmware/ql2400_fw.bin
最新のドライバーQLogic SCSTをダウンロードします。
[root@localhost ~]# yum install git -y [root@localhost ~]# git clone git://git.QLogic.com/scst-qla2xxx.git
カーネルの後続のアセンブリとsvnに必要なパッケージをインストールします。
[root@localhost ~]#yum install gcc ncurses-devel kernel-devel lsscsi patch subversion bc bison net-tools -y
SCSTソースをダウンロードします。
[root@localhost ~]# cd / [root@localhost /]# svn co https://svn.code.sf.net/p/scst/svn/trunk scst
SCSTディレクトリで、QLogic SCSTドライバーへのソフトリンクを作成します。
[root@localhost /]# cd scst [root@localhost scst]# ln -s ../scst-qla2xxx/drivers/scsi/qla2xxx qla2x00t_git
さらに、SCST開発者の推奨に従って、カーネルにパッチを適用する必要があります。
新しいユーザー環境で新しいカーネルをアセンブルします。
[root@localhost /]# useradd builder
パスワードなしでyumおよびyum-builddepを使用する権利を付与します。
[root@localhost /]# echo 'builder ALL=(ALL) NOPASSWD: /usr/bin/yum, /usr/bin/yum-builddep' >>/etc/sudoers [root@localhost /]# visudo –sc
新しいユーザー環境に移動します。
[root@centos-test /]# su builder
開発者によって用意されたスクリプトを起動します。
[builder@localhost /]# ./scst/scripts/rebuild-rhel-kernel-rpm
新しいカーネルをインストールします。
[builder@localhost /]$ su -c 'rpm -ivh --force /home/builder/rpmbuild/RPMS/x86_64/kernel-*.rpm'
再起動:
[builder@localhost /]$ su –c reboot
現在のカーネルを確認します。
[root@localhost ~]# uname -r 3.10.0-229.el7.centos.scst.x86_64
すべて問題なければ、先に進みます。 デフォルトのqla2xxxカーネルモジュールをアンロードしてブラックリストに追加します。
[root@localhost /]# echo blacklist qla2xxx >/etc/modprobe.d/blacklist-qla2xxx.conf [root@localhost /]# rmmod qla2xxx
SCSTビルドモードをリリースに設定します。
[root@localhost /]# cd /scst [root@localhost scst]# make 2release
必要なカーネルモジュールを収集しましょう。
[root@localhost scst]# BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y make all install
すべてがうまくいったことを確認します。
[root@localhost ~]# ls -l /lib/modules/`uname -r`/extra/qla2* -rw-r--r-- 1 root root 1511833 Sep 10 11:10 /lib/modules/3.10.0-229.11.1.el7.centos.scst.x86_64/extra/qla2x00tgt.ko -rw-r--r-- 1 root root 10699423 Sep 10 11:10 /lib/modules/3.10.0-229.11.1.el7.centos.scst.x86_64/extra/qla2xxx_scst.ko
インストールされているモジュールの完全なリストを確認できます。
[root@localhost ~]# ls -l /lib/modules/`uname -r`/extra total 25128 drwxr-xr-x 2 root root 4096 Sep 10 11:10 dev_handlers -rw-r--r-- 1 root root 4309043 Sep 10 11:10 iscsi-scst.ko -rw-r--r-- 1 root root 3100544 Sep 10 11:10 isert-scst.ko -rw-r--r-- 1 root root 1511833 Sep 10 11:10 qla2x00tgt.ko -rw-r--r-- 1 root root 10699423 Sep 10 11:10 qla2xxx_scst.ko -rw-r--r-- 1 root root 5619115 Sep 10 11:10 scst.ko -rw-r--r-- 1 root root 474173 Sep 10 11:10 scst_local.ko
[root@localhost ~]# ls -l /lib/modules/`uname -r`/extra/dev_handlers total 3960 -rw-r--r-- 1 root root 305582 Sep 10 11:10 scst_cdrom.ko -rw-r--r-- 1 root root 292948 Sep 10 11:10 scst_changer.ko -rw-r--r-- 1 root root 328092 Sep 10 11:10 scst_disk.ko -rw-r--r-- 1 root root 308934 Sep 10 11:10 scst_modisk.ko -rw-r--r-- 1 root root 292972 Sep 10 11:10 scst_processor.ko -rw-r--r-- 1 root root 292876 Sep 10 11:10 scst_raid.ko -rw-r--r-- 1 root root 312024 Sep 10 11:10 scst_tape.ko -rw-r--r-- 1 root root 704076 Sep 10 11:10 scst_user.ko -rw-r--r-- 1 root root 1199482 Sep 10 11:10 scst_vdisk.ko
それらをすべてカーネルに追加します。
[root@localhost ~]# for m in scst qla2xxx_scst qla2x00tgt scst_vdisk scst_user scst_disk ...; do modprobe $m; done
このようなものがdmesgに表示されるはずです(バージョンから例を示します)。
[10753.981044] [21513]: scst: SCST version 3.1.0-pre1 loaded successfully (max mem for commands 709MB, per device 283MB) [10753.981051] [21513]: scst: Enabled features: TRACING [10753.982152] [21519]: scst: Management thread started [10754.024379] qla2xxx [0000:00:00.0]-0005: QLogic Fibre Channel HBA Driver: 8.04.00.05.2.2-SCST.03-kp. [10754.030864] [21527]: qla2x00t: Initializing QLogic Fibre Channel HBA Driver target mode addon version 3.1.0-pre1 [10754.032397] [21527]: qla2x00t: Target mode driver for QLogic 2x00 controller registered successfully [10754.032409] [21527]: scst: Target template qla2x00t registered successfully [10754.038638] [21528]: scst: Virtual device handler vdisk_fileio for type 0 registered successfully [10754.038647] [21528]: scst: Virtual device handler vdisk_blockio for type 0 registered successfully [10754.038653] [21528]: scst: Virtual device handler vdisk_nullio for type 0 registered successfully [10754.038658] [21528]: scst: Virtual device handler vcdrom for type 5 registered successfully [10754.044786] [21529]: scst: Virtual device handler "scst_user" registered successfully [10754.048905] [21530]: scst_user: Cleanup thread started [10754.052682] [21531]: scst: Device handler "dev_disk" for type 0 registered successfully [10754.052691] [21531]: scst: Device handler "dev_disk_perf" for type 0 registered successfully
qla2xxxカーネルモジュールがqla2xxx_scstで置き換えられるように、初期初期化(initrd)のためにRAMディスクを再構築します。
[root@localhost ~]# mkinitrd -f /boot/initramfs-`uname -r`.img `uname -r`
scstadminをインストールします。
[root@localhost /]# cd scst [root@localhost scst]# make -C scstadmin -s install
次に、ファイル/etc/scst.confを作成する必要があります。私の例を示します。
HANDLER vdisk_blockio { DEVICE disk1 { filename /dev/sdb } } TARGET_DRIVER qla2x00t { TARGET ::::::: { enabled 1 LUN 0 disk1 } }
説明:
HANDLER vdisk_blockio-ハンドラーの選択。私の場合、ブロックアクセスが必要でした。ファイルアクセスが必要な場合は、vdisk_fileioがあります。
ファイル名/ dev / sdb-ターゲットのディスク
ターゲットXX:XX:XX:XX:XX:XX:XX:XX:XX-Xの代わりに、FCアダプターのWWNを入力します
WWNを確認できるコマンドの例:
cat /sys/class/scsi_host/host*/device/fc_host/host*/node_name
構成ファイルを使用します。
[root@localhost scst]# scstadmin -config /etc/scst.conf Collecting current configuration: done. -> Checking configuration file '/etc/scst.conf ' for errors. -> Done, 0 warnings found. -> Opening device 'disk1' using handler 'vdisk_blockio': done. -> Adding device 'disk1' at LUN 0 to driver/target 'qla2x00t/:::::::': done. -> Enabling driver/target 'qla2x00t/:::::::': done. All done.
さて、おそらくターゲットがリロードされると、この全体が自動的に開始するようにしたいでしょう。
SCST自体の自動起動をオンにします。
[root@localhost /]# systemctl enable scst.service
起動にカーネルモジュールを追加します。
[root@localhost /]# vi /etc/modules-load.d/scst_modules.conf scst_disk scst_user scst_vdisk scst libcrc32c crc_t10dif qla2x00tgt
最後に、構成のアプリケーションをrc.localに追加します。
[root@localhost /]# chmod +x /etc/rc.d/rc.local [root@localhost /]# vi /etc/rc.d/rc.local scstadmin –config /etc/scst.conf
すべてが正しく行われた場合、サーバーを再起動した後、次を実行します:
[root@localhost ~]# scstadmin -config /etc/scst.conf
次のようになります:
Collecting current configuration: done. -> Checking configuration file '/etc/scst.conf' for errors. -> Done, 0 warnings found. -> Applying configuration. -> Done, 0 change(s) made. All done.
これでターゲット設定が完了しました。 以下にいくつかの便利なメモを示します。
重要! FCスイッチが使用されている場合は、FCスイッチでゾーニングを構成することを忘れないでください。そうしないと、イニシエーターに新しいターゲットが表示されません。
また、ESXiの場合、ターゲットを設定した後、およびその再起動の場合、すべての開始ホストを再起動する必要があります。そうしないと、ドライブが取得されません。
それでもこのような小さなパフォーマンスノート。 CentOS 7では、fioを使用して、iodepth = 1でレコードあたり84 iopsと平均レイテンシー12ミリ秒を測定しました。 これは、実際にはWD Greenにとって悪くありません。
2016年10月5日更新! 自分の記事に従ってターゲットを上げるつもりでしたが、カーネルパッチ中にエラーが発生しました:カーネルバージョンに一致するput_page_callbackパッチが見つかりませんでした。
SCSTによって開発されたため、最新バージョン3.3でカーネルにパッチを適用する必要がなくなりました。 そのため、カーネルの再構築に関するセクションはスキップできますが、代わりに次の手順を実行してください。
[root @ localhost scst]の後#ln -s ../scst-qla2xxx/drivers/scsi/qla2xxx qla2x00t_git:
[root @ localhost scst] yum isntall -y bzip2 rpm-build
[root @ localhost scst] make rpm
その過程で、特定のPerlモジュールの欠如に関連するエラーが表示される可能性が高くなります。それをグーグル検索する必要があり、すぐに最初のページに解決策があります。
その後、RPMをインストールし、このポイントから続行します。
[root @ localhost /]#echo blacklist qla2xxx> /etc/modprobe.d/blacklist-qla2xxx.conf