deleting vm is failed for lvm type

Bug #1042710 reported by zhoudonshu
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Boris Filippov

Bug Description

I am using the lvm function of nova-compute , It is successful when creating the vm, but failed when deleting it

the following is failed information:
File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 869, in terminate_instance
  do_terminate_instance()
File "/usr/lib/python2.6/site-packages/nova/utils.py", line 679, in inner
  retval = f(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 862, in do_terminate_instance
  self._delete_instance(context, instance)
File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 839, in _delete_instance
  self._shutdown_instance(context, instance)
File "/usr/lib/python2.6/site-packages/nova/compute/manager.py", line 804, in _shutdown_instance
  block_device_info)
File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 498, in destroy
  self._cleanup(instance, network_info, block_device_info)
File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 564, in _cleanup
  self._cleanup_lvm(instance)
File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 568, in _cleanup_lvm
  disks = self._lvm_disks(instance)
File "/usr/lib/python2.6/site-packages/nova/virt/libvirt/driver.py", line 586, in _lvm_disks
  disk_names = filter(belongs_to_instance, os.listdir(vg))
Error: [Errno 13] Permission denied: '/dev/xenvg1'

this error show that nova-compute process whch runned in nova user has not Permission for vgs directory /dev/xenvg1

# ls -l /dev/
drwx------ 2 root root 80 Aug 28 17:13 xenvg1

Can I must use the chmod command to change the permission of vg directory ?
 I think this problem may be one bug ,because creating vg ,the default permission is drwx------

my nova.conf about lvm :

libvirt_images_type=lvm
libvirt_images_volume_group=xenvg1

Changed in nova:
status: New → Confirmed
Revision history for this message
Boris Filippov (bfilippov) wrote :

You're right. This is a bug, because lvm creation/deletion goes through rootwrap anyway, and compute user doesn't neccessary have permission to list /dev/vg directory.

Changed in nova:
assignee: nobody → Boris Filippov (bfilippov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12478

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12478
Committed: http://github.com/openstack/nova/commit/08f172bb6c14f75171ac29e1c257f9581202b7e9
Submitter: Jenkins
Branch: master

commit 08f172bb6c14f75171ac29e1c257f9581202b7e9
Author: Boris Filippov <email address hidden>
Date: Thu Sep 6 04:00:41 2012 +0400

    Use lvs instead of os.listdir in _cleanup_lvm

    Compute user may not have permission to list /dev/<VolGroup>
    directory. This results in error during instance cleanup and not
    deleted lvm images, if libvirt driver use lvm images backend.
    To prevent this, _cleanup_lvm use lvs command instead of os.listdir.

    This fixes bug 1042710

    Change-Id: I82ab4ca5ba3320f50c84e23839fcf6ed8f02be8c

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.