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 1123767 - [Storage] validate 'unknown' type logical volume pool xml failed, however, pool can be created successfully
Summary: [Storage] validate 'unknown' type logical volume pool xml failed, however, po...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Erik Skultety
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-28 08:29 UTC by Yang Yang
Modified: 2015-11-19 05:46 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 05:46:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Yang Yang 2014-07-28 08:29:51 UTC
Description of problem:
1. virt-xml-validate the "unknown" type logical volume pool xml, will meet error, but the pool can be created successfully, whether via pool-create or pool-create-as command.

2. virt-xml-validate the "auto" type logical volume pool xml, the xml is validated, but the pool can NOT be created successfully, whether via pool-create or pool-create-as command.

Version-Release number of selected component (if applicable):
libvirt-1.1.1-29.el7_0.1.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Validate the 'unknown' type logical volume pool xml
# cat pool-logical.xml 
 <pool type='logical'>
       <name>HostVG</name>
       <source>
         <name>HostVG</name>
         <format type='unknown'/>
         <device path='/dev/sda6'/>
       </source>
       <target>
         <path>/dev/HostVG</path>
       </target>
     </pool>

# virt-xml-validate pool-logical.xml 
pool-logical.xml:4: element name: Relax-NG validity error : Element source has extra content: name
pool-logical.xml:1: element pool: Relax-NG validity error : Element pool failed to validate content
pool-logical.xml fails to validate

2. Create pool with above xml

# virsh pool-create pool-logical.xml 
Pool HostVG created from pool-logical.xml

[root@yangyangtest yy]# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
HostVG               active     no      
  
[root@yangyangtest yy]# virsh pool-destroy HostVG
Pool HostVG destroyed

[root@yangyangtest yy]# virsh pool-create-as HostVG logical --target /dev/HostVG --source-format unknown
Pool HostVG created

[root@yangyangtest yy]# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
HostVG               active     no 

3. Validate the 'auto' type logical volume pool xml
# cat pool-logical.xml 
 <pool type='logical'>
       <name>HostVG</name>
       <source>
         <name>HostVG</name>
         <format type='auto'/>
         <device path='/dev/sda6'/>
       </source>
       <target>
         <path>/dev/HostVG</path>
       </target>
     </pool>
# virt-xml-validate pool-logical.xml 
pool-logical.xml validates

4. Create pool with above xml
# virsh pool-create pool-logical.xml 
error: Failed to create pool from pool-logical.xml
error: XML error: unknown pool format type auto

# virsh pool-create-as HostVG logical --target /dev/HostVG --source-format auto
error: Failed to create pool HostVG
error: XML error: unknown pool format type auto

Actual results:
While the source format of pool is "unknown", virt-xml-validate failed, but the pool can be created succussfully.
While the source format of pool is "auto", virt-xml-validate pass, but the pool failed to be created.


Expected results:
1.The result of virt-xml-validate should be keeping consistent with the creating result.
It means, if the virt-xml-validate command pass, then creating pool successfully;
if virt-xml-validate command fail, then creating pool fail.

2.In the following doc link, 
http://www.libvirt.org/storage.html#StorageBackendLogical
we can find that 
 The logical volume pool supports the following formats:

    auto - automatically determine format
    lvm2 

If pool type "unknown" is supported instead of "auto", the doc should be updated. If not, libvirt should support to create a logical pool with auto type instead of "unknown".

Additional info:

I also hit the issue in RHEL6. Will it be fixed in RHEL6, OR is it necessary to clone it in RHEL6?

Comment 4 Erik Skultety 2014-09-25 12:42:17 UTC
already existing NACK https://www.redhat.com/archives/libvir-list/2014-June/msg00838.html

Comment 5 Erik Skultety 2014-10-01 13:18:01 UTC
Now fixed upstream:

commit 1be67cd31b14172caee9bcc2daec64a908d71e94
Author: Erik Skultety <eskultet>
Date:   Thu Sep 25 16:26:18 2014 +0200

    storage: Fix logical pool fmt type
    
    According to our documentation logical pool supports formats 'auto' and
    'lvm2'. However, in storage_conf.c we previously defined storage pool
    formats: unknown, lvm2. Due to backward compatibility reasons
    we must continue refer to pool format type 'unknown' instead of 'auto'.

v1.2.9-rc1-20-g1be67cd

Comment 8 Yang Yang 2015-05-14 05:18:19 UTC
Verified on libvirt-1.2.15-1.el7.x86_64

Steps
1. define/build/start a logical pool with 'unknown' format
# cat testpool.xml 
<pool type='logical'>
       <name>MyVG</name>
       <source>
         <name>MyVG</name>
         <format type='unknown'/>
         <device path='/dev/sdc'/>
       </source>
       <target>
         <path>/dev/MyVG</path>
       </target>
     </pool>
# virsh pool-define testpool.xml 
Pool MyVG defined from testpool.xml
# virsh pool-build MyVG
Pool MyVG built
# virsh pool-start MyVG
Pool MyVG started

2. define/build/start a logical pool with 'auto' format
# cat testpool.xml 
<pool type='logical'>
       <name>MyVG</name>
       <source>
         <name>MyVG</name>
         <format type='auto'/>
         <device path='/dev/sdc'/>
       </source>
       <target>
         <path>/dev/MyVG</path>
       </target>
     </pool>

# virsh pool-define testpool.xml 
error: Failed to define pool from testpool.xml
error: unsupported configuration: unknown pool format type auto

3.define/build/start a logical pool without format
# cat testpool.xml 
<pool type='logical'>
       <name>MyVG</name>
       <source>
         <name>MyVG</name>
         <device path='/dev/sdc'/>
       </source>
       <target>
         <path>/dev/MyVG</path>
       </target>
     </pool>
# virsh pool-define testpool.xml 
Pool MyVG defined from testpool.xml
# virsh pool-build MyVG
Pool MyVG built
# virsh pool-start MyVG
Pool MyVG started

# virsh pool-dumpxml MyVG
<pool type='logical'>
  <name>MyVG</name>
  <uuid>1297bd2c-c6aa-445e-9c41-0a009ed865d2</uuid>
  <capacity unit='bytes'>1044381696</capacity>
  <allocation unit='bytes'>0</allocation>
  <available unit='bytes'>1044381696</available>
  <source>
    <device path='/dev/sdc'/>
    <name>MyVG</name>
    <format type='lvm2'/>
  </source>
  <target>
    <path>/dev/MyVG</path>
    <permissions>
      <mode>0755</mode>
      <owner>-1</owner>
      <group>-1</group>
    </permissions>
  </target>
</pool>

Comment 10 errata-xmlrpc 2015-11-19 05:46:18 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, 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


Note You need to log in before you can comment on or make changes to this bug.