Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1658082

Summary: [RFE] Should have --initiator option for pool-create-as and pool-define-as because of iscsi-direct pool
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Meina Li <meili>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Meina Li <meili>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: ddepaula, dyuan, hhan, jdenemar, jsuchane, jtomko, knoel, lcheng, lmen, mprivozn, rbalakri, xuzhang, yisun
Target Milestone: rcKeywords: FutureFeature, Reopened, Upstream
Target Release: 8.0Flags: areis: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-6.10.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-25 06:41:20 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: 6.7.0
Embargoed:

Description Meina Li 2018-12-11 08:35:30 UTC
Description of problem:
Should have --initiator option for pool-create-as and pool-define-as because of iscsi-direct pool

Version-Release number of selected component (if applicable):
libvirt-4.9.0-1.module+el8+2241+fdba4e12.x86_64
qemu-kvm-2.12.0-41.el8+2104+3e32e6f8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Define/create a iscsi-direct pool by pool-define-as/pool-create-as.
# virsh pool-define-as --type iscsi-direct --name iscsi-direct --source-host 10.66.4.104 --source-dev iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2
error: Failed to define pool iscsi-direct
error: unsupported configuration: missing initiator IQN
# virsh pool-create-as --type iscsi-direct --name iscsi-direct --source-host 10.66.4.104 --source-dev iqn.2017-12.com.virttest:emulated-iscsi-noauth.target2
error: Failed to create pool iscsi-direct
error: unsupported configuration: missing initiator IQN
2. Check virsh man page.
# man virsh
pool-define-as name type [--source-host hostname] [--source-path path] [--source-dev path] [--source-name name] [--target path] [--source-format format] ... [--adapter-parent parent]] [--print-xml]
 pool-create-as name type [--source-host hostname] [--source-path path] [--source-dev path] [--source-name name] [--target path][--source-format format] ... [--build] [[--overwrite] | [--no-overwrite]] [--print-xml]

Actual results:
No --initiator option for pool-create-as and pool-define-as

Expected results:
Should have --initiator option for pool-create-as and pool-define-as

Comment 1 Ján Tomko 2020-02-25 14:13:01 UTC
This bug was closed deferred as a result of bug triage.

Please reopen if you disagree and provide justification why this bug should
get enough priority. Most important would be information about impact on
customer or layered product. Please indicate requested target release.

Comment 2 Meina Li 2020-04-01 03:04:59 UTC
Hi,

I think it's necessary to use pool-define-as/pool-create-as to create iscsi-direct pool in libvirt, so we should support this option to create it. 

Please review this bug again and confirm if we need to reopen it?

Thanks.

Comment 3 Han Han 2020-04-01 04:02:58 UTC
(In reply to Meina Li from comment #2)
> Hi,
> 
> I think it's necessary to use pool-define-as/pool-create-as to create
> iscsi-direct pool in libvirt, so we should support this option to create it. 
> 
> Please review this bug again and confirm if we need to reopen it?
> 
> Thanks.

It's a pure virsh feature.
For the consumers, the storage xml is provided by layer product(In fact, storage pool is not used in typical virt product like RHV, RHOS).
So I think it is a really low-priority feature.

Comment 4 Han Han 2020-08-25 03:52:01 UTC
A patch to fix it:
https://www.redhat.com/archives/libvir-list/2020-August/msg00875.html

Comment 5 Michal Privoznik 2020-08-25 07:38:31 UTC
Pushed upstream as:

8eebceef43 virsh: Add source-initiator opt to build the initiator of pool XML

v6.6.0-606-g8eebceef43

Comment 13 Meina Li 2020-12-23 06:29:18 UTC
Verified Version:
libvirt-6.10.0-1.module+el8.4.0+8898+a84e86e1.x86_64
qemu-kvm-5.2.0-2.module+el8.4.0+9186+ec44380f.x86_64

Verified Steps:
1. Define and start a iscsi-direct pool by pool-define-as
# virsh pool-define-as --type iscsi-direct --name iscsi-direct --source-host 10.66.144.87 --source-dev iqn.1994-05.com.redhat:authno --source-initiator iqn.2020-12.com.redhat.com:test
Pool iscsi-direct defined
# virsh pool-start iscsi-direct 
Pool iscsi-direct started
# virsh pool-list 
 Name           State    Autostart
------------------------------------
 iscsi-direct   active   no
# virsh pool-dumpxml iscsi-direct 
<pool type='iscsi-direct'>
  <name>iscsi-direct</name>
  <uuid>6e1be2fd-9a7c-4ee8-afe7-3b027566758d</uuid>
  <capacity unit='bytes'>10737417728</capacity>
  <allocation unit='bytes'>10737417728</allocation>
  <available unit='bytes'>0</available>
  <source>
    <host name='10.66.144.87'/>
    <device path='iqn.1994-05.com.redhat:authno'/>
    <initiator>
      <iqn name='iqn.2020-12.com.redhat.com:test'/>
    </initiator>
  </source>
</pool>
# virsh pool-destroy iscsi-direct 
Pool iscsi-direct destroyed
# virsh pool-undefine iscsi-direct 
Pool iscsi-direct has been undefined

2. Create a iscsi-direct pool by pool-create-as
# virsh pool-create-as --type iscsi-direct --name iscsi-direct --source-host 10.66.144.87 --source-dev iqn.1994-05.com.redhat:authno --source-initiator iqn.2020-12.com.redhat.com:test
Pool iscsi-direct created
# virsh pool-list 
 Name           State    Autostart
------------------------------------
 iscsi-direct   active   no
# virsh pool-dumpxml iscsi-direct 
<pool type='iscsi-direct'>
  <name>iscsi-direct</name>
  <uuid>894997d3-90bd-426b-abf3-b127d226dc39</uuid>
  <capacity unit='bytes'>10737417728</capacity>
  <allocation unit='bytes'>10737417728</allocation>
  <available unit='bytes'>0</available>
  <source>
    <host name='10.66.144.87'/>
    <device path='iqn.1994-05.com.redhat:authno'/>
    <initiator>
      <iqn name='iqn.2020-12.com.redhat.com:test'/>
    </initiator>
  </source>
</pool>

Comment 16 errata-xmlrpc 2021-05-25 06:41:20 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 (virt:av bug fix and enhancement update), 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-2021:2098