iscsi ログインの問題 - 32 ターゲットを接続できません

iscsi ログインの問題 - 32 ターゲットを接続できません

iSCSIを試しています。仮想マシンに1つのターゲットを設定し、UEFIネットワークブート用に2番目の仮想マシンを設定しました。では、initramfsターゲットにログインし、iSCSIデバイスのルートファイルシステムを使用しようとします。すべて動作します。問題は、ランチャーを仮想マシンから物理デバイスに切り替えようとするときです。ネットワークが正しく起動し、ログインした診断結果を表示できますinitramfs。仮想マシンは通常、ログインが成功したというメッセージをエクスポートしますがConnection1:0 to [target:......、物理ホストは次のメッセージを記録しますinitiator reported error (32 - target likely not connected)。サーバーに説明がないメッセージが表示されます。

変数をできるだけ減らしたと思います。 VMランチャーと物理ランチャーはどちらも、TFTP上で同じUEFI統合Linuxカーネルを実行し、同じランチャー/ターゲット情報を使用し、VMには物理ホストと同じMACもあります。 (もちろん同時には実行されません。)私が見ることができる唯一の残りの変数はネットワークの場所です。 VMのNICは、iSCSIターゲットのNICが接続されているのと同じインターフェイスに接続されます。物理ホストのネットワークカードは別のスイッチにあります。

より良いエラーが記録されていることを確認するために、iSCSIターゲットでロギングの詳細を増やす方法はありますか?または、物理ランチャーのデバッグロギングは誰にも意味がありますか?Setting login timerと/poll not conntected 0の間の時間差initiator reported errorはほぼ即時です。

aでは、tcpdump実際には、3方向ハンドシェイクが完了した直後にFINパケットをサーバーに送信するイニシエータです。それでは、iscsistartこの接続で気に入らないことは何ですか?

エラーはコードの2つの場所でのみ発生します。この通貨サイト文脈上の理解になります。このパスは 2 つの基本パスでのみ呼び出され、その 1 つは戻ってくるiscsistart.c: login_session競争条件に関するコメントがあります:(

Initcpioフック:

modprobe iscsi_tcp
# ... dhcp ...
( 
  set -x
  ip route show
  ip route get 10.0.0.86
  ping -c1 10.0.0.86
  local INITIATOR=...
  local TARGET=...
  iscsistart -d6 -i "$INITIATOR" -t "$TARGET" -g 1 -a 10.0.0.86
) 2>&1 | while IFS='' read -r line; do
  # feed output slowly so I have a chance to read it
  echo "$line"
  sleep 1
done
set +x
# ... remainder of early userspace hooks ...

物理ホスト:

...
--- 10.0.0.86 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trp min/avg/max = 146.998/146.998/146.998 ms
Logging into iqn.....
Matched transport tcp
sysfs_attr_get_value: open `/class/iscsi_transport/tcp`/`handle`
sysfs_attr_get_value: open `/class/iscsi_transport/tcp`/`caps`
Allocated session 0x....
resolved 10.0.0.86 to 10.0.0.86
setting iface default, dev , set up , hw , transport tcp
set TCP recv window size to 524280, actually got 425984
set TCP send window size to 524280, actually got 425984
connecting to 10.0.0.86:3260
Setting login timer 0x... timeout 30
poll not connected 0
initiator reported error (32 - target likely not connected)
mgmt_ipc_write_rsp: rsp to fd 8
deleting a schelded/waiting thread!
Releasing session 0x...
iscsi child done

仮想デバイス:

...
--- 10.0.0.86 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trp min/avg/max = 0.902/0.902/0.902 ms
Logging into iqn.....
Matched transport tcp
sysfs_attr_get_value: open `/class/iscsi_transport/tcp`/`handle`
sysfs_attr_get_value: open `/class/iscsi_transport/tcp`/`caps`
Allocated session 0x....
resolved 10.0.0.86 to 10.0.0.86
setting iface default, dev , set up , hw , transport tcp
set TCP recv window size to 524280, actually got 425984
set TCP send window size to 524280, actually got 425984
connecting to 10.0.0.86:3260
Setting login timer 0x... timeout 30
connected local port 39830 to 10.0.0.86:3260
expecting event 11, got 106, handling
....
Connection1:0 to [target:......
....
# system boots

サーバー(物理ホストが接続しようとした場合のみ):

rx_data returned 0, expecting 48.
iSCSI Login negotiation failed.

サーバーの tcpdump:

21:48:19.467611 IP (tos 0x0, ttl 64, id 43318, offset 0, flags [DF], proto ICMP (1), length 84)
    10.0.0.74 > 10.0.0.86: ICMP echo request, id 54272, seq 0, length 64
21:48:19.467661 IP (tos 0x0, ttl 64, id 26507, offset 0, flags [none], proto ICMP (1), length 84)
    10.0.0.86 > 10.0.0.74: ICMP echo reply, id 54272, seq 0, length 64
21:48:20.695909 IP (tos 0x0, ttl 64, id 21194, offset 0, flags [DF], proto TCP (6), length 60)
    10.0.0.74.46440 > 10.0.0.86.3260: Flags [S], cksum 0x13b8 (correct), seq 1762553309, win 65535, options [mss 1460,sackOK,TS val 3433609716 ecr 0,nop,wscale 2], length 0
21:48:20.695974 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
    10.0.0.86.3260 > 10.0.0.74.46440: Flags [S.], cksum 0x14ce (incorrect -> 0x9f88), seq 4180390614, ack 1762553310, win 65160, options [mss 1460,sackOK,TS val 2735285892 ecr 3433609716,nop,wscale 7], length 0
21:48:20.698368 IP (tos 0x0, ttl 64, id 21195, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.0.74.46440 > 10.0.0.86.3260: Flags [.], cksum 0x8c0e (correct), ack 1, win 16384, options [nop,nop,TS val 3433609923 ecr 2735285892], length 0
21:48:21.515176 IP (tos 0x0, ttl 64, id 21196, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.0.74.46440 > 10.0.0.86.3260: Flags [F.], cksum 0x88f4 (correct), seq 1, ack 1, win 16384, options [nop,nop,TS val 3433610716 ecr 2735285892], length 0
21:48:21.519590 IP (tos 0x0, ttl 64, id 17461, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.0.86.3260 > 10.0.0.74.46440: Flags [.], cksum 0x14c6 (incorrect -> 0xc3bf), ack 2, win 510, options [nop,nop,TS val 2735286715 ecr 3433610716], length 0
21:48:21.524522 IP (tos 0x0, ttl 64, id 17462, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.0.86.3260 > 10.0.0.74.46440: Flags [F.], cksum 0x14c6 (incorrect -> 0xc3b9), seq 1, ack 2, win 510, options [nop,nop,TS val 2735286720 ecr 3433610716], length 0
21:48:21.527019 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.0.74.46440 > 10.0.0.86.3260: Flags [.], cksum 0x8593 (correct), ack 2, win 16384, options [nop,nop,TS val 3433610752 ecr 2735286720], length 0

修正する:open-iscsi追加のロギングで再コンパイルし、コードを詳しく見た後、1秒のログインタイムアウトを検出する方法に問題があることは間違いないと結論付けました。すべてのアクター/タイムアウト/警告の予想されるフローに従うのは少し難しいですが、残りのログインプロセスを続行できるように、ログインタイムアウト関連コードを十分に削除しました。

動作させるための最小限の変更は、からログインタイムアウトを排除することですが、login_sessionこれがiscsistart.c実際にTCP接続のリターンに関連しているように見える実際の問題を解決することだと思いますEINPROGRESS(コードがソケットを非ブロックで明示的に設定したにもかかわらず) 。いくつかの再試行アクターは、一部のタイムアウトアクター(または親プロセス)がそれを終了する前に実行する必要がありますが、そのようなことは起こらないようです。

気づかなくていいよ今回提出してくださいファイルへの最新のコミットで、戻りコードが変更されました。まだ関係があることを証明することはできませんが、疑わしいようです。

 static int login_session(struct node_rec *rec)
 {
        iscsiadm_req_t req;
        iscsiadm_rsp_t rsp;
        int rc, msec, err;
        struct timespec ts;
 
        rc = apply_params(rec);
        if (rc)
                return rc;
 
        printf("%s: Logging into %s %s:%d,%d\n", program_name, rec->name,
                rec->conn[0].address, rec->conn[0].port,
                rec->tpgt);
        memset(&req, 0, sizeof(req));
        req.command = MGMT_IPC_SESSION_LOGIN;
        memcpy(&req.u.session.rec, rec, sizeof(*rec));
 
        /*
         * Need to handle race where iscsid proc is starting up while we are
         * trying to connect. Retry with exponential backoff, start from 50 ms.
         */
        for (msec = 50; msec <= 15000; msec <<= 1) {
-               rc = iscsid_exec_req(&req, &rsp, 0, ISCSID_REQ_TIMEOUT);
+               rc = iscsid_exec_req(&req, &rsp, 0, -1);

ベストアンサー1

おすすめ記事