This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 461990

Summary: Unable to create iSCSI storage pool
Product: [Fedora] Fedora Reporter: James Laska <jlaska>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: berrange, crobinso, jturner, mjenner, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-22 08:17:17 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 438944    
Attachments:
Description Flags
iscsi-storage.xml none

Description James Laska 2008-09-11 15:02:41 EDT
Created attachment 316472 [details]
iscsi-storage.xml

Description of problem:

Attempting to add an iSCSI target as a storage pool fails.

Version-Release number of selected component (if applicable):

libvirt-0.4.5-2.fc10.i386
virt-manager-0.6.0-1.fc10.i386
qemu-0.9.1-10.fc10.i386

How reproducible:
100%

Steps to Reproduce:
1. start virt-manager
2. Select 'Details' for QEMU localhost
3. Select 'Storage Pools' tab
4. Select 'Add'
5. Select type=iscsi, (See attached xml file for sample input)
6. Select Next

Actual results:

# tail -fn0 ~/.virt-manager/virt-manager.log 
[Wed, 24 Sep 2008 16:41:58 virt-manager 22506] DEBUG (createpool:280) Threading off connection to create pool.
[Wed, 24 Sep 2008 16:41:58 virt-manager 22506] DEBUG (createpool:289) Starting backround pool creation.
[Wed, 24 Sep 2008 16:41:58 virt-manager 22506] DEBUG (Storage:370) Creating storage pool 'iscsi' with xml:
<pool type='iscsi'>
  <name>iscsi</name>
  <uuid>621b84a5-8de5-e7cd-3e48-e1c3450d459d</uuid>
  <source>
    <host name="ibm-ds300.test.redhat.com"/>
    <device path="iqn.1986-03.com.ibm.25166155.19700715204552.qe-rtt-libvirt"/>
  </source>
  <target>
    <path>/dev/disk/by-path</path>
  </target>
</pool>
[Wed, 24 Sep 2008 16:41:58 virt-manager 22506] ERROR (createpool:297) Error creating pool: Could not start storage pool: /sbin/iscsiadm exited with non-zero status 255 and signal 0
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/createpool.py", line 291, in _async_pool_create
    poolobj = self._pool.install(create=True, meter=meter, build=build)
  File "/usr/lib/python2.5/site-packages/virtinst/Storage.py", line 403, in install
    raise RuntimeError(errmsg)
RuntimeError: Could not start storage pool: /sbin/iscsiadm exited with non-zero status 255 and signal 0

[Wed, 24 Sep 2008 16:41:58 virt-manager 22506] DEBUG (error:67) Uncaught Error: Error creating pool: Could not start storage pool: /sbin/iscsiadm exited with non-zero status 255 and signal 0 : Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/createpool.py", line 291, in _async_pool_create
    poolobj = self._pool.install(create=True, meter=meter, build=build)
  File "/usr/lib/python2.5/site-packages/virtinst/Storage.py", line 403, in install
    raise RuntimeError(errmsg)
RuntimeError: Could not start storage pool: /sbin/iscsiadm exited with non-zero status 255 and signal 0


[Wed, 24 Sep 2008 15:37:26 virt-manager 22506] DEBUG (Storage:370) Creating storage pool 'VolGroup00' with xml:
<pool type='logical'>
  <name>VolGroup00</name>
  <uuid>372d8c11-e3ae-af96-7d8c-fb0f0abb86c0</uuid>
  <target>
    <path>/dev/VolGroup00</path>
  </target>
</pool>
[Wed, 24 Sep 2008 15:37:26 virt-manager 22506] ERROR (createpool:297) Error creating pool: Could not define storage pool: cannot extract storage pool source devices
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/createpool.py", line 291, in _async_pool_create
    poolobj = self._pool.install(create=True, meter=meter, build=build)
  File "/usr/lib/python2.5/site-packages/virtinst/Storage.py", line 375, in install
    raise RuntimeError(_("Could not define storage pool: %s" % str(e)))
RuntimeError: Could not define storage pool: cannot extract storage pool source devices


Expected results:
 * Storage pool created

Additional info:

 * SELinux is in permissive mode

 * Interestingly enough, despite the error, /var/log/messages and `dmesg` both seem to indicate a connection was made

$ dmesg 
...
scsi6 : iSCSI Initiator over TCP/IP
scsi 6:0:0:0: Direct-Access     IBM      DS300    S320    4.15 PQ: 0 ANSI: 4
sd 6:0:0:0: [sdd] 4198400 512-byte hardware sectors (2150 MB)
...

$ tail /var/log/messages

Sep 24 17:06:49 hp-xw9300 kernel: scsi6 : iSCSI Initiator over TCP/IP
Sep 24 17:06:49 hp-xw9300 iscsid: connection1:0 is operational now
Sep 24 17:06:49 hp-xw9300 kernel: scsi 6:0:0:0: Direct-Access     IBM      DS300    S320    4.15 PQ: 0 ANSI: 4
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] 4198400 512-byte hardware sectors (2150 MB)
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] Write Protect is off
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] 4198400 512-byte hardware sectors (2150 MB)
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] Write Protect is off
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
Sep 24 17:06:49 hp-xw9300 kernel: sdd: unknown partition table
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: [sdd] Attached SCSI disk
Sep 24 17:06:49 hp-xw9300 kernel: sd 6:0:0:0: Attached scsi generic sg4 type 0
Sep 24 17:06:50 hp-xw9300 setroubleshoot: SELinux is preventing iscsid (iscsid_t) "search" to ./bdi (debugfs_t). For complete SELinux messages. run sealert -l 002c5cd0-6437-49ee-bd47-348b740bddb8

 * virt-manager now shows my 'iscsi' entry listed in the pools. But it is not active.  If I try to delete that pool I get ...

[Wed, 24 Sep 2008 17:23:43 virt-manager 2794] DEBUG (error:67) Uncaught Error: Error deleting pool: no config file for iscsi : Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/host.py", line 429, in delete_pool
    pool.delete()
  File "/usr/share/virt-manager/virtManager/storagepool.py", line 77, in delete
    self.pool.undefine()
  File "/usr/lib/python2.5/site-packages/libvirt.py", line 744, in undefine
    if ret == -1: raise libvirtError ('virStoragePoolUndefine() failed', pool=self)
libvirtError: no config file for iscsi
Comment 1 Bug Zapper 2008-11-25 22:02:53 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 2 Daniel Berrange 2009-01-22 08:17:17 EST
There was a race condition in iSCSI startup, due to the time it takes udev to create device nodes. In 0.5.0 libvirt we added a call to 'udev settle' which should address the problem reported here.