Bug 1690240 - Incorrent volume size for volume > 4G in iscsi-direct pool
Summary: Incorrent volume size for volume > 4G in iscsi-direct pool
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Jiri Denemark
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-19 06:21 UTC by Han Han
Modified: 2020-11-14 07:11 UTC (History)
3 users (show)

Fixed In Version: libvirt-5.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-06 07:13:50 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:14:05 UTC

Description Han Han 2019-03-19 06:21:24 UTC
Description of problem:
As subject

Version-Release number of selected component (if applicable):
libvirt-5.0.0-7.module+el8+2887+effa3c42.x86_64
libiscsi-1.18.0-6.module+el8+2547+34fca794.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a iscsi target with lun > 4G

2. Create a iscsi-direct pool
# cat /tmp/iscsi-direct.xml                                                                                                                                             
<pool type="iscsi-direct">                                                                                                                                                 
  <name>iscsi-direct</name>                                                                                                                                                
  <source>                                                                                                                                                                 
    <host name="xxxx"/>                                                                                                            
    <device path="iqn.2019-03.org.libvirt:noauth:1"/>                                                 
    <initiator>                                    
      <iqn name='iqn.2013-06.com.example:iscsi-initiator'/>
    </initiator>                                   
  </source>
</pool>

# virsh pool-create /tmp/iscsi-direct.xml
Pool iscsi-direct created from /tmp/iscsi-direct.xml

3. List the volume size:
# virsh vol-list iscsi-direct --details
 Name         Path                                                                                                Type      Capacity   Allocation
---------------------------------------------------------------------------------------------------------------------------------------------------
 unit:0:0:1   ip-vm-10-0-77-62.hosted.upshift.rdu2.redhat.com:3260-iscsi-iqn.2019-03.org.libvirt:noauth:1-lun-1   network   4.00 GiB   4.00 GiB


Actual results:
As above

Expected results:
Get the actual size.

Additional info:
upstream commit:
commit 5de5432e34e097fde32b2b1ad96b8b8b1186dec1
Author: Jiri Denemark <jdenemar>
Date: Thu Feb 28 15:12:31 2019 +0100

storage: Fix iscsi-direct volume size for volumes > 4GiB

Both block_size and nb_block are unit32_t and multiplying them overflows
at 4GiB.

Moreover, the iscsi_10_ APIs use 32bit number of blocks and thus they
can only address images up to 2TiB with 512B blocks. Let's use 64b
iscsi_16_ APIs instead.

Signed-off-by: Jiri Denemark <jdenemar>

commit bf5cf610f206d5d54914e8f8b0764b2b37ddf50c
Author: Michal Privoznik <mprivozn>
Date: Thu Feb 28 15:08:19 2019 +0100

Comment 2 Meina Li 2019-06-26 08:47:23 UTC
Verified Version:

libvirt-5.4.0-1.module+el8.1.0+3304+7eb41d5f.x86_64
qemu-kvm-4.0.0-4.module+el8.1.0+3356+cda7f1ee.x86_64
kernel-4.18.0-107.el8.x86_64

Verified Steps:

1. Prepare a iscsi target with lun > 4G.
# qemu-img info iscsi://**IP*/iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2/0
image: json:{"driver": "raw", "file": {"lun": "0", "portal": "**IP**", "driver": "iscsi", "transport": "tcp", "target": "iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2"}}
file format: raw
virtual size: 30G (32212254720 bytes)
disk size: unavailable

2. Prepare a related pool xml.
# cat iscsi-direct.pool
<pool type='iscsi-direct'>
  <name>iscsi-direct</name>
  <source>
    <host name='**IP**' port='3260'/>
    <device path='iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2'/>
 <initiator>                                    
      <iqn name='iqn.2013-06.com.example:iscsi-initiator'/>
    </initiator>                                   
  </source>
</pool>

3. Create a iscsi-direct pool.
# virsh pool-create iscsi-direct.pool 
Pool iscsi-direct created from iscsi-direct.pool

4. Check vol info.
# virsh vol-list iscsi-direct --details 
 Name         Path                                                                                     Type      Capacity     Allocation
------------------------------------------------------------------------------------------------------------------------------------------
 unit:0:0:0   ip-**IP**:3260-iscsi-iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2-lun-0   network   30.00 GiB    30.00 GiB

# virsh vol-info unit:0:0:0 iscsi-direct 
Name:           unit:0:0:0
Type:           network
Capacity:       30.00 GiB
Allocation:     30.00 GiB

So move this bug to be verified.

Comment 4 errata-xmlrpc 2019-11-06 07:13:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3723


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