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.

Bug 718143

Summary: pool-define and pool-define-as ingores the --source-name and --source-format
Product: Red Hat Enterprise Linux 6 Reporter: Osier Yang <jyang>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: dallan, dyuan, mzhan, rwu, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-0.9.3-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:16:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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