Red Hat Bugzilla – Bug 1001821
Set sane default for image_conversion_dir
Last modified: 2016-04-26 12:13:01 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.
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?
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.
Upstream Havana now defaults to $state_path/conversion.
Auto adding >= MODIFIED bugs to beta
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).
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.)
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.