Hide Forgot
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:
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.
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.
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.
move to MODIFIED per above comments.
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
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