Hide Forgot
Description of problem: Defined a disk pool using the xml not specifying format type. The format type defaults by 'unknown' by checking the pool dumpxml. However, pool builds failed as the 'unknown' is not an valid disk label. Dump disk pool xml to a local file, validates failed too. Version-Release number of selected component (if applicable): libvirt-1.2.8-12.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. define a disk pool with the following xml # cat disk-pool.xml <pool type="disk"> <name>disk</name> <source> <device path='/dev/sdc'/> </source> <target> <path>/tmp</path> </target> </pool> #virsh pool-define disk-pool.xml 2. dump the pool xml # virsh pool-dumpxml disk <pool type='disk'> <name>disk</name> <uuid>25548d2f-7cd7-4604-8968-7965fcd1b429</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <device path='/dev/sdc'/> <format type='unknown'/> </source> <target> <path>/tmp</path> <permissions> <mode>0755</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> 3. build the pool # virsh pool-build disk --overwrite error: Failed to build pool disk error: internal error: Child process (/usr/sbin/parted /dev/sdc mklabel --script unknown) unexpected exit status 1: /usr/sbin/parted: invalid token: unknown Error: Expecting a disk label type. 4. dump the pool xml to a file # virsh pool-dumpxml disk > disk-tmp.xml 5. validate the file # virt-xml-validate disk-tmp.xml Relax-NG validity error : Extra element format in interleave disk-tmp.xml:9: element format: Relax-NG validity error : Element source failed to validate content disk-tmp.xml:1: element pool: Relax-NG validity error : Invalid sequence in interleave disk-tmp.xml:1: element pool: Relax-NG validity error : Element pool failed to validate content disk-tmp.xml fails to validate Actual results: Disk pool format type defaults by 'unknwon' Expected results: As 'unknown' is not a valid format, it should not be the default format Additional info:
Patch posted upstream: http://www.redhat.com/archives/libvir-list/2015-February/msg01196.html
Patch pushed upstream: commit id: 832a9256b25504ec79cebe9db2784d7f05342f03 git describe 832a9256b25504ec79cebe9db2784d7f05342f03 v1.2.13-28-g832a925 $
I can reproduce it on libvirt-1.2.8-12.el7.x86_64 . Verify version : libvirt-1.2.16-1.el7.x86_64 qemu-kvm-rhev-2.3.0-2.el7.x86_64 steps : 1.check libvirt.org , it gives useful info : http://libvirt.org/storage.html#StorageBackendDisk Disk volume pools ......It will default to using msdos as the pool source format. 2.check pool operations 2.1 define a disk pool like following : <pool type='disk'> <name>disk-pool</name> <source> <device path='/dev/sdd'/> </source> <target> <path>/dev</path> </target> </pool> # virsh pool-define disk-pool.xml Pool disk-pool defined from disk-pool.xml # virsh pool-dumpxml disk-pool <pool type='disk'> <name>disk-pool</name> <uuid>e8af7d41-61fe-42dd-b9ff-e9816681839d</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <device path='/dev/sdd'/> <format type='unknown'/> </source> <target> <path>/dev</path> </target> </pool> 2.2 build the pool # virsh pool-build disk-pool --overwrite Pool disk-pool built # virsh pool-dumpxml disk-pool <pool type='disk'> <name>disk-pool</name> <uuid>e8af7d41-61fe-42dd-b9ff-e9816681839d</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <device path='/dev/sdd'/> <format type='unknown'/> </source> <target> <path>/dev</path> </target> </pool> 2.3 start the pool and create volume in the pool # virsh pool-start disk-pool Pool disk-pool started # virsh pool-dumpxml disk-pool <pool type='disk'> <name>disk-pool</name> <uuid>e8af7d41-61fe-42dd-b9ff-e9816681839d</uuid> <capacity unit='bytes'>64420392960</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>64420360704</available> <source> <device path='/dev/sdd'> <freeExtent start='32256' end='64420392960'/> </device> <format type='unknown'/> </source> <target> <path>/dev</path> </target> </pool> # virsh vol-create-as --pool disk-pool sdd1 1G --format none Vol sdd1 created # virsh vol-create-as --pool disk-pool sdd2 1G Vol sdd2 created # virsh vol-list disk-pool --details Name Path Type Capacity Allocation ---------------------------------------------- sdd1 /dev/sdd1 block 1.00 GiB 1.00 GiB sdd2 /dev/sdd2 block 1.00 GiB 1.00 GiB 3.validate pool-dumpxml #virsh pool-dumpxml disk-pool > pool.xml # virt-xml-validate pool.xml Relax-NG validity error : Extra element format in interleave pool.xml:9: element format: Relax-NG validity error : Element source failed to validate content pool.xml:1: element pool: Relax-NG validity error : Invalid sequence in interleave pool.xml:1: element pool: Relax-NG validity error : Element pool failed to validate content pool.xml fails to validate Note : According to the verify steps , in step 2 , pool can be build with --overwrite , start and create volume ; but check with pool-dumpxml , the source format is still 'unknown' . In step 3 , it is invalid if pool source format is 'unknown' through virt-xml-validate to check . So Is it necessary that we should change the result of dumpxml since we changed the pool source format , and drop the 'unknown' source format because it is invalid . or it is a acceptable result since it has no impact for us to use it Thanks !
The meaning of the docs is that when source format is unknown, then it will default to using msdos. Having unknown in the output isn't technically wrong. The failure to virt-xml-validate that is because the .rng has "none" instead of "unknown" (something that can be easily fixed - I'll send a patch upstream today). Not changing the type from unknown to dos is not technically a bug/issue, but it is something that can also be rectified. I'll send a patch for that too, but it could be rejected since we do indicate by providing unknown, we will default to dos
See also https://bugzilla.redhat.com/show_bug.cgi?id=1245144 Primary partitions created by parted are ejected by kernel. It perhaps blocks our disk pool related testing.
With respect to c5 - the following patch series was been pushed upstream: http://www.redhat.com/archives/libvir-list/2015-June/msg00307.html They were added to libvirt 1.2.17
Verify version : libvirt-1.2.17-5.el7.x86_64 steps : 1. define a pool like following with format is unknown # virsh pool-dumpxml disk-pool <pool type='disk'> <name>disk-pool</name> <uuid>80d28c91-4a38-4b75-b9d0-3f2ca9b1be46</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <device path='/dev/sdb'/> <format type='unknown'/> </source> <target> <path>/dev</path> </target> </pool> 2.Using virt-xml-validate to check , it is vaild. # virt-xml-validate disk-pool1.xml disk-pool1.xml validates 3.build and start pool. # virsh pool-build disk-pool --overwrite Pool disk-pool built 3.1 check source format again. As said in doc if the source format type is "unknown",it will default to use "msdos", and out put as "dos" # virsh pool-dumpxml disk-pool <pool type='disk'> <name>disk-pool</name> <uuid>80d28c91-4a38-4b75-b9d0-3f2ca9b1be46</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <device path='/dev/sdb'/> <format type='dos'/> </source> <target> <path>/dev</path> </target> </pool> 3.2 start disk-pool, check source format again. # virsh pool-start disk-pool Pool disk-pool started # virsh pool-dumpxml disk-pool <pool type='disk'> <name>disk-pool</name> <uuid>80d28c91-4a38-4b75-b9d0-3f2ca9b1be46</uuid> <capacity unit='bytes'>16006394880</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>16006362624</available> <source> <device path='/dev/sdb'> <freeExtent start='32256' end='16006394880'/> </device> <format type='dos'/> </source> <target> <path>/dev</path> </target> </pool> # virsh vol-create-as --pool disk-pool sdc1 1G Vol sdc1 created # virsh vol-list disk-pool Name Path ------------------------------------------------------------------------------ sdc1 /dev/sdc1 As comment 2 and this , move this bug to verified.
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