Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 552452

Summary: Can't create logical type storage pool from xml
Product: Red Hat Enterprise Linux 5 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 5.5CC: crobinso, llim, virt-maint, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-07 07:58:41 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 Alex Jia 2010-01-05 06:05:55 UTC
Description of problem:
Can't create logical type storage pool from xml

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 ~]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5 #1 SMP Mon Dec 21 18:37:42 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 ~]# lsmod|grep kvm
kvm_intel              86664  0 
kvm                   223648  2 ksm,kvm_intel
[root@dhcp-66-70-62 ~]# rpm -qa|grep libvirt
libvirt-0.6.3-28.el5
libvirt-debuginfo-0.6.3-28.el5
libvirt-python-0.6.3-28.el5
[root@dhcp-66-70-62 ~]# rpm -qa|grep kvm
kvm-tools-83-140.el5
kvm-qemu-img-83-140.el5
etherboot-zroms-kvm-5.4.4-13.el5
kvm-83-140.el5
etherboot-roms-kvm-5.4.4-13.el5
kmod-kvm-83-140.el5


How reproducible:
always

Steps to Reproduce:
1.editor logical type pool xml file, such as pool-logical.xml
2.virsh pool-create pool-logical.xml
  
Actual results:
error: Failed to create pool from pool-logical.xml
error: internal error '/usr/sbin/vgchange -ay HostVG' exited with non-zero status 5 and signal 0:   Volume group "HostVG" not found

Expected results:
logical type pool can be create correctly.

Additional info:[root@dhcp-66-70-62 storagepoolschemadata]# cat pool-logical.xml 
<pool type='logical'>
  <name>HostVG</name>
  <uuid>1c13165a-d0f4-3aee-b447-30fb38789091</uuid>
  <capacity>99891544064</capacity>
  <allocation>99220455424</allocation>
  <available>671088640</available>
  <source>
    <name>HostVG</name>
    <format type='lvm2'/>
  </source>
  <target>
    <path>/dev/HostVG</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>
[root@dhcp-66-70-62 storagepoolschemadata]# virt-xml-validate pool-logical.xml 
pool-logical.xml validates
[root@dhcp-66-70-62 storagepoolschemadata]# virsh pool-create pool-logical.xml
error: Failed to create pool from pool-logical.xml
error: internal error '/usr/sbin/vgchange -ay HostVG' exited with non-zero status 5 and signal 0:   Volume group "HostVG" not found

Comment 1 Lawrence Lim 2010-01-05 06:53:28 UTC
Raising an exception as its a test blocker for Bug 509979 (5.5 approved).

Comment 2 Daniel Veillard 2010-01-06 13:43:30 UTC
The report doesn't indicate if the LVM already exists. The
pool-create operation won't build the volume group you need to use
the pool-build operation to actually construct the VG,

Daniel

Comment 3 Cole Robinson 2010-01-06 14:16:41 UTC
I don't think this is blocking any testing (I've put my reasoning in 509979).

Comment 4 Alex Jia 2010-01-07 07:53:59 UTC
(In reply to comment #3)
> I don't think this is blocking any testing (I've put my reasoning in 509979).  

Hi,Cole,you are right,this can't block bug 509979.thank you.

Alex

Comment 5 Alex Jia 2010-01-07 07:57:46 UTC
(In reply to comment #2)
> The report doesn't indicate if the LVM already exists. The
> pool-create operation won't build the volume group you need to use
> the pool-build operation to actually construct the VG,
> 
> Daniel  

Hi,Daniel,it's my wrong,I missed vg creation process and I retest it,the result is successful.

Comment 6 Alex Jia 2010-01-07 07:58:41 UTC
I retest it,logical type pool can be created successfully,so this bug isn't a bug,thank you.


Steps to Reproduce:
1.create a new partition - such as fdisk /dev/sda
2.initialize a disk or partition - such as pvcreate /dev/sda10
3.create a volume group HostVG - such as vgcreate HostVG /dev/sda10
4.editor pool-logical xml
5.virsh pool-create pool-logical.xml

[root@dhcp-66-70-173 storagepoolschemadata]# virsh pool-create pool-logical.xml
Pool HostVG created from pool-logical.xml

[root@dhcp-66-70-173 storagepoolschemadata]# virsh pool-list --all
Name                 State      Autostart
-----------------------------------------
HostVG               active     no

[root@dhcp-66-70-173 storagepoolschemadata]# virsh pool-dumpxml HostVG
<pool type='logical'>
  <name>HostVG</name>
  <uuid>1c13165a-d0f4-3aee-b447-30fb38789091</uuid>
  <capacity>1027604480</capacity>
  <allocation>0</allocation>
  <available>1027604480</available>
  <source>
    <name>HostVG</name>
    <format type='lvm2'/>
  </source>
  <target>
    <path>/dev/HostVG</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>


Version-Release number of selected component (if applicable):
[root@dhcp-66-70-173 ~]# uname -a
Linux dhcp-66-70-173.nay.redhat.com 2.6.18-183.el5 #1 SMP Mon Dec 21 18:37:42 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-173 ~]# lsmod|grep kvm
kvm_intel              86664  0
kvm                   223648  2 ksm,kvm_intel
[root@dhcp-66-70-173 ~]# rpm -qa|grep libvirt
libvirt-debuginfo-0.6.3-29.el5
libvirt-python-0.6.3-29.el5
libvirt-0.6.3-29.el5
[root@dhcp-66-70-173 ~]# rpm -qa|grep kvm
kvm-tools-83-140.el5
kvm-qemu-img-83-140.el5
kmod-kvm-83-140.el5