Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 894233

Summary: Virt-manager on RHEL7 cannot detect SCSI storage correctly
Product: Red Hat Enterprise Linux 7 Reporter: Geyang Kong <gkong>
Component: virt-managerAssignee: Martin Kletzander <mkletzan>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, cwei, dallan, lcui, mjenner, mkletzan, mzhan, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-manager-0.10.0-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 902143 (view as bug list) Environment:
Last Closed: 2014-06-13 10:48:33 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 902143    
Attachments:
Description Flags
Screenshot on RHEL6u4 none

Description Geyang Kong 2013-01-11 06:11:37 UTC
Description of problem:
  Virt-manager on RHEL7 cannot detect SCSI storage correctly

Version-Release number of selected component (if applicable):
virt-manager-0.9.4-3.el7.noarch
libvirt-1.0.0-1.el7.x86_64

Reproduce steps:
1. Start virt-manager --debug
2. Edit->Connection Details->Click '+'->Slect SCSI
3. Following the wizard until finish, just keeping default settings

Actual results:
1. In terminal, it said pool was created successfully, but cannot find the pool on GUI, must restart virt-manager to find it.
2. After restarting virt-manager, find the pool is 0.00MB Free/0.00 MB In use, and cannot use this pool, but same steps work well on RHEL6u4

Expected results:
1. Could find pool on GUI immediately after creating it.
2. Detect space of storage correctly. 

Additional info:

Comment 2 Martin Kletzander 2013-02-06 11:22:00 UTC
Could you try reproducing that on both 6.4 and 7.0 with these additions:
 1. check which 'host' is selected when creating the pool
 2. do 'ls /sys/bus/scsi/devices/'
 3. after creating the pool, wait few seconds before checking if the pool has appeared in the list

Thanks

Comment 3 tingting zheng 2013-02-07 03:12:56 UTC
(In reply to comment #2)
> Could you try reproducing that on both 6.4 and 7.0 with these additions:
>  1. check which 'host' is selected when creating the pool
>  2. do 'ls /sys/bus/scsi/devices/'
>  3. after creating the pool, wait few seconds before checking if the pool
> has appeared in the list
> 
> Thanks

Hi,Martin
The issue also exists on rhel6,refer to bug 902143.
Tried on rhel6 tree and rhel7,the same result.
version on rhel7:
virt-manager-0.9.4-4.el7.noarch
libvirt-1.0.2-1.el7.x86_64

Now,after creating scsi pool,the pool can be showed immediately from GUI,but can not use the pool,the pool is 0.00MB Free/0.00 MB In use,which is mentioned in Actual results 2.

Reproduce refer to your steps(I think since the pool can appear in the list,would these steps help to you?just paste here)
1.When creating the pool,choose host0.
2.#ls /sys/bus/scsi/devices/
0:0:0:0  1:0:0:0  2:0:0:0  host0  host1  host2  host3  host4  host5  target0:0:0  target1:0:0  target2:0:0

Comment 4 Martin Kletzander 2013-02-08 12:12:49 UTC
(In reply to comment #3)
The pool size is being dealt with in libvirt.  Specifying the same 'host0' doesn't necessarily mean there are the same devices (the host id allocation can change) IIUC.  You'd have to check the target in the 'host0', '/sys/bus/scsi/devices/0:0:0:0' in this case.  What do you expect to be the storage size and allocation?

Comment 5 Geyang Kong 2013-02-16 03:29:49 UTC
(In reply to comment #4)
> (In reply to comment #3)
> The pool size is being dealt with in libvirt.  Specifying the same 'host0'
> doesn't necessarily mean there are the same devices (the host id allocation
> can change) IIUC.  You'd have to check the target in the 'host0',
> '/sys/bus/scsi/devices/0:0:0:0' in this case.  What do you expect to be the
> storage size and allocation?

On rhel6u4-SNAP1, after creating a SCSI pool, it shows 0.00 MB Free/465.76 GB In Use, and there is a volume in the pool. Then if I want to install a guest, I can use that volume(You can check the screen shot). But on RHEL7, there is nothing in the pool so cannot use it.

On el7, I got following output in /sys/bus/scsi/devices:
[root@dhcp-66-71-159 devices]# ls host0
firmware_node  power  scsi_host  subsystem  target0:0:0  target0:0:1  uevent
[root@dhcp-66-71-159 devices]# ls
0:0:0:0  0:0:1:0  host0  host1  host2  host3  target0:0:0  target0:0:1
[root@dhcp-66-71-159 devices]# ls 0\:0\:0\:0/
block             firmware_node  model        scsi_disk     uevent
bsg               generic        power        scsi_generic  unload_heads
delete            iocounterbits  queue_depth  scsi_level    vendor
device_blocked    iodone_cnt     queue_type   state
dh_state          ioerr_cnt      rescan       subsystem
driver            iorequest_cnt  rev          timeout
evt_media_change  modalias       scsi_device  type

On el6, output is below:
[root@dhcp-66-71-159 devices]# ls
0:0:0:0  0:0:1:0  host0  host1  host2  host3  target0:0:0  target0:0:1
[root@dhcp-66-71-159 devices]# ls host0
power  scsi_host  subsystem  target0:0:0  target0:0:1  uevent
[root@dhcp-66-71-159 devices]# ls 0\:0\:0\:0/
block           evt_media_change  modalias     rev           subsystem
bsg             generic           model        scsi_device   timeout
delete          iocounterbits     power        scsi_disk     type
device_blocked  iodone_cnt        queue_depth  scsi_generic  uevent
dh_state        ioerr_cnt         queue_type   scsi_level    unload_heads
driver          iorequest_cnt     rescan       state         vendor

Comment 6 Geyang Kong 2013-02-16 03:30:51 UTC
Created attachment 698068 [details]
Screenshot on RHEL6u4

Comment 9 Martin Kletzander 2013-04-03 15:33:22 UTC
Sorry for long replies on this BZ.  Can you confirm this bug also without virt-manager (using virsh pool-dumpxml for example), so we can track where the issue comes from?  Thanks.

Comment 10 Geyang Kong 2013-04-07 02:52:18 UTC
Looks it is still there without virt-manager, I tried this with:
libvirt-1.0.3-1.el7.x86_64

Steps:
1. Create an XML file like following
<pool type="scsi">
  <name>S5</name>
  <uuid>e9392370-2917-565e-692b-d057f46512db</uuid>
  <source>
    <adapter name="host5"/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

2. virsh pool-define $xml
3. virsh pool-dumpxml S5
<pool type='scsi'>
  <name>S5</name>
  <uuid>e9392370-2917-565e-692b-d057f46512db</uuid>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>0</available>
  <source>
    <adapter name='host5'/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>


Additional info:
My host has 6 scsi adapters, from 0 to 5. I tried this with all of them, got same result.

Comment 11 Martin Kletzander 2013-06-11 13:25:23 UTC
Looks like I've missed the answer.  Moving to libvirt as the cause is not likely in virt-manager.  Please check that this is not the same cause as bug 902143.  If yes, close this as NOTABUG or DUPLICATE (whatever's appropriate).  Thanks.

Comment 12 Geyang Kong 2013-06-13 02:56:37 UTC
No, I don't think they are same one, on RHEL7, I can get following output after running lsscsi:
[root@localhost devices]# lsscsi
[0:0:0:0]    disk    ATA      ST3500413AS      JC65  /dev/sda 
[0:0:1:0]    cd/dvd  PLDS     DVD-RW DH16ABSH  YL32  /dev/sr0 

Got following output after running ll /sys/bus/scsi/devices
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 0:0:0:0 -> ../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 0:0:1:0 -> ../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:1/0:0:1:0
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 host0 -> ../../../devices/pci0000:00/0000:00:1f.2/ata1/host0
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 host1 -> ../../../devices/pci0000:00/0000:00:1f.2/ata2/host1
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 host2 -> ../../../devices/pci0000:00/0000:00:1f.5/ata3/host2
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 host3 -> ../../../devices/pci0000:00/0000:00:1f.5/ata4/host3
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 target0:0:0 -> ../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0
lrwxrwxrwx. 1 root root 0 Jun 13 10:33 target0:0:1 -> ../../../devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:1

Looks my hard disk and CD-ROM are all mapped to host0, this is quite different from rhel6.4, you can check comment 5 in bug 902143.

Comment 13 Martin Kletzander 2013-06-25 16:33:32 UTC
I just noticed the difference.  Moving back to virt-manager as the real problem is that the pool is not started after creation.

Workaround: Start the pool after creation, everything should work properly after that.

Comment 14 Martin Kletzander 2013-07-10 15:14:03 UTC
CAn I ask you to take the latest virt-manager and attach a debug log from the reproduction, please?  Even though I know where the problem is, it still works for me correctly.  Thanks a lot.

Comment 15 tingting zheng 2013-07-11 02:30:52 UTC
(In reply to Martin Kletzander from comment #14)
> CAn I ask you to take the latest virt-manager and attach a debug log from
> the reproduction, please?  Even though I know where the problem is, it still
> works for me correctly.  Thanks a lot.

As gkong has left redhat,I am providing the info,any further info needed pls contact me.

Tried with :
virt-manager-0.10.0-1.el7.noarch
libvirt-1.1.0-1.el7.x86_64

# lsscsi
[0:0:0:0]    disk    ATA      WDC WD2502ABYS-1 02.0  /dev/sda


# virt-manager --debug
2013-07-11 10:23:00,973 (host:763): Launching 'Add Pool' wizard
2013-07-11 10:23:00,993 (createpool:93): Showing new pool wizard
2013-07-11 10:23:07,314 (asyncjob:190): Creating async job for function cb=<bound method vmmCreatePool._async_pool_create of <vmmCreatePool object at 0x2562d70 (virtManager+createpool+vmmCreatePool at 0x7fa424015ce0)>>
2013-07-11 10:23:07,389 (createpool:464): Starting backround pool creation.
2013-07-11 10:23:07,390 (Storage:457): Creating storage pool 'scsi' with xml:
<pool type='scsi'>
  <name>scsi</name>
  <uuid>1bf027ad-da2f-9745-9fb7-62ded14a9e5a</uuid>
  <source>
    <adapter name="host0"/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
  </target>
</pool>

2013-07-11 10:23:09,081 (engine:287): Tick is slow, not running at requested rate.
2013-07-11 10:23:13,812 (createpool:467): Pool creation succeeded
2013-07-11 10:23:13,869 (createpool:99): Closing new pool wizard
2013-07-11 10:23:27,244 (host:311): Closing host details: <vmmConnection object at 0x201b960 (virtManager+connection+vmmConnection at 0x1695d80)>


After that,the scsi pool started after creation,but the capacity is still 0.

# virsh pool-list 
Name                 State      Autostart 
-----------------------------------------
boot-scratch         active     yes       
default              active     yes       
scsi                 active     yes  

# virsh pool-dumpxml scsi
<pool type='scsi'>
  <name>scsi</name>
  <uuid>1bf027ad-da2f-9745-9fb7-62ded14a9e5a</uuid>
  <capacity unit='bytes'>0</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>0</available>
  <source>
    <adapter type='scsi_host' name='host0'/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
    <permissions>
      <mode>0755</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

Comment 16 Martin Kletzander 2013-07-12 05:59:34 UTC
That won't work as it is your primary disk what's connected to host0 adapter.  To reproduce the bug, you can use a simple usb stick (flash drive), which should provide you with a "scsi" storage (even though unusable).

Comment 17 tingting zheng 2013-07-15 05:32:01 UTC
(In reply to Martin Kletzander from comment #16)
> That won't work as it is your primary disk what's connected to host0
> adapter.  To reproduce the bug, you can use a simple usb stick (flash
> drive), which should provide you with a "scsi" storage (even though
> unusable).

So would you mean that in comment 15,if I use host0 which contains the primary disk to create a scsi pool,capacity 0 is the expected result?

I've a usb plugged on my machine,tried again:
# lsscsi
[0:0:0:0]    disk    ATA      WDC WD5000AAKS-7 05.0  /dev/sda 
[1:0:0:0]    cd/dvd  PLDS     DVD+-RW DH-16AAS JD12  /dev/sr0 
[6:0:0:0]    disk    Kingston DataTraveler 160 PMAP  /dev/sdb

# virt-manager --debug
2013-07-15 01:18:48,709 (host:763): Launching 'Add Pool' wizard
2013-07-15 01:18:48,726 (createpool:93): Showing new pool wizard
2013-07-15 01:18:56,769 (asyncjob:190): Creating async job for function cb=<bound method vmmCreatePool._async_pool_create of <vmmCreatePool object at 0x293d230 (virtManager+createpool+vmmCreatePool at 0x7faaf8011680)>>
2013-07-15 01:18:56,880 (createpool:464): Starting backround pool creation.
2013-07-15 01:18:56,881 (Storage:457): Creating storage pool 'scsi' with xml:
<pool type='scsi'>
  <name>scsi</name>
  <uuid>86f91c9e-2d13-784d-b28c-0031c97a38f7</uuid>
  <source>
    <adapter name="host6"/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
  </target>
</pool>

2013-07-15 01:18:56,961 (createpool:467): Pool creation succeeded
2013-07-15 01:18:56,981 (createpool:99): Closing new pool wizard

After add scsi pool using host6,then the capacity and allocation is not 0,see the below info.

# virsh pool-list
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
scsi                 active     yes 

# virsh pool-dumpxml scsi
<pool type='scsi'>
  <name>scsi</name>
  <uuid>86f91c9e-2d13-784d-b28c-0031c97a38f7</uuid>
  <capacity unit='bytes'>16022241280</capacity>
  <allocation unit='bytes'>16022241280</allocation>
  <available unit='bytes'>0</available>
  <source>
    <adapter type='scsi_host' name='host6'/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
    <permissions>
      <mode>0755</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

Comment 18 Martin Kletzander 2013-07-15 06:07:52 UTC
Yes, this is expected.  This verifies the bug for me, but as I said, it worked all the time, either gkong had some weird machine it was runnning on or there was one version wasn't autostarting the pools, but that's long ago.

Comment 19 tingting zheng 2013-07-15 06:53:16 UTC
(In reply to Martin Kletzander from comment #18)
> Yes, this is expected.  This verifies the bug for me, but as I said, it
> worked all the time, either gkong had some weird machine it was runnning on
> or there was one version wasn't autostarting the pools, but that's long ago.

I tried several other machines,scsi pool can be created and autostarted successfully,and the capacity is showed right,so refer to comment 17,move the bug to VERIFIED.

Comment 21 Ludek Smid 2014-06-13 10:48:33 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.