Bug 1001821 - Set sane default for image_conversion_dir
Set sane default for image_conversion_dir
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: beta
: 4.0
Assigned To: Eric Harney
Tzach Shefi
Depends On:
  Show dependency treegraph
Reported: 2013-08-27 16:35 EDT by Eric Harney
Modified: 2016-04-26 12:13 EDT (History)
6 users (show)

See Also:
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:
Last Closed: 2013-12-19 19:21:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1217552 None None None Never
OpenStack gerrit 46500 None None None Never

  None (edit)
Description Eric Harney 2013-08-27 16:35:50 EDT
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 07:51:14 EDT

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 14:57:56 EDT
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 09:47:21 EDT
Upstream Havana now defaults to $state_path/conversion.
Comment 5 Scott Lewis 2013-11-19 11:54:18 EST
Auto adding >= MODIFIED bugs to beta
Comment 8 Tzach Shefi 2013-12-19 07:47:16 EST
Setup (AIO):
 RHEL 6.5
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).

Comment 9 Eric Harney 2013-12-19 10:28:37 EST

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-19 19:21:46 EST
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.


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