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.
description:
Using "pool-create-as" to create a scsi pool with wwnn&wwpn has redundant xml check.
versions:
kernel-3.10.0-253.el7.x86_64
libvirt-1.2.15-2.el7.x86_64
qemu-kvm-rhev-2.3.0-1.el7.x86_64
repro steps:
1. try to create a fibre channel scsi pool with wwnn&wwpn as follow:
# virsh pool-create-as npiv-pool scsi --adapter-wwnn 2101001b32a90002 --adapter-wwpn 2101001b32a90002 --adapter-parent scsi_host5 --target /dev/disk/by-path/
error: Failed to create pool npiv-pool
error: XML error: missing storage pool source adapter
2. use same cmd line in step 1 and add "--source-host haha" (or "--source-dev haha" / "--source-path haha")
# virsh pool-create-as npiv-pool scsi --adapter-wwnn 2101001b32a90002 --adapter-wwpn 2101001b32a90002 --adapter-parent scsi_host5 --target /dev/disk/by-path/ --source-host haha
Pool npiv-pool created
3. Check the pool's xml file, the "--source-host haha" doesn't effect the final xml file.
# virsh pool-dumpxml npiv-pool
<pool type='scsi'>
<name>npiv-pool</name>
<uuid>50875fdb-97c4-4015-b667-7247cce5bc5b</uuid>
<capacity unit='bytes'>0</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>0</available>
<source>
<adapter type='fc_host' parent='scsi_host5' managed='yes' wwnn='2101001b32a90002' wwpn='2101001b32a90002'/>
</source>
<target>
<path>/dev/disk/by-path</path>
<permissions>
<mode>0755</mode>
<owner>-1</owner>
<group>-1</group>
</permissions>
</target>
</pool>
actual result:
When ignore the unnecessary source elements, virsh will prevent the creation of a scsi pool from wwnn&wwpn (as step 1). And if we add the unnecessary element, it will be ignored finally in the xml (as step 3). It's confusing.
expected result:
Step 1 should be a valid command without error.
Additional info:
You can use add "--print-xml" in the command to make a quick reproduction.
standard npiv pool xml as follow:
http://wiki.libvirt.org/page/NPIV_in_libvirt#Creation_of_vHBA_by_the_storage_pool
Seems I forgot to add to the list of "if"'s which cause the code to print the <source...> and source child xml when I added commits '89325806' and 'bd00e00ea'.
As for --source host, --source-dev, --source-path and not appearing after - that's because they are ignored for <pool type='scsi'>
--source-host is valid for "netfs, iscsi, rbd, sheepdog, gluster" pool types
--source-dev is valid for "fs, logical, disk, iscsi, zfs" pool types
--source-path is valid for "dir" pools
Patches post upstream :
http://www.redhat.com/archives/libvir-list/2015-May/msg01103.html
Patch pushed upstream:
commit cffc099356f0ce1bb94d9d009aa49a99b9001d3c
Author: John Ferlan <jferlan>
Date: Thu May 28 14:29:19 2015 -0400
virsh: Fix printing of XML for pool-create-as
https://bugzilla.redhat.com/show_bug.cgi?id=1224088
commit id 'bd00e00e' neglected to add the new adapter source options
into the if condition that allowed printing the <source> XML fields.
The <adapter type='fc_host'.../> doesn't require other options in order
to be complete.
git describe cffc099356f0ce1bb94d9d009aa49a99b9001d3c
v1.2.16-2-gcffc099
Verified with libvirt-1.2.17-2.el7.x86_64
Steps
1. create scsi pool with option adapter-wwnn and adapter-wwpn
# virsh pool-create-as npiv-pool scsi --adapter-wwnn 2101001b32a90002 --adapter-wwpn 2101001b32a90002 --adapter-parent scsi_host2 --target /dev/disk/by-path/
Pool npiv-pool created
2. create scsi pool with option adapter-name
# virsh pool-create-as npiv-pool scsi --adapter-name scsi_host7 --target /dev/disk/by-path/
Pool npiv-pool created
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://rhn.redhat.com/errata/RHBA-2015-2202.html
description: Using "pool-create-as" to create a scsi pool with wwnn&wwpn has redundant xml check. versions: kernel-3.10.0-253.el7.x86_64 libvirt-1.2.15-2.el7.x86_64 qemu-kvm-rhev-2.3.0-1.el7.x86_64 repro steps: 1. try to create a fibre channel scsi pool with wwnn&wwpn as follow: # virsh pool-create-as npiv-pool scsi --adapter-wwnn 2101001b32a90002 --adapter-wwpn 2101001b32a90002 --adapter-parent scsi_host5 --target /dev/disk/by-path/ error: Failed to create pool npiv-pool error: XML error: missing storage pool source adapter 2. use same cmd line in step 1 and add "--source-host haha" (or "--source-dev haha" / "--source-path haha") # virsh pool-create-as npiv-pool scsi --adapter-wwnn 2101001b32a90002 --adapter-wwpn 2101001b32a90002 --adapter-parent scsi_host5 --target /dev/disk/by-path/ --source-host haha Pool npiv-pool created 3. Check the pool's xml file, the "--source-host haha" doesn't effect the final xml file. # virsh pool-dumpxml npiv-pool <pool type='scsi'> <name>npiv-pool</name> <uuid>50875fdb-97c4-4015-b667-7247cce5bc5b</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <adapter type='fc_host' parent='scsi_host5' managed='yes' wwnn='2101001b32a90002' wwpn='2101001b32a90002'/> </source> <target> <path>/dev/disk/by-path</path> <permissions> <mode>0755</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> actual result: When ignore the unnecessary source elements, virsh will prevent the creation of a scsi pool from wwnn&wwpn (as step 1). And if we add the unnecessary element, it will be ignored finally in the xml (as step 3). It's confusing. expected result: Step 1 should be a valid command without error. Additional info: You can use add "--print-xml" in the command to make a quick reproduction. standard npiv pool xml as follow: http://wiki.libvirt.org/page/NPIV_in_libvirt#Creation_of_vHBA_by_the_storage_pool