Bug 591390 - Can't remove logical volume
Can't remove logical volume
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Dave Allan
Virtualization Bugs
:
Depends On:
Blocks: Rhel6.1LibvirtTier1
  Show dependency treegraph
 
Reported: 2010-05-12 01:59 EDT by Alex Jia
Modified: 2016-04-26 09:57 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-11 11:28:25 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)

  None (edit)
Description Alex Jia 2010-05-12 01:59:12 EDT
Description of problem:
we need to focus on the following designing of the libvirt:
1.can get volume object if and only if storage pool is active
2.may remove storage volume if and only if storage pool is inactive

it seems conflict, when we destroy stroage pool, we can't get volume object,
hence,we can't also call volume object method of 'delete',finally, we can't
remove the logical volume.

Version-Release number of selected component (if applicable):
[root@dhcp-66-70-62 libvirt-test-API]# uname -a
Linux dhcp-66-70-62.nay.redhat.com 2.6.32-20.el6.x86_64 #1 SMP Tue Apr 6 13:40:08 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux

[root@dhcp-66-70-62 libvirt-test-API]# cat /etc/redhat-release 
Red Hat Enterprise Linux release 6.0 Beta (Santiago)

[root@dhcp-66-70-62 libvirt-test-API]# rpm -qa|grep libvirt
libvirt-java-devel-0.4.2-2.el6.noarch
libvirt-0.8.1-2.el6.x86_64
libvirt-python-0.8.1-2.el6.x86_64
libvirt-debuginfo-0.8.1-2.el6.x86_64
libvirt-cim-0.5.8-2.el6.x86_64
libvirt-cim-debuginfo-0.5.8-2.el6.x86_64
libvirt-java-0.4.2-2.el6.noarch
libvirt-client-0.8.1-2.el6.x86_64
libvirt-devel-0.8.1-2.el6.x86_64

[root@dhcp-66-70-62 libvirt-test-API]# rpm -qa|grep kvm
qemu-kvm-tools-0.12.1.2-2.48.el6.x86_64
qemu-kvm-debuginfo-0.12.1.2-2.48.el6.x86_64
qemu-kvm-0.12.1.2-2.48.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.create a free partition using 'fdisk' command
2.define logical type storage pool and build it
3.start the logical storage pool
4.create a logical type storage volume in the pool
5.remove the storage volume, if it is failed, jump step6
6.destroy the storage volume
7.repeat 5
  
Actual results:
neglect creation process of the logical type storage pool and volume

[root@dhcp-66-70-62 tests]# virsh pool-list
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
HostVG               active     no        
virtimages           active     no

[root@dhcp-66-70-62 tests]# virsh vol-list HostVG
Name                 Path                                    
-----------------------------------------
Swap                 /dev/HostVG/Swap

[root@dhcp-66-70-62 tests]# virsh vol-dumpxml --pool HostVG Swap
<volume>
  <name>Swap</name>
  <key>VZ4KCs-McsH-3z8U-6fGx-b2q2-XhOx-V11K4R</key>
  <source>
    <device path='/dev/sda6'>
      <extent start='0' end='4194304'/>
    </device>
  </source>
  <capacity>4194304</capacity>
  <allocation>4194304</allocation>
  <target>
    <path>/dev/HostVG/Swap</path>
    <permissions>
      <mode>0660</mode>
      <owner>0</owner>
      <group>6</group>
      <label>system_u:object_r:fixed_disk_device_t:s0</label>
    </permissions>
  </target>
</volume>

[root@dhcp-66-70-62 tests]# virsh vol-delete --pool HostVG Swap
error: Failed to delete vol Swap
error: internal error '/sbin/lvremove -f /dev/HostVG/Swap' exited with non-zero status 5 and signal 0:   Can't remove open logical volume "Swap"

[root@dhcp-66-70-62 tests]# virsh pool-destroy HostVG
Pool HostVG destroyed

[root@dhcp-66-70-62 tests]# virsh pool-list --all
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
virtimages           active     no        
dirpool              inactive   no        
HostVG               inactive   no                
nfspool              inactive   no

[root@dhcp-66-70-62 tests]# virsh vol-delete --pool HostVG Swap
error: failed to get vol 'Swap'
error: invalid storage volume pointer in no storage vol with matching path

[root@dhcp-66-70-62 tests]# lvremove -f /dev/HostVG/Swap
  Logical volume "Swap" successfully removed

Expected results:
1.can get storage volume object from inactive storage pool(defined storage pool)
or
2.can remove storage volume from active storage pool
or
fix it

Additional info:
Comment 2 RHEL Product and Program Management 2010-05-12 03:05:20 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 3 RHEL Product and Program Management 2010-05-12 03:07:26 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 4 RHEL Product and Program Management 2010-05-12 03:09:42 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 5 RHEL Product and Program Management 2010-05-12 03:12:02 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 7 Wayne Sun 2010-08-19 03:54:05 EDT
After # virsh vol-create a vol in a logical pool

# virsh vol-delete --pool pool-logical-testing vol-logical-testing
error: Failed to delete vol vol-logical-testing
error: internal error '/sbin/lvremove -f /dev/pool-logical-testing/vol-logical-testing' exited with non-zero status 5 and signal 0:   Can't remove open logical volume "vol-logical-testing"

# virsh pool-destroy pool-logical-testing
error: Failed to destroy pool pool-logical-testing
error: internal error '/sbin/vgchange -an pool-logical-testing' exited with non-zero status 5 and signal 0:   Can't deactivate volume group "pool-logical-testing" with 1 open logical volume(s)

But, after umount the vol,

# umount /tmp/logical-vol-mnt-testing

Then,

# virsh vol-delete --pool pool-logical-testing vol-logical-testing
Vol vol-logical-testing deleted

# virsh pool-destroy pool-logical-testing
Pool pool-logical-testing destroyed
Comment 8 Daniel Berrange 2010-08-19 04:10:50 EDT
This seems to be operating as designed. If you have mounted the logical volume as a filesystem, then clearly it is in use by the OS, so  vol-delete is expected to fail.
Comment 9 Dave Allan 2010-10-11 11:28:25 EDT
Agreed with comment 8; closing as NOTABUG.

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