Bug 1658511

Summary: virt-manager/virt-install fails attemping to use iscsi-direct storage volume
Product: Red Hat Enterprise Linux 8 Reporter: Meina Li <meili>
Component: virt-managerAssignee: Pavel Hrdina <phrdina>
Status: CLOSED DEFERRED QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 8.0CC: crobinso, dyuan, hhan, juzhou, knoel, meili, phrdina, tzheng, xiaodwan, xuzhang, yisun
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-manager-2.2.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-25 11:33:55 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
debug.log none

Description Meina Li 2018-12-12 10:27:40 UTC
Description of problem:
Libvirt and qemu-kvm can provide support for iscsi-direct pool, so suggest virt-manager to support it.

Version-Release number of selected component (if applicable):
libvirt-4.10.0-1.module+el8+2317+367e35b5.x86_64
qemu-kvm-3.0.0-2.module+el8+2246+78080371.x86_64
virt-manager-2.0.0-1.el8.noarch

How reproducible:
100%

Steps to Reproduce:
1. Prepare an iscsi-direct pool.
# virsh pool-dumpxml iscsi-direct
<pool type='iscsi-direct'>
  <name>iscsi-direct</name>
  <uuid>0799697a-94dd-4115-9601-8714b1931248</uuid>
  <capacity unit='bytes'>524287488</capacity>
  <allocation unit='bytes'>524287488</allocation>
  <available unit='bytes'>0</available>
  <source>
    <host name='10.66.144.87'/>
    <device path='iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2'/>
    <initiator>
      <iqn name='iqn.2017-12.com.example:client'/>
    </initiator>
  </source>
</pool>

# virsh vol-list iscsi-direct
 Name         Path                                                                                    
-------------------------------------------------------------------------------
 unit:0:0:0   ip-10.66.144.87:3260-iscsi-iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2-lun-0

2. Install guest by using iscsi-direct volume

Actual results:
Can't install guest on step 2.

Expected results:
Can install guest normally

Additional info:
1)Error info:
Unable to complete install: 'unsupported configuration: unknown protocol type 'iscsi-direct''

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 2119, in _do_async_install
    guest.installer_instance.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/installer.py", line 419, in start_install
    doboot, transient)
  File "/usr/share/virt-manager/virtinst/installer.py", line 362, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 3725, in createXML
    if ret is None:raise

Comment 1 Xiaodai Wang 2018-12-13 02:43:30 UTC
Please upload the full debug log of virt-manager.

Comment 2 Meina Li 2018-12-13 03:09:51 UTC
Created attachment 1513866 [details]
debug.log

Comment 3 Xiaodai Wang 2018-12-13 03:24:34 UTC
This looks like a libvirt bug.

  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 3725, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: unsupported configuration: unknown protocol type 'iscsi-direct'

Comment 4 Pavel Hrdina 2018-12-13 05:41:58 UTC
Yes, that error message is from libvirt but the root cause is this XML:

    <disk type="network" device="disk">
      <driver name="qemu"/>
      <source protocol="iscsi-direct" name="unit:0:0:1">
        <host name="10.66.144.87"/>
      </source>
      <target dev="vda" bus="virtio"/>
    </disk>

which is not correct, the protocol should be iscsi.

My guess is that virt-manager just copies the storage poll type
into the source protocol of disk so definitely virt-manager bug.

Comment 5 Cole Robinson 2019-06-15 00:38:20 UTC
Fixed upstream now, though I don't have a working setup so I was just going off the docs

commit c52e2205049bc797401ab28e6f80f0940130d0ca (HEAD -> master, origin/master)
Author: Cole Robinson <crobinso>
Date:   Fri Jun 14 20:35:41 2019 -0400

    devices: disk: Handle pool=iscsi-direct volumes
    
    I don't have a working setup for this so I'm not positive
    it actually works, but this roughly matches what I see in
    libvirt test suite data and docs
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1658511

Comment 7 zhoujunqin 2019-07-22 09:09:26 UTC
Hi Pavel,
I checked that pool type "iscsi-direct (since 4.7.0)" is supported by fast train libvirt.

https://libvirt.org/formatstorage.html

So the "Product" version is not correct here, please have a look of it, thanks.


BR,
juzhou.

Comment 8 zhoujunqin 2019-07-22 10:10:27 UTC
Hi Pavel,
My last comment is a bit confused, here i want to make it clear.

We have confirmed with PM that virt-manager is only for slow train, but this feature is not supported by slow train libvirt version.
virt-manager-2.2.1-1.el8.noarch
libvirt-4.5.0-24.module+el8.1.0+3205+41ff0a42.x86_64

# virsh pool-define iscsi-direct.xml 
error: Failed to define pool from iscsi-direct.xml
error: unsupported configuration: unknown storage pool type iscsi-direct


So i have two workarounds for this issue:
1) Verify this bug with virt-manager+ fast_train_libvirt
2) Close it as WONTFIX on slow train

Which one do you prefer, or you have other good solution for it, thanks.

BR,
juzhou.

Comment 9 Pavel Hrdina 2019-07-25 11:33:55 UTC
Hi Junqin, I guess we should close this BUG as the fast train is not relevant
for virt-manager which is RHEL only.