Bug 509306 - virsh vol-path and vol-delete commands don't support "name" parameter
virsh vol-path and vol-delete commands don't support "name" parameter
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt (Show other bugs)
5.4
All Linux
low Severity medium
: rc
: ---
Assigned To: Dave Allan
Virtualization Bugs
:
: 530990 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-02 01:49 EDT by Alex Jia
Modified: 2016-04-26 09:49 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 04:10:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0205 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2010-03-29 08:27:37 EDT

  None (edit)
Description Alex Jia 2009-07-02 01:49:55 EDT
Description of problem:


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


How reproducible:
[root@dhcp-66-70-18 ~]# cat pool.xml
<pool type='netfs'>
  <name>nfspool</name>
  <uuid>9f5a6a81-ede9-1874-b0aa-ff4227165d75</uuid>
  <capacity>0</capacity>
  <allocation>0</allocation>
  <available>0</available>
  <source>
    <host name='10.66.71.226'/>
    <dir path='/vol/libvirt1/auto'/>
    <format type='auto'/>
  </source>
  <target>
    <path>/var/lib/xen/images</path>
    <permissions>
      <mode>0700</mode>
      <owner>0</owner>
      <group>0</group>
    </permissions>
  </target>
</pool>

[root@dhcp-66-70-18 ~]# cat vol.xml
<volume>
  <name>virtimage</name>
  <key>/var/lib/xen/images/virtimage</key>
  <source>
  </source>
  <capacity>10737418240</capacity>
  <allocation>2210500608</allocation>
  <target>
    <path>/var/lib/xen/images/virtimage</path>
    <format type='raw'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:nfs_t</label>
    </permissions>
  </target>
</volume>

[root@dhcp-66-70-18 ~]# virsh pool-define pool.xml
Pool nfspool defined from pool.xml

[root@dhcp-66-70-18 ~]# virsh pool-start nfspool
Pool nfspool started
[root@dhcp-66-70-18 ~]# virsh vol-create nfspool vol.xml
Vol virtimage created from vol.xml

[root@dhcp-66-70-18 ~]# virsh pool-list
Name                 State      Autostart
-----------------------------------------
default              active     yes
nfspool              active     no

[root@dhcp-66-70-18 ~]# virsh vol-list nfspool
Name                 Path
-----------------------------------------
virtimage            /var/lib/xen/images/virtimage

[root@dhcp-66-70-18 ~]# virsh vol-path virtimage
error: failed to get vol 'virtimage'
error: invalid storage volume pointer in no storage vol with matching path

[root@dhcp-66-70-18 ~]# virsh vol-path /var/lib/xen/images/virtimage
/var/lib/xen/images/virtimage

[root@dhcp-66-70-18 ~]# virsh vol-delete virtimage
error: failed to get vol 'virtimage'
error: invalid storage volume pointer in no storage vol with matching path

[root@dhcp-66-70-18 ~]# virsh vol-delete /var/lib/xen/images/virtimage
Vol /var/lib/xen/images/virtimage deleted


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


Expected results:


Additional info:
[root@dhcp-66-70-18 ~]# virsh help vol-path
  NAME
    vol-path - convert a vol UUID to vol path

  SYNOPSIS
    vol-path [--pool <string>] <vol>

  OPTIONS
    --pool <string>  pool name or uuid
    <vol>            vol name or key

[root@dhcp-66-70-18 ~]# virsh help vol-delete
  NAME
    vol-delete - delete a vol

  SYNOPSIS
    vol-delete [--pool <string>] <vol>

  DESCRIPTION
    Delete a given vol.

  OPTIONS
    --pool <string>  pool name or uuid
    <vol>            vol name, key or path



[root@dhcp-66-70-18 ~]# virsh -h|grep vol
    vol-create      create a vol from an XML file
    vol-create-as   create a volume from a set of args
    vol-delete      delete a vol
    vol-dumpxml     vol information in XML
    vol-info        storage vol information
    vol-list        list vols
    vol-path        convert a vol UUID to vol path
    vol-name        convert a vol UUID to vol name
    vol-key         convert a vol UUID to vol key

In addition:

in the above,"convert a vol UUID to vol .." notes seems incorrect,and it should be that "convert vol name or key to vol path".
Comment 1 Alex Jia 2009-07-02 01:53:05 EDT
[root@dhcp-66-70-18 ~]# uname -a
Linux dhcp-66-70-18.nay.redhat.com 2.6.18-156.el5xen #1 SMP Mon Jun 29 18:24:43 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-18 ~]# rpm -qa|grep libvirt
libvirt-0.6.3-13.el5
libvirt-debuginfo-0.6.3-12.el5
libvirt-python-0.6.3-13.el5
libvirt-devel-0.6.3-13.el5
Comment 2 Alex Jia 2009-07-02 02:14:28 EDT
virsh vol-delete commands support "name" parameter,we need to add "pool" optons
such as:
[root@dhcp-66-70-18 ~]# virsh vol-delete --pool nfspool virtimage
Vol virtimage deleted
Comment 3 Dave Allan 2009-07-02 13:58:08 EDT
I don't think this should go into 5.4 at this point in the release.
Comment 4 Dave Allan 2009-12-11 17:01:43 EST
Patch posted upstream at:

https://www.redhat.com/archives/libvir-list/2009-December/msg00278.html

applies cleanly.  RHEL5.5 behavior is identical to upstream head.
Comment 5 Daniel Veillard 2009-12-15 10:48:47 EST
libvirt-0.6.3-25.el5 has been built in dist-5E-qu-candidate with the fix,

Daniel
Comment 7 Alex Jia 2009-12-16 04:10:39 EST
1.
[root@dhcp-66-70-91 xml]# virsh vol-list nfspool
Name                 Path                                    
-----------------------------------------
fedora11.img         /var/lib/libvirt/images/fedora11.img
rhel5u4_x86_64_kvm.img /var/lib/libvirt/images/rhel5u4_x86_64_kvm.img  
virtimage            /var/lib/libvirt/images/virtimage 

2.
[root@dhcp-66-70-91 xml]# virsh help vol-path
  NAME
    vol-path - convert a vol UUID to vol path

  SYNOPSIS
    vol-path [--pool <string>] <vol>

  OPTIONS
    --pool <string>  pool name or uuid
    <vol>            vol name or key

3.
[root@dhcp-66-70-91 xml]# virsh vol-path virtimage
error: failed to get vol 'virtimage'
error: invalid storage volume pointer in no storage vol with matching path

4.
[root@dhcp-66-70-91 xml]# virsh help vol-delete
  NAME
    vol-delete - delete a vol

  SYNOPSIS
    vol-delete [--pool <string>] <vol>

  DESCRIPTION
    Delete a given vol.

  OPTIONS
    --pool <string>  pool name or uuid
    <vol>            vol name, key or path

5.
[root@dhcp-66-70-91 xml]# virsh vol-delete virtimage
error: failed to get vol 'virtimage'
error: invalid storage volume pointer in no storage vol with matching path


Additional information:
[root@dhcp-66-70-91 xml]# uname -a
Linux dhcp-66-70-91.nay.redhat.com 2.6.18-164.el5xen #1 SMP Tue Aug 18 15:59:52 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-91 xml]# rpm -qa|grep libvirt
libvirt-debuginfo-0.6.3-25.el5
libvirt-0.6.3-25.el5
libvirt-python-0.6.3-25.el5
Comment 8 Dave Allan 2009-12-16 08:49:28 EST
You have to specify the --pool <name of pool> argument if you specify the volume by name.  Volume names are only unique within a pool.
Comment 9 zhanghaiyan 2009-12-17 01:25:00 EST
This bug has been verified with libvirt 0.6.3-25.el5 on RHEL-5.4.but I haven't
permission change bug status to verified now.I will change bug statUs to 'VERIFIED' if I have.  

In addition, vol-delete operation led to libvirt daemon dead, I need to report 
a new bug.


[root@dhcp-66-70-91 libvirt]# virsh pool-create pool-dir.xml 
Pool dirpool created from pool-dir.xml

[root@dhcp-66-70-91 libvirt]# virsh vol-create dirpool vol.xml 
Vol virtimage created from vol.xml

[root@dhcp-66-70-91 libvirt]# virsh vol-list dirpool
Name                 Path                                    
-----------------------------------------     
virtimage            /var/lib/libvirt/images/virtimage 

[root@dhcp-66-70-91 libvirt]# virsh vol-path --pool dirpool virtimage
/var/lib/libvirt/images/virtimage

[root@dhcp-66-70-91 libvirt]# virsh vol-delete --pool dirpool virtimage
error: Failed to delete vol virtimage
error: server closed connection

[root@dhcp-66-70-91 libvirt]# service libvirtd status
libvirtd dead but pid file exists


Addition information:
1.pool-dir.xml
<pool type="dir">
  <name>dirpool</name>
  <target>
    <path>/var/lib/libvirt/images</path>
  </target>
</pool>


2.vol.xml
<volume>
  <name>virtimage</name>
  <key>/var/lib/virt/images/virtimage</key>
  <source>
  </source>
  <capacity>10737418240</capacity>
  <allocation>142512128</allocation>
  <target>
    <path>/var/lib/virt/images/virtimage</path>
    <format type='raw'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:nfs_t</label>
    </permissions>
  </target>
</volume>
Comment 10 Dave Allan 2009-12-21 15:56:44 EST
*** Bug 530990 has been marked as a duplicate of this bug. ***
Comment 11 Alex Jia 2009-12-29 03:19:34 EST
This bug has been verified with libvirt 0.6.3-25.el5 on RHEL-5.5.Already
fixed, set status to VERIFIED. 

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 bug]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.18-183.el5xen #1 SMP Mon Dec 21 18:46:14 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[root@dhcp-66-70-62 bug]# rpm -qa|grep libvirt
libvirt-0.6.3-25.el5
libvirt-python-0.6.3-25.el5
libvirt-debuginfo-0.6.3-25.el5
[root@dhcp-66-70-62 bug]# rpm -qa|grep xen
xen-libs-3.0.3-102.el5
xen-devel-3.0.3-102.el5
kmod-gnbd-xen-0.1.5-2.el5
kmod-gfs-xen-0.1.34-9.el5
xen-3.0.3-102.el5
xen-libs-3.0.3-102.el5
kernel-xen-2.6.18-183.el5
kmod-cmirror-xen-0.1.22-3.el5


Steps to Reproduce:
[root@dhcp-66-70-62 ~]# cat pool-dir.xml
<pool type="dir">
  <name>dirpool</name>
  <target>
    <path>/var/lib/xen/images</path>
  </target>
</pool>

[root@dhcp-66-70-62 ~]# cat vol.xml
<volume>
  <name>virtimage</name>
  <key>/var/lib/xen/images/virtimage</key>
  <source>
  </source>
  <capacity>10737418240</capacity>
  <allocation>142512128</allocation>
  <target>
    <path>/var/lib/xen/images/virtimage</path>
    <format type='raw'/>
    <permissions>
      <mode>0600</mode>
      <owner>0</owner>
      <group>0</group>
      <label>system_u:object_r:nfs_t</label>
    </permissions>
  </target>
</volume>

[root@dhcp-66-70-62 ~]# virsh pool-list --all
Name                 State      Autostart
-----------------------------------------

[root@dhcp-66-70-62 ~]# virsh pool-create pool-dir.xml
Pool dirpool created from pool-dir.xml

[root@dhcp-66-70-62 ~]# virsh pool-list --allName                 State      Autostart
-----------------------------------------
dirpool              active     no

[root@dhcp-66-70-62 ~]# virsh vol-create dirpool vol.xml
Vol virtimage created from vol.xml

[root@dhcp-66-70-62 ~]# virsh vol-list dirpool
Name                 Path
-----------------------------------------
rhel5u5_x86_64_xenfv.img /var/lib/xen/images/rhel5u5_x86_64_xenfv.img
rhel5u5_x86_64_xenpv.img /var/lib/xen/images/rhel5u5_x86_64_xenpv.img
virtimage            /var/lib/xen/images/virtimage

[root@dhcp-66-70-62 ~]# virsh vol-path --pool dirpool virtimage
/var/lib/xen/images/virtimage

[root@dhcp-66-70-62 ~]# virsh vol-delete --pool dirpool virtimage
error: Failed to delete vol virtimage
error: server closed connection

Libvirtd is hang by 'virsh vol-delete',this is a another bug:
https://bugzilla.redhat.com/show_bug.cgi?id=510450
Comment 16 errata-xmlrpc 2010-03-30 04:10:44 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0205.html

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