Bug 1032358

Summary: Failed to create a guest with iscsi network disk with chap authentication.
Product: Red Hat Enterprise Linux 7 Reporter: chhu
Component: libiscsiAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, ajia, bili, chhu, dyuan, juzhang, knoel, mrezanin, mzhan, pbonzini, shyu, sluo
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libiscsi-1.9.0-5.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:55:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Comment 3 John Ferlan 2013-12-11 21:23:12 UTC
I'm not quite sure what's wrong here as last I knew this was working and I don't see a recent libvirt rhel7 change in this area.... It seems as though you've set everything up similarly to bz 957294 and 957295 - perhaps my eyes are deceiving me, but it worked there.

I'm trying to use Beaker to get access to a RHEL7 system as I have f19 and f20 installed on systems I can access.  The f19 system doesn't have the right qemu version and the f20 system with qemu 1.5.1, libiscsi 1.9.0-4, and libvirt 1.1.3.1-2 is busy right now installing an f20 guest over the network using an iSCSI target.

Couple of notes from what was provided:

1. Your '/etc/tgt/targets.conf' lists "direct-store", while mine has "backing-store".  Perhaps that's just a nuance of using me using local file storage rather than a whole partition 


2. Step 6 in comment 2 shows "<host name="ipaddress" port="3260"/>", I assume you really put the real IP Address in place of "ipaddress"...


One thing that sticks out to me is the error message - that doesn't come from libvirt.  It comes from within qemu (perhaps block.c from what I can tell from a quick look at the sources).  The concern here is the garbage characters, as if something has already been free'd or it's referencing a complete bad part of memory.

I added a needinfo from Paolo just to be sure there's nothing that perhaps changed here from the qemu side.

Comment 6 EricLee 2013-12-12 07:36:53 UTC
Oh, sorry for clear the needinfo? for Paolo, re-needinfoing.

Comment 12 Sibiao Luo 2014-02-08 07:03:55 UTC
Reproduce this issue on libiscsi-1.9.0-4.el7.x86_64 with the same steps as comment #0.

host info:
3.10.0-76.el7.x86_64
qemu-kvm-1.5.3-38.el7.x86_64
libiscsi-1.9.0-4.el7.x86_64
guest info:
3.10.0-76.el7.x86_64

Steps:
1. Prepare the iscsi target server:
1) On the iscsi target server, created the target by adding an XML entry to the configuration file:

# vim /etc/tgt/targets.conf
<target iqn.2008-09.com.example:server.target2>
    backing-store /iscsi.img
    incominguser redhat redhat
</target>

# service tgtd restart
# tgt-admin --show
Target 1: iqn.2008-09.com.example:server.target2
    System information:
        Driver: iscsi
        State: ready
...
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 2097 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /iscsi.img
            Backing store flags: 
    Account information:
        redhat
    ACL information:
        ALL

2. Prepare the iscsi initator:

# vim /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
node.session.auth.username = redhat
node.session.auth.password = redhat

# service iscsid restart

# iscsiadm --mode discovery --type sendtargets --portal 10.66.9.107 –discover
10.66.9.107:3260,1 iqn.2008-09.com.example:server.target2

# iscsiadm -m node -T iqn.2008-09.com.example:server.target2 -p 10.66.9.107 -l
Logging in to [iface: default, target: iqn.2008-09.com.example:server.target2, portal: 10.66.9.107,3260] (multiple)
Login to [iface: default, target: iqn.2008-09.com.example:server.target2, portal: 10.66.9.107,3260] successful.

# iscsiadm -m node -T iqn.2008-09.com.example:server.target2 -p 10.66.9.107 --logout
Logging out of session [sid: 5, target: iqn.2008-09.com.example:server.target2, portal: 10.66.9.107,3260]
Logout of [sid: 5, target: iqn.2008-09.com.example:server.target2, portal: 10.66.9.107,3260] successful.

3. Boot a guest assigned this libiscsi disk with chap authentication.
e.g:/usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1...-drive file=iscsi://10.66.9.107:3260/iqn.2008-09.com.example:server.target2/0,if=none,id=drive-disk,cache=none,format=raw -iscsi user=redhat,password=redhat,id=iqn -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-disk,bus=scsi1.0,id=iscsi-disk

Results:
after step 3, qemu will quit with following message:
qemu-kvm: -drive file=iscsi://10.66.9.107:3260/iqn.2008-09.com.example:server.target2/0,if=none,id=drive-disk,cache=none,format=raw: iSCSI: Failed to connect to LUN : iscsi_service failed with : iscsi login reply failed
qemu-kvm: -drive file=iscsi://10.66.9.107:3260/iqn.2008-09.com.example:server.target2/0,if=none,id=drive-disk,cache=none,format=raw: could not open disk image iscsi://10.66.9.107:3260/iqn.2008-09.com.example:server.target2/0: Could not open '�0��~': Invalid argument
/etc/qemu-ifdown: could not launch network script

Comment 13 Sibiao Luo 2014-02-08 07:57:23 UTC
Verified this issue with the same steps as comment #12 on 
libiscsi-1.9.0-6.el7.x86_64.
It did not meet 'Could not open '�0��~': Invalid argument' any more, but it hit anther two new issue, i has separated them to new bug 1062840 and bug 1062841.

host info:
3.10.0-76.el7.x86_64
qemu-kvm-1.5.3-45.el7.x86_64
libiscsi-1.9.0-6.el7.x86_64
guest info:
3.10.0-76.el7.x86_64

Base on above, this issue has been fixed correctly, set this bug to VERIFIED status, please correctly me if any mistakes.

Best Regards,
sluo

Comment 14 Ludek Smid 2014-06-13 12:55:10 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.