
iSCSI를 사용해 보고 있습니다. 가상 머신에 하나의 대상을 설정하고 UEFI 네트워크 부팅을 위해 두 번째 가상 머신을 설정했습니다. 에서는 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
이 연결에서 마음에 들지 않는 점은 무엇입니까?
오류는 코드의 두 위치에서만 발생하며이 통화 사이트문맥상 이해가 됩니다. 이 경로는 두 개의 기본 경로에서만 호출되며 그 중 하나는다시 돌아오다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);