我有一个pyTarget iSCSI目标。 我可以使用iPXE连接到目标并安装Ubuntu。 安装后,我无法启动到图像,但是。
pyTarget config.xml:
<root> <!-- configure target console --> <console ip="" port="3260" debug_level="6" /> <!-- configure the first target --> <target name="iscsi" ip="192.168.1.10" port="3260" portal="1"> <!-- the first iqn of this target configured for disk array --> <host name="iqn.2006-11.1" target_pwd="" initiator_pwd=""> <lun id="0" type="0" path="E:\pyTarget\ubuntu16.ima" capacity="81943040" /> </host> </target> </root>
pyTarget控制台在启动时:
INFO: pyTarget 1.5.7.1 2010-12-26 INFO: start iSCSI Service ... INFO: start iSNS Service ... INFO: initialize virtual device, please wait... INFO: start Http Service ... DEBUG: create target iscsi 192.168.1.10 3260 1 DEBUG: create host iqn.2006-11.1 DEBUG: target iscsi add host iqn.2006-11.1 DEBUG: Disk(E:\pyTarget\ubuntu16.ima) : initialize finish! DEBUG: host iqn.2006-11.1 add lun 0. DEBUG: configure target done INFO: initialize finish, start to run ...
安装开始时:
DEBUG: create connect INFO: initiator 192.168.1.15:38822 connect. NEGOTIATION: SessionType = Discovery NEGOTIATION: TargetName = iscsi NEGOTIATION: InitiatorName = iqn.2006-11.1 DEBUG: create session 00023d000000-0001. DEBUG: host iqn.2006-11.1 add session 00023d000000-0001. INFO: SessionID: 00023d000000-0001 DEBUG: session 00023d000000-0001 add connect 0. INFO: ConnectID: 0 NEGOTIATION: TargetPortalGroupTag = 1 NEGOTIATION: HeaderDigest = None NEGOTIATION: DataDigest = None NEGOTIATION: MaxRecvDataSegmentLength = 32768 NEGOTIATION: TargetMaxRecvdataLength = 65536 NEGOTIATION: ErrorRecoveryLevel = 0 NEGOTIATION: DefaultTime2Retain = 0 NEGOTIATION: DefaultTime2Wait = 2 NEGOTIATION: OFMarker = No NEGOTIATION: IFMarker = No DEBUG: connect 0 login finish COMMAND: Text Request DEBUG: session 00023d000000-0001 add connect 0. DEBUG: host iqn.2006-11.1 remove session 00023d000000-0001. DEBUG: destroy session 00023d000000-0001. DEBUG: connect 0 finish. DEBUG: create connect DEBUG: destroy connect 0 INFO: initiator 192.168.1.15:38824 connect. NEGOTIATION: SessionType = Discovery NEGOTIATION: TargetName = iscsi NEGOTIATION: InitiatorName = iqn.2006-11.1 DEBUG: create session 00023d000000-0002. DEBUG: host iqn.2006-11.1 add session 00023d000000-0002. INFO: SessionID: 00023d000000-0002 DEBUG: session 00023d000000-0002 add connect 0. INFO: ConnectID: 0 NEGOTIATION: TargetPortalGroupTag = 1 NEGOTIATION: HeaderDigest = None NEGOTIATION: DataDigest = None NEGOTIATION: MaxRecvDataSegmentLength = 32768 NEGOTIATION: TargetMaxRecvdataLength = 65536 NEGOTIATION: ErrorRecoveryLevel = 0 NEGOTIATION: DefaultTime2Retain = 0 NEGOTIATION: DefaultTime2Wait = 2 NEGOTIATION: OFMarker = No NEGOTIATION: IFMarker = No DEBUG: connect 0 login finish COMMAND: Text Request DEBUG: session 00023d000000-0002 add connect 0. DEBUG: host iqn.2006-11.1 remove session 00023d000000-0002. DEBUG: destroy session 00023d000000-0002. DEBUG: connect 0 finish. DEBUG: create connect DEBUG: destroy connect 0 INFO: initiator 192.168.1.15:38826 connect. NEGOTIATION: SessionType = Normal NEGOTIATION: TargetName = iscsi NEGOTIATION: InitiatorName = iqn.2006-11.1 DEBUG: create session 00023d010000-0003. DEBUG: host iqn.2006-11.1 add session 00023d010000-0003. INFO: SessionID: 00023d010000-0003 DEBUG: session 00023d010000-0003 add connect 0. INFO: ConnectID: 0 NEGOTIATION: TargetPortalGroupTag = 1 NEGOTIATION: TargetAlias = DESKTOP-54T1C9D NEGOTIATION: HeaderDigest = None NEGOTIATION: DataDigest = None NEGOTIATION: MaxRecvDataSegmentLength = 65536 NEGOTIATION: TargetMaxRecvdataLength = 65536 NEGOTIATION: ErrorRecoveryLevel = 0 NEGOTIATION: DefaultTime2Retain = 0 NEGOTIATION: DefaultTime2Wait = 2 NEGOTIATION: OFMarker = No NEGOTIATION: IFMarker = No NEGOTIATION: MaxConnections = 1 NEGOTIATION: InitialR2T = Yes NEGOTIATION: ImmediateData = Yes NEGOTIATION: DataPDUInOrder = Yes NEGOTIATION: DataSequenceInOrder = Yes NEGOTIATION: MaxOutstandingR2T = 1 NEGOTIATION: MaxBurstLength = 262144 NEGOTIATION: FirstBurstLength = 65536 DEBUG: connect 0 login finish COMMAND: SCSI Request COMMAND: Inquiry LUN:0 COMMAND: SCSI Request COMMAND: Inquiry LUN:0 COMMAND: SCSI Request
安装完成后,我尝试启动映像:
COMMAND: SCSI Request COMMAND: Write(10) LBA:0x1c40800 LEN:0x8 LUN:0 COMMAND: SCSI Request COMMAND: Write(10) LBA:0x1c40800 LEN:0x8 LUN:0 COMMAND: SCSI Request COMMAND: Write(10) LBA:0x1c40800 LEN:0x8 LUN:0 COMMAND: SCSI Request COMMAND: Write(10) LBA:0x1c40800 LEN:0x8 LUN:0 COMMAND: SCSI Request COMMAND: Write(10) LBA:0x800 LEN:0x8 LUN:0 COMMAND: SCSI Request COMMAND: Test Unit Ready LUN:0 COMMAND: SCSI Request COMMAND: Test Unit Ready LUN:0 # Install ends here # Client restarts, attempts to boot to the new install: DEBUG: create connect INFO: initiator 192.168.1.15:30733 connect. NEGOTIATION: SessionType = Normal WARNING: initiator name or target name is INVAILD iqn.2006-11.1 DEBUG: connect 0 finish.
掉到iPXEshell并尝试手动sanboot ,它吐出了额外的信息 – 这个错误 :
(Error code 3c0d61) This error originated from one of the following locations within the iPXE source code: net/tcp/iscsi.c (line 1226) This error indicates an unexpected status received from the iSCSI target.
Wireshark有以下几点:
客户端将iSCSI LOGIN命令发送到主机,值得注意的内容:
Key/Value Pairs KeyValue: InitiatorName=iqn.2006-11.1 KeyValue: TargetName=iqn.2006-11.1 KeyValue: SessionType=Normal KeyValue: AuthMethod=CHAP,None
主机返回iSCSI LOGIN响应,值得注意的内容:
Status: Missing parameter (0x0207)
这个错误代码在这个邮件列表中被简要地讨论,但是我不够明白它的意义。
我不明白目标或发起人的名字怎么会突然失效? 也不缺什么参数。 连接实际上只是在使用中,并没有在安装过程中的投诉…我甚至可以复制这一点 – 再次开始安装不是一个问题,并完成就好(再次)。 而重新安装后,当我尝试启动相同的问题!
我可以注意到的一件事是,在iSCSI或PXE中,空密码有些奇怪。 在ubuntu安装过程中,为了完成iSCSI卷的login,我必须按空格键一次 – 它不接受NULL长度的密码,即使密码在configuration中本质上是NULL。
但是,在iPXE中不能inputSPACE作为密码 – 唯一的空白空间似乎被认为是NULL。 但是,将initiator_pwd设置为非NULL不会有帮助。
现在我已经坚持了几个小时。 我在哪里从这里进行更多的故障排除?
编辑:忘了补充:
iPXEconfiguration:
#!ipxe set iscsi-target iscsi:192.168.1.10::::iqn.2006-11.1 set gateway 0.0.0.0 set initiator-iqn iqn.2007-11.1 set keep-san 1 sanboot ${iscsi-target} boot
新的config.xml
<!-- configure the first target --> <target name="iscsi" ip="192.168.1.10" port="3260" portal="1"> <!-- the first iqn of this target configured for disk array --> <host name="iqn.2006-11.1" target_pwd="1" initiator_pwd="1"> # <-- Set passwords to avoid NULL problem, this comment was not part of the actual config <lun id="0" type="0" path="E:\pyTarget\ubuntu16.ima" capacity="81943040" /> </host> </target>
脚本失败后丢弃iPXE shell:
1. dhcp 2. login username: iscsi password: 1 3. sanboot iscsi:192.168.1.10::::iqn.2006-11.1
新的数据包捕获:
iSCSI (Login Command) Opcode: Login Command (0x03) 1... .... = T: Transit to next login stage .0.. .... = C: Text is complete .... 00.. = CSG: Security negotiation (0x0) .... ..01 = NSG: Operational negotiation (0x1) VersionMax: 0x00 VersionMin: 0x00 TotalAHSLength: 0x00 DataSegmentLength: 93 (0x0000005d) ISID: 40002723b2f3 TSIH: 0x0000 InitiatorTaskTag: 0x18ae0002 CID: 0x0000 CmdSN: 0x00000000 ExpStatSN: 0x00000001 Key/Value Pairs KeyValue: InitiatorName=iqn.2007-11.1 KeyValue: TargetName=iqn.2006-11.1 KeyValue: SessionType=Normal KeyValue: AuthMethod=CHAP,None Padding: 000000 iSCSI (Login Response) Opcode: Login Response (0x23) 0... .... = T: Stay in current login stage .0.. .... = C: Text is complete .... 00.. = CSG: Security negotiation (0x0) VersionMax: 0x00 VersionActive: 0x00 TotalAHSLength: 0x00 DataSegmentLength: 0 (0x00000000) ISID: 40002723b2f3 TSIH: 0x0000 InitiatorTaskTag: 0x18ae0002 StatSN: 0x00000001 ExpCmdSN: 0x00000000 MaxCmdSN: 0x00000000 Status: Missing parameter (0x0207)
sanboot iscsi:192.168.1.10::::iscsi返回Status: Authentication failed (0x0201) wireshark中的Status: Authentication failed (0x0201)和客户端控制台中的相应操作不允许410d61 。
pyTarget控制台:
DEBUG: create connect DEBUG: destroy connect 0 INFO: initiator 192.168.1.15:1552 connect. NEGOTIATION: SessionType = Normal NEGOTIATION: TargetName = iscsi WARNING: InitiatorName %s do not exist. iqn.2007-11.1 DEBUG: connect 0 finish.
最后的错误信息翻转了指示灯。 不好意思,我倒了个名字:
在iPXE shell中:
set initiator-iqn iqn.2006-11.1 sanboot iscsi:192.168.1.10::::iscsi
现在我开机了
为了说明,iPXEconfiguration工作如下所示:
#!ipxe set iscsi-target iscsi:192.168.1.10::::iscsi set gateway 0.0.0.0 set initiator-iqn iqn.2006-11.1 set keep-san 1 sanboot ${iscsi-target} boot