[Openstack] How do I stop image-create from using /tmp?

Boris Filippov bfilippov at griddynamics.com
Sat Jun 30 11:36:03 UTC 2012


As I remember, destination directory for snapshot is created by mkdtemp.
What module documantation says about default temp directory:

tempfile.tempdir
When set to a value other than None, this variable defines the default
value for the dir argument to all the functions defined in this
module.
If tempdir is unset or None at any call to any of the above functions,
Python searches a standard list of directories and sets tempdir to the
first one which the calling user can create files in. The list is:
The directory named by the TMPDIR environment variable.
The directory named by the TEMP environment variable.
The directory named by the TMP environment variable.
A platform-specific location:On RiscOS, the directory named by the
Wimp$ScrapDir environment variable.
On Windows, the directories C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order.
On all other platforms, the directories /tmp, /var/tmp, and /usr/tmp,
in that order.
As a last resort, the current working directory.

(http://docs.python.org/library/tempfile.html)

So, maybe setting any of this environment variables for nova-compute
to desired value sholuld help.


2012/6/30 Lars Kellogg-Stedman <lars at seas.harvard.edu>
>
> I'm running "nova image-create" for the first time, and on the compute
> node I see:
>
>   qemu-img convert -f qcow2 -O qcow2 -s 98a8efe9ec114b489eb163c64661441a
>     /virt/pools/openstack_2/instance-00000011/disk
>     /tmp/tmpH9KkUZ/98a8efe9ec114b489eb163c64661441a
>
> I am concerned to see this operation dropping a disk image into /tmp.
> What if the disk image is larger than the root filesystem?  Is there a
> way to have OpenStack put these temporary images somewhere else?  I
> would prefer instance_dir by default, instead of /tmp, because
> instance_dir has already been provisioned with enough space to meet
> the needs of disk images, but an explicit parameter would probably be
> a better option.
>
> --
> Lars Kellogg-Stedman <lars at seas.harvard.edu>       |
> Senior Technologist                                | http://ac.seas.harvard.edu/
> Academic Computing                                 | http://code.seas.harvard.edu/
> Harvard School of Engineering and Applied Sciences |
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack at lists.launchpad.net
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp




More information about the Openstack mailing list