iscsiadm とマルチパスを使用したセッションのブロック

iscsiadm とマルチパスを使用したセッションのブロック

CentOSサーバークラスタがあり、すべてiSCSI経由でNASデバイスに接続されています。私が追加する必要がある最新のNASはLenovoEMC px4-400rです。このLenovo NASでiSCSIを有効にすると、すべてのネットワークインタフェースで有効になります。 Lenovo側では、1つのネットワークインターフェースでiSCSIを無効にする方法はありません。管理ネットワークがあり、iSCSIトラフィックが必要ないため、これは問題になります。

iSCSI VLAN は 10.100.100.0/24 および 10.100.101.0/24 です。管理 VLAN は 10.50.55.0/24 です。

まず、iSCSI 検索を実行します。

# iscsiadm -m discovery -t st -p 10.100.100.16
10.100.100.16:3260,1 iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0
10.100.101.16:3260,1 iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0
10.50.55.16:3260,1 iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0

ご覧のとおり、3つのネットワークすべてでiSCSIターゲットを検索しました。正常に進み、このノードにログインすると、multipathdは3つのパスをすべて使用します。

# iscsiadm -m node -l
Logging in to [iface: default, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.50.55.16,3260] (multiple)
Logging in to [iface: default, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.100.100.16,3260] (multiple)
Logging in to [iface: default, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.100.101.16,3260] (multiple)
Login to [iface: default, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.50.55.16,3260] successful.
Login to [iface: default, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.100.100.16,3260] successful.
Login to [iface: default, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.100.101.16,3260] successful.
# multipath -ll
mpathj (35005907fe5a778fb) dm-3 SCST_FIO,lun0
size=7.2T features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=enabled
| `- 4:0:0:0  sdc 8:32  active ready running
|-+- policy='round-robin 0' prio=1 status=active
| `- 9:0:0:0  sdt 65:48 active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  `- 10:0:0:0 sdu 65:64 active ready running

multipath.confでルートをブラックリストに追加する可能性を調査しましたが、ルートをブラックリストに追加する方法はなく、デバイス全体をブラックリストに追加できます。試してみると、マルチパスはNASへのパスをまったく生成しません。

私が見つけたうまくいかない最も可能性の高い解決策は、管理ネットワークのiSCSIセッションを「手動」ログインに設定することです。私はこれをしました:

iscsiadm -m node -T iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0 -p 10.50.55.16 -o update -n node.startup -v manual

次に、セッションからログアウトし、iSCSI VLANのセッションがまだ存在することを確認します。

# iscsiadm -m node -u -T iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0 -p 10.50.55.16:3260
Logging out of session [sid: 9, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.50.55.16,3260]
Logout of [sid: 9, target: iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0, portal: 10.50.55.16,3260] successful.
# iscsiadm -m session
tcp: [10] 10.100.100.16:3260,1 iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0 (non-flash)
tcp: [11] 10.100.101.16:3260,1 iqn.2012-07.com.lenovoemc:storage.onapp-lenovo.lun0 (non-flash)

これは機能しますが、次のいずれかが発生するまで一時的にのみ機能します。

  • 私は以下を通してより多くの目標を記録しました。iscsiadm -m node -l
  • サーバーが再起動されました

同じLUNのiSCSIセッションを永久にブロックする良い方法を知っている人はいますか?

ベストアンサー1

使用できるアプローチの1つは、ファイアウォールチェーンiptablesにフィルタを追加することです(チェーンに適切に配置されています)。INPUTOUTPUT

-A INPUT -s 10.50.55.0/24 -p tcp -m tcp --sport 3260 -j DROP
-A OUTPUT -d 10.50.55.0/24 -p tcp -m -tcp --dport 3260 -j DROP

これは最小限の変更であるため、管理ネットワーク上の他のコンピュータがiSCSI LUNにアクセスするのを妨げることはありません。私がすぐに考えることができる唯一の他のアプローチは、NASの管理インターフェイスの前にブリッジサーバー/ファイアウォールを配置することです。ここで唯一のことは、そこでiSCSIトラフィックをフィルタリングすることです。

おすすめ記事