Bug 718143 - pool-define and pool-define-as ingores the --source-name and --source-format
Summary: pool-define and pool-define-as ingores the --source-name and --source-format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-01 07:57 UTC by Osier Yang
Modified: 2011-12-06 11:16 UTC (History)
5 users (show)

Fixed In Version: libvirt-0.9.3-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 11:16:03 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1513 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-12-06 01:23:30 UTC

Description Osier Yang 2011-07-01 07:57:53 UTC
Description of problem:

virsh commands pool-define and pool-define-as provide options "--source-name" to specify the source of the pool, and --source-format to specify the source format of pool, however, it ignores them when building the pool xml in virsh silently.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Osier Yang 2011-07-01 07:59:36 UTC
commit e67bc20778450fcc67c85bc43c45f1c7104d6cb9
Author: Osier Yang <jyang>
Date:   Thu Jun 30 16:46:44 2011 +0800

    virsh: Fix a problem of buildPoolXML
    
    It doesn't generate "<name>" and "<format>" nodes for "<source>"
    even if they are explicitly specified. This patch fixes it.

Comment 4 yuping zhang 2011-07-06 07:43:08 UTC
Tested this issue on libvirt-0.9.2-1.el6.x86_64
# virsh pool-define-as --name nfs --type netfs --source-host 10.66.90.113 --source-path=/vol/vol0/home --source-name test --source-format nfs --target /tmp  
Pool nfs define
# virsh pool-dumpxml nfs
<pool type='netfs'>
  <name>nfs</name>
  <uuid>3f4fd9e4-8c93-7809-79b2-8c79bfcfef7e</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.113'/>
    <dir path='/vol/vol0/home'/>
    <format type='nfs'/>
  </source>
  <target>
    <path>/tmp</path>
    ..................
  </target>
</pool>

#cat pool-bug.xml 
<pool type='netfs'>
    <name>nfs</name>
    <source>
        <host name='10.66.90.113'/>
         <dir path='/vol/vol0/home'/>
         <format type='nfs'/>
         <name>test</name>
      </source>
      <target>
          <path>/tmp</path>
       </target>
</pool>

#virsh pool-define pool-bug.xml 
Pool nfs defined from pool-bug.xml

# virsh pool-dumpxml nfs
<pool type='netfs'>
  <name>nfs</name>
  <uuid>6de2727d-ad8a-9454-2d38-4582a5bca84b</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.113'/>
    <dir path='/vol/vol0/home'/>
    <format type='nfs'/>
  </source>
  <target>
    <path>/tmp</path>
   ................
  </target>
</pool>

Tested this issue with:
libvirt-0.9.3-1.el6
qemu-kvm-0.12.1.2-2.167.el6
kernel-2.6.32-164.el6
# virsh pool-define-as --name nfs --type netfs --source-host 10.66.90.113 --source-path=/vol/vol0/home --source-name test --source-format nfs --target /tmp
Pool nfs defined
# virsh pool-dumpxml nfs
<pool type='netfs'>
  <name>nfs</name>
  <uuid>fa041655-0fc0-b4d7-c381-cfb8ae44e582</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.113'/>
    <dir path='/vol/vol0/home'/>
    <format type='nfs'/>
  </source>
  <target>
    <path>/tmp</path>
    ...............
  </target>
</pool>

# virsh pool-define pool-bug.xml 
Pool nfs defined from pool-bug.xml
#virsh pool-dumpxml nfs
<pool type='netfs'>
  <name>nfs</name>
  <uuid>d02e3f60-b965-3187-ead4-a1cc639b2179</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.113'/>
    <dir path='/vol/vol0/home'/>
    <format type='nfs'/>
  </source>
  <target>
    <path>/tmp</path>
   ........
  </target>
</pool>

No <name> node. 
And also it doesn't generate <device> node:
#  virsh pool-define-as --name nfs --type netfs --source-host 10.66.90.113 --source-path /vol/vol0/home --source-name test --source-format nfs --source-dev /vol/vol0/home --target /tmp
#virsh pool-dumpxml nfs
<pool type='netfs'>
  <name>nfs</name>
  <uuid>0146458f-79a4-3b9e-1be8-b12731677925</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.90.113'/>
    <dir path='/vol/vol0/home'/>
    <format type='nfs'/>
  </source>
  ..........

No <name> and <source> elements for <source>
So change the status to ASSIGNED.

Comment 5 Osier Yang 2011-07-11 07:38:13 UTC
This bug is about virsh, if you see what you specified for "--source-name" and "--format-name" are in the generated XML in virsh, that's fixed.

Option "--print-xml" will output the generated XML.

# virsh pool-define-as --name nfs --type netfs --source-host 10.66.90.113
--source-path=/vol/vol0/home --source-name test --source-format nfs --target
/tmp --print-xml

The reason for you don't see "<source> <name>test</name> </source>" in the final pool XML is you are creating a pool of netfs type, for which the "--source-name" doesn't make sense, which is ignored by libvirt when formating the pool XML.

Comment 6 Osier Yang 2011-07-11 07:38:44 UTC
move to MODIFIED per above comments.

Comment 7 yuping zhang 2011-07-11 08:33:24 UTC
As comment 5,I re-test this issue with:
libvirt-0.9.3-1.el6
qemu-kvm-0.12.1.2-2.167.el6
kernel-2.6.32-164.el6

#cat pool-define.xml
<pool type='logical'>
  <name>test</name>
  <uuid>451e3a3a-0550-7e6a-9c65-aa505a86b8b1</uuid>
  <capacity>289759297536</capacity>
  <allocation>289759297536</allocation>
  <available>0</available>
  <source>
      <device path='/dev/sda5'/>
      <name>vg_dhcp93226</name>
      <format type='lvm2'/>
  </source>
  ............
</pool>

#virsh pool-define pool-define.xml
Pool test defined from pool-define.xml

# virsh pool-dumpxml test
<pool type='logical'>
  <name>test</name>
  <uuid>451e3a3a-0550-7e6a-9c65-aa505a86b8b1</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <device path='/dev/sda5'/>
    <name>vg_dhcp93226</name>
    <format type='lvm2'/>
  </source>
  ................ 
</pool>

Result:The source name and format elements exist.

virsh pool-define-as --name test --type logical --source-path='/dev/sda5' --source-name=vg_dhcp93226 --source-format=lvm2 --source-dev='/dev/sda5' --target=/dev/vg_dhcp93226 --print-xml
<pool type='logical'>
  <name>test</name>
  <source>
    <dir path='/dev/sda5'/>
    <device path='/dev/sda5'/>
    <format type='lvm2'/>
    <name>vg_dhcp93226</name>
  </source>
  <target>
    <path>/dev/vg_dhcp93226</path>
  </target>
</pool>


Result:The <format> and <name> exist in generated XML

So change the status to VERIFIED

Comment 8 errata-xmlrpc 2011-12-06 11:16:03 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.

http://rhn.redhat.com/errata/RHBA-2011-1513.html


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