RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1062841 - fail to detect the libiscsi disk in guest when assigned the configured libiscsi disk with chap authentication
Summary: fail to detect the libiscsi disk in guest when assigned the configured libisc...
Keywords:
Status: CLOSED DUPLICATE of bug 1067784
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 1062840 1067784
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-08 07:45 UTC by Sibiao Luo
Modified: 2014-02-24 05:38 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-21 18:28:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
guest_dmesg_log. (36.95 KB, text/plain)
2014-02-08 07:49 UTC, Sibiao Luo
no flags Details

Description Sibiao Luo 2014-02-08 07:45:44 UTC
Description of problem:
This bug was found during verified bug 1032358.
Configured a libiscsi disk with chap authentication in iscsi target server and iscsi initator, then assigned (scsi-hd/ide/virtio-blk interface) it to a guest with chap authentication, the libiscsi disk fail to be detected in guest correctly.
BTW, it can discover targets and logging in to the target successfully in the KVM host directly, and the disk LUN disk can be detected in the host correctly.

Version-Release number of selected component (if applicable):
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

How reproducible:
100%

Steps to Reproduce:
1. Prepare the iscsi target server:
1) On the iscsi target server, vreate file-based images and created the target by adding an XML entry to the configuration file:

# dd if=/dev/zero of=/iscsi.img bs=1M count=2000

# 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

3. Discover targets and logging in to the iSCSI target successfully in the KVM host.
# 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.

# fdisk -l 
Disk /dev/sdb: 2097 MB, 2097152000 bytes, 4096000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

# qemu-img info /dev/sdb
image: /dev/sdb
file format: raw
virtual size: 2.0G (2097152000 bytes)
disk size: 0

4. Assigned (scsi-hd/ide/virtio-blk interface) the libiscsi disk to a guest 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 -no-kvm-pit-reinjection ... -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
(qemu) info block
drive-system-disk: removable=0 io-status=ok file=/home/RHEL-7.0-20140116.1_Server_x86_64.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
drive-disk: removable=0 io-status=ok file=iscsi://10.66.9.107:3260/iqn.2008-09.com.example:server.target2/0 ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
...
5. detect the libiscsi disk in guest.
# fdisk -l
# ls -lh /dev/sd*

Actual results:
after step 5, fail to detect the libiscsi disk in guest correctly, i will attach the details guest dmesg log later.
# fdisk -l
          <---------can't find the /dev/sdb
# dmesg | grep sdb
[    0.638205] sd 3:0:0:0: [sdb] READ CAPACITY(16) failed
[    0.638535] sd 3:0:0:0: [sdb]  
[    0.639156] sd 3:0:0:0: [sdb]  
[    0.639658] sd 3:0:0:0: [sdb]  
[    0.640837] sd 3:0:0:0: [sdb] READ CAPACITY failed
[    0.641189] sd 3:0:0:0: [sdb]  
[    0.641766] sd 3:0:0:0: [sdb]  
[    0.642313] sd 3:0:0:0: [sdb]  
[    0.644085] sd 3:0:0:0: [sdb] Write Protect is off
[    0.644692] sd 3:0:0:0: [sdb] Mode Sense: 5b 00 00 00
[    0.644859] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    0.645713] sd 3:0:0:0: [sdb] READ CAPACITY(16) failed
[    0.646069] sd 3:0:0:0: [sdb]  
[    0.646642] sd 3:0:0:0: [sdb]  
[    0.647180] sd 3:0:0:0: [sdb]  
[    0.653551] sd 3:0:0:0: [sdb] READ CAPACITY failed
[    0.653928] sd 3:0:0:0: [sdb]  
[    0.654543] sd 3:0:0:0: [sdb]  
[    0.655113] sd 3:0:0:0: [sdb]  
[    0.659268] sd 3:0:0:0: [sdb] Attached SCSI disk

Expected results:
it should work well after assigned the libiscsi disk to guest.

Additional info:
# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=/home/RHEL-7.0-20140116.1_Server_x86_64.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x4 -device scsi-hd,drive=drive-system-disk,id=system-disk,bus=scsi0.0,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=00:01:02:B6:40:21,bus=pci.0,addr=0x5 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x6 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio -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

Comment 1 Sibiao Luo 2014-02-08 07:49:16 UTC
Created attachment 860844 [details]
guest_dmesg_log.

Comment 2 Sibiao Luo 2014-02-08 07:52:04 UTC
(In reply to Sibiao Luo from comment #0)
> Description of problem:
> This bug was found during verified bug 1032358.
> Configured a libiscsi disk with chap authentication in iscsi target server
> and iscsi initator, then assigned (scsi-hd/ide/virtio-blk interface) it to a
> guest with chap authentication, the libiscsi disk fail to be detected in
> guest correctly.
And if powerdown guest, the qemu monitor will prompt many block I/O error messages as following:

guest ] # poweroff

(qemu) qemu-kvm: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)
block I/O error in device 'drive-disk': Input/output error (5)
qemu-kvm: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)
block I/O error in device 'drive-disk': Input/output error (5)
qemu-kvm: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)
block I/O error in device 'drive-disk': Input/output error (5)
qemu-kvm: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)
qemu-kvm: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)
/etc/qemu-ifdown: could not launch network script

Best Regards,
sluo

Comment 3 Paolo Bonzini 2014-02-21 18:24:15 UTC
I cannot reproduce this with 

libiscsi-1.9.0-6.el7.x86_64
qemu-kvm-1.5.3-47.el7.x86_64

I suspect that you simply need to use /1 instead of /0 at the end of the iscsi URL.

Can you try installing libiscsi-utils and doing

iscsi-ls -s \
 iscsi://redhat:redhat.9.107:3260/iqn.2008-09.com.example:server.target2

Comment 4 Paolo Bonzini 2014-02-21 18:28:48 UTC

*** This bug has been marked as a duplicate of bug 1067784 ***

Comment 5 Sibiao Luo 2014-02-24 05:38:50 UTC
(In reply to Paolo Bonzini from comment #3)
> I cannot reproduce this with 
> 
> libiscsi-1.9.0-6.el7.x86_64
> qemu-kvm-1.5.3-47.el7.x86_64
> 
> I suspect that you simply need to use /1 instead of /0 at the end of the
> iscsi URL.
yes, use /1 is OK, but /0 will meet bug 1067784(qemu-kvm: block.c:850: bdrv_open_common: Assertion `bs->request_alignment != 0' failed. Aborted (core dumped)).
# uname -r && rpm -q qemu-kvm && rpm -q libiscsi
3.10.0-86.el7.x86_64
qemu-kvm-1.5.3-47.el7.x86_64
libiscsi-1.9.0-6.el7.x86_64

e.g1:...-drive file=iscsi://10.66.9.107/iqn.2008-09.com.example:server.target2/1,if=none,id=drive-data-disk,format=raw,cache=none,aio=native -iscsi id=iqn1,user=redhat,password=redhat -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-data-disk,bus=scsi1.0,id=data-disk

Above e.g1 is ok which can boot up guest successfully and detect the libiscsi disk in guest correctly.

e.g2:...-drive file=iscsi://10.66.9.107/iqn.2008-09.com.example:server.target2/0,if=none,id=drive-data-disk,format=raw,cache=none,aio=native -iscsi id=iqn1,user=redhat,password=redhat -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x7 -device scsi-hd,drive=drive-data-disk,bus=scsi1.0,id=data-disk

Above e.g2 meet bug 1067784 which qemu-kvm: block.c:850: bdrv_open_common: Assertion `bs->request_alignment != 0' failed. Aborted (core dumped).

> Can you try installing libiscsi-utils and doing
> 
> iscsi-ls -s \
>  iscsi://redhat:redhat.9.107:3260/iqn.2008-09.com.example:server.
> target2

# iscsi-ls -s iscsi://redhat:redhat.9.107:3260/iqn.2008-09.com.example:server.target2
Target:iqn.2008-09.com.example:server.target2 Portal:10.66.9.107:3260,1
Lun:0    Type:STORAGE_ARRAY_CONTROLLER
Lun:1    Type:DIRECT_ACCESS (Size:99M)
Lun:2    Type:DIRECT_ACCESS (Size:99M)


Note You need to log in before you can comment on or make changes to this bug.