Bug 1245053

Summary: lvm_type = thin breaks volume creation with the LVM driver
Product: Red Hat OpenStack Reporter: Yogev Rabl <yrabl>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED ERRATA QA Contact: Prasanth Anbalagan <panbalag>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0 (Kilo)CC: eharney, panbalag, scohen, sgotliv, ssainkar, yeylon, yrabl
Target Milestone: z1Keywords: ZStream
Target Release: 7.0 (Kilo)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-cinder-2015.1.0-4.el7ost Doc Type: Bug Fix
Doc Text:
Previously, the volume creation process failed once the lvm_type parameter in the LVM driver was set to thin. This bug has been resolved by a Logical Volume Management change in the process_each_lv. There is no error reported during volume creation with lvm_type set to thin.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-03 17:56:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yogev Rabl 2015-07-21 06:56:53 UTC
Description of problem:
The volume creation process fails once the lvm_type parameter in the LVM driver is set to thin. 
The Cinder log shows the following error & trace: 
2015-07-21 09:44:40.010 14426 ERROR cinder.volume.manager [req-6e946ddb-ffdf-47a3-8877-e66f714a67f3 - - - - -] Unexpected error while running command.
Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvs --noheadings --unit=g -o vg_name,name,size --nosuffix cinder-volumes/cinder-volumes-p
ool
Exit code: 5
Stdout: u''
Stderr: u'File descriptor 7 (/dev/urandom) leaked on lvs invocation. Parent PID 14447: /usr/bin/python2\n  Failed to find logical volume "cinder-volumes/cinde
r-volumes-pool"\n'
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager Traceback (most recent call last):
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 302, in init_host
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     self.driver.check_for_setup_error()
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     return f(*args, **kwargs)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 263, in check_for_setup
_error
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     lvm_conf=lvm_conf_file)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py", line 94, in __init__
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     if self.get_volume(pool_name) is None:
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py", line 311, in get_volume
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     ref_list = self.get_volumes(name)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py", line 303, in get_volumes
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     lv_name)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py", line 285, in get_lv_info
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     out = None
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     six.reraise(self.type_, self.value, self.tb)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py", line 277, in get_lv_info
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     run_as_root=True)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager   File "/usr/lib/python2.7/site-packages/oslo_concurrency/processutils.py", line 233, in execute
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager     cmd=sanitized_cmd)
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager ProcessExecutionError: Unexpected error while running command.
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvs --noheadings --unit=g -o vg
_name,name,size --nosuffix cinder-volumes/cinder-volumes-pool
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager Exit code: 5
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager Stdout: u''
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager Stderr: u'File descriptor 7 (/dev/urandom) leaked on lvs invocation. Parent PID 14447: /usr/bin/pyth
on2\n  Failed to find logical volume "cinder-volumes/cinder-volumes-pool"\n'
2015-07-21 09:44:40.010 14426 TRACE cinder.volume.manager 

Version-Release number of selected component (if applicable):
python-cinder-2015.1.0-3.el7ost.noarch
openstack-cinder-2015.1.0-3.el7ost.noarch

How reproducible:
100% 

Steps to Reproduce:
1. Set Cinder LVM driver's paramter lvm_type = thin 
2. Create a new volume with the LVM driver

Actual results:
The volume status is error - creation fails.

Expected results:
The new volume is available and it is thin provisioned.

Comment 3 Sergey Gotliv 2015-07-21 07:56:35 UTC
Yogev,

Please, attach a full cinder volume log from your environment.

Comment 4 Eric Harney 2015-07-21 11:35:48 UTC
LVM 2.02.112+ changed a message from  "One or more specified logical volume(s) not found" to "Failed to find logical volume <x>".  This breaks our LVM command output parsing.

LVM change:   9161560 toollib: Rewrite process_each_lv.

The fix is in stable/kilo upstream.

Comment 8 errata-xmlrpc 2015-09-03 17:56:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2015:1727