LoginSignup
3
2

More than 5 years have passed since last update.

Solaris 11.3 で OpenSM 3.3.20 を動かす

Posted at

Solaris 同士で直結 IP over IB やりたかっただけなんです。

InfiniBand switch を用意してしまえば必要のない話だけど、直結する場合には必要。
Solaris 同士の直結だと、OpenSM が動くかどうかから確認しないとなので、さらに必要。。

OpenSM について

ひとまず、OpenSM 部分の参考に:

Solaris で動く OpenSM あるの?

あります。

2011/3 には、Oracle Solaris にバンドルされる FOSS 周りを集めた solaris-userland repository で opensm-3.3.9 のパッチが公開されていたが、結局、OpenSM 自体は含まれなかった。
2016/4 に OFED 3.18 へアップデートされ、opensm-3.3.19 のパッチとしてアップデートされている。

PSARC/2016/109 Solaris OFED (OFUV) Version 3.18 and other updates

solaris-userland repository の opensm 関連は、下記:

その中に含まれる Solaris で build するために必要なパッチ:

ということで、上記のパッチを適用し、opensm をビルドする必要がある。

作業の流れ

必要なもの

opensm-3.3.19 のパッチと、opensm-3.3.20 のアーカイブを入手。(opensm-3.3.20 に適用可能)

ビルド手順

本稿では、/opt/sfw/opensm ディレクトリにインストールする:

$ wget https://raw.githubusercontent.com/oracle/solaris-userland/master/components/open-fabrics/opensm/patches/001-opensm-solaris_port.patch
$ wget https://www.openfabrics.org/downloads/management/opensm-3.3.20.tar.gz
$ gtar xvzf opensm-3.3.20.tar.gz
$ cd opensm-3.3.20
$ gpatch -p1 < ../001-opensm-solaris_port.patch
$ ./configure --prefix=/opt/sfw/opensm CFLAGS="-std=gnu99" LIBS="-libverbs -lsocket -lnsl -libumad -libmad"
$ gmake
$ sudo gmake install

下記のバイナリが手に入る:

  • /opt/sfw/opensm/sbin/opensm
  • /opt/sfw/opensm/sbin/osmtest (※ 必要であれば)

OpenSM を起動させるために

opensm を動作させるために、最低限の構成ファイルを準備する。

  • opensm.conf の作成
  • partitions.conf の作成

参考: 9.4. サブネットマネジャーの設定

partitions.conf の作成

partitions (PKeys) を設定する場合は、partitions.conf を事前に作成しておく必要がある。

partitions.conf 周りのお話は下記を参考に:

ここでは、0xffff を default として、0x8001 と 0x8002 も必要であれば作成できるよう追加された partition.conf/opt/sfw/opensm-3.3.20/etc/ に作成する。
この情報が設定されていないと、dladm create-part で PKEY を設定したパーティションが作成できないので注意。

作成された /opt/sfw/opensm/etc/partitions.conf:

Default=0xffff,ipoib: ALL=full;    # index 0
Web=0x8001,ipoib: ALL=full;        # index 1
Storage=0x8002,ipoib: ALL=full;    # index 2

opensm.conf の作成

opensm.conf の雛形は、opensm コマンドを下記のように実行すると作成可能:

# /opt/sfw/opensm/sbin/opensm --create-config /opt/sfw/opensm/etc/opensm.conf
-------------------------------------------------
OpenSM 3.3.20
Command Line Arguments:
 Creating config file template '/opt/sfw/opensm/etc/opensm.conf'.
 Log File: /var/log/opensm.log
-------------------------------------------------

参考: Create the opensm.conf File - Sun Datacenter InfiniBand Switch 72

partitions.conf を指定する

partition を利用するために、opensm.confpartition_config_file を下記のように設定する:

partition_config_file /opt/sfw/opensm/etc/partitions.conf

OpenSM の起動

利用したいポートを指定し手動で実行する:

# /opt/sfw/opensm/sbin/opensm -B -F /opt/sfw/opensm/etc/opensm.conf -g 0x00212800013f2dd8
-------------------------------------------------
OpenSM 3.3.20
Config file is `/opt/sfw/opensm/etc/opensm.conf`:
 Reading Cached Option File: /opt/sfw/opensm/etc/opensm.conf
 Loading Cached Option:partition_config_file = /opt/sfw/opensm-3.3.20/etc/partitions.conf
Command Line Arguments:
 Daemon mode
 Guid <0x212800013f2dd8>
 Log File: /var/log/opensm.log
-------------------------------------------------

実行時のログには、default 構成から変更された内容が表示される。

注: 同一 subnet の同じマシン上に複数の port/HCA が搭載された状態で OpenSM を動かす場合は、その port/HCA 毎に OpenSM インスタンスを起動する必要がある。複数ポートで異なる Subnet を作成する場合も同じ

OpenSM の自動起動

SMF 化したいが、manifest を書けていないので省略

OpenSM の log 管理について

ログファイルも結構大きくなるので、opensm.conf の下記設定で調整は必要:

# Log file to be used
log_file /var/log/opensm.log

# Limit the size of the log file in MB. If overrun, log is restarted
log_max_size 0

その他

ネットワークスキャン (sweep) の無効化

デバイスを変更しないネットワークでは、ネットワークスキャン(sweep)を無効にできるので、opensm.conf に下記のような設定をするといいよとある。。。(default: 10)

sweep_interval 0

guid.txt について

InfiniBand ファブリックで Fat Tree ルーティングアルゴリズムを使用する場合は、Subnet Manager のルートノード GUID ファイルを用意する必要があるとのことだけど、いまの環境に必要ないようなきがするのでメモだけ。

opensm.conf に下記を追加する:

root_guid_file /opt/sfw/opensm/etc/guid.txt
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2