Steps to reproduce
--
libvirt_type=lxc to choose LXC as hypervisor type
libvirt_images_type=lvm to choose LVM as imagebackend store
nova boot container1
nova boot container2
nova delete container1
Expected result
--
Nicely destroy container and remove LVM disk
Actual result
--
libvirt driver fail to remove LVM disk due to device mapper error: "device-mapper: remove ioctl on failed: Device or resource busy"
Logs
--
2012-12-18 14:01:46 ERROR nova.openstack.common.rpc.amqp [-] Exception during message handling
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/openstack/common/rpc/amqp.py", line 276, in _process_data
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/exception.py", line 117, in wrapped
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/exception.py", line 92, in wrapped
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp return f(*args, **kw)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/compute/manager.py", line 196, in decorated_function
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp kwargs['instance']['uuid'], e, sys.exc_info())
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/compute/manager.py", line 190, in decorated_function
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/compute/manager.py", line 945, in terminate_instance
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp do_terminate_instance(instance)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/utils.py", line 760, in inner
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp retval = f(*args, **kwargs)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/compute/manager.py", line 937, in do_terminate_instance
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp self._delete_instance(context, instance)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/compute/manager.py", line 890, in _delete_instance
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp self._shutdown_instance(context, instance)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/compute/manager.py", line 854, in _shutdown_instance
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp block_device_info)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/virt/libvirt/driver.py", line 498, in destroy
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp self._cleanup(instance, network_info, block_device_info)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/virt/libvirt/driver.py", line 574, in _cleanup
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp self._cleanup_lvm(instance)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/virt/libvirt/driver.py", line 580, in _cleanup_lvm
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp libvirt_utils.remove_logical_volumes(*disks)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/virt/libvirt/utils.py", line 156, in remove_logical_volumes
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp execute(*lvremove, attempts=3, run_as_root=True)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/virt/libvirt/utils.py", line 53, in execute
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp return utils.execute(*args, **kwargs)
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp File "/home/stack/nova/nova/utils.py", line 206, in execute
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp cmd=' '.join(cmd))
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp ProcessExecutionError: Unexpected error while running command.
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp Command: sudo /usr/bin/nova-rootwrap /etc/nova/rootwrap.conf lvremove -f /dev/xenvg/instance-00000589_disk
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp Exit code: 5
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp Stdout: ''
2012-12-18 14:01:46 TRACE nova.openstack.common.rpc.amqp Stderr: ' device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n device-mapper: remove ioctl on failed: Device or resource busy\n Unable to deactivate lxcvg-instance--00000589_disk (253:5)\n Unable to deactivate logical volume "instance-00000589_disk"\n'
Fix proposed to branch: master /review. openstack. org/18309
Review: https:/