Bug 1001821

Summary: Set sane default for image_conversion_dir
Product: Red Hat OpenStack Reporter: Eric Harney <eharney>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED ERRATA QA Contact: Tzach Shefi <tshefi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0CC: abaron, ddomingo, eharney, fsimonce, hateya, yeylon
Target Milestone: beta   
Target Release: 4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-cinder-2013.2-0.11.rc1.el6ost Doc Type: Bug Fix
Doc Text:
During image conversion, the Block Storage service originally stored temporary files under /tmp. With this release, the Block Storare service will store temporary files to /var/lib/cinder/conversion/ instead. This was done to address security and space allocation concerns.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-20 00:21:46 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 Eric Harney 2013-08-27 20:35:50 UTC
Description of problem:
image_conversion_dir in Cinder defaults to /tmp, which I suspect is not what we want.  Should probably use something like $state_path/conversions/ as the default in cinder-dist.conf.

Version-Release number of selected component (if applicable):
Any RHOS openstack-cinder

Steps to Reproduce:
1.  cinder create --image-id <asdf> 1 from an image that is a format other than raw
2.  Observe files created in /tmp during this process


A fix may go upstream for Havana for this, if not, we should configure it ourselves.

Comment 1 Ayal Baron 2013-09-08 11:51:14 UTC
Eric,

Looks to me like this should be downstream only until qemu-img supports streaming at which point this would not be required at all.

Fede, any update on qemu-img streaming support?

Comment 2 Eric Harney 2013-09-13 18:57:56 UTC
Upstream has agreed that this makes sense, see the comments in the linked LP bug.  The only thing changing here is the default directory used.

Comment 3 Eric Harney 2013-09-16 13:47:21 UTC
Upstream Havana now defaults to $state_path/conversion.

Comment 5 Scott Lewis 2013-11-19 16:54:18 UTC
Auto adding >= MODIFIED bugs to beta

Comment 8 Tzach Shefi 2013-12-19 12:47:16 UTC
Setup (AIO):
 RHEL 6.5
 python-cinderclient-1.0.7-1.el6ost.noarch
 openstack-cinder-2013.2-9.el6ost.noarch
 python-cinder-2013.2-9.el6ost.noarch
 
Command used
cinder create --image-id cb704d91-06e1-4f6a-b357-b34e273f3ea6 5

Image source format qcow2 

Ran a few tests with several source images & volume sizes. 
None of the tests produced temp conversion files under /tmp/ or /var/lib/cinder/. 

Do you have suggestions on how to reproduce the problem? 
Or may I close this bug as verrifed, seeing as i don't get any temp files under /var/lib/cinder/  (or /tmp).

Thanks

Comment 9 Eric Harney 2013-12-19 15:28:37 UTC
Tzach,

It is likely that the command is finishing and deleting the temp file before you notice it there.  I tested with a qcow2 image.

To verify, I'd suggest:

Set debug=True in cinder.conf and restart the cinder volume service.


# ls /var/lib/cinder/
# rmdir /var/lib/cinder/conversion 
  (won't be present if you haven't run one before)
# cinder create --image-id 679bf56b-9080-4d25-8bce-0ff182172677 1
# ls /var/lib/cinder/conversion/
  (now exists but is empty unless you catch it during the conversion itself)

# grep conversion /var/log/cinder/volume.log
Running cmd (subprocess): sudo cinder-rootwrap /etc/cinder/rootwrap.conf qemu-img convert -O raw /var/lib/cinder/conversion/tmpxA5dqw /dev/mapper/cinder--volumes-volume--6277a392--8c14--4c7b--8802--984d509ed587

(Matching your new volume UUID.)

Comment 12 errata-xmlrpc 2013-12-20 00:21:46 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.

http://rhn.redhat.com/errata/RHEA-2013-1859.html