Allow configuration of temp directory Nova uses

Bug #981104 reported by Rafi Khardalian
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Rafi Khardalian

Bug Description

Nova uses the default system temp directory, which may not always be sized large enough to deal with operations such as snapshots. This is common on systems which have /tmp partitioned separately so that it can be mounted with noexec and nosuid for security reasons.

I've attached a patch to add a --tempdir flag to nova, which will allow for overriding the default to explicitly set the temp directory.

Tags: ops
Revision history for this message
Rafi Khardalian (rkhardalian) wrote :
Revision history for this message
Yaguang Tang (heut2008) wrote :

openstack use gerrit for code commit.you can follow this guide http://wiki.openstack.org/HowToContribute#If_you.27re_a_developer.2C_start_here:

Changed in nova:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Tom Fifield (fifieldt) wrote :

The tempfile module here will respect any directory location set by TMPDIR, TEMP or TMP. Would it be better systems adminstration practice to encourage use of these variables, rather than adding a new configuration option at the application-level?

Revision history for this message
Michael Still (mikal) wrote :

I suspect a flag is easier for admins to use than to go off an alter the environment init starts tasks as.

tags: added: ops
Revision history for this message
Michael Still (mikal) wrote :

I don't think the attached patch goes far enough -- it doesn't address temporary files, just directories. This would be unexpected to someone who set that flag value.

Changed in nova:
assignee: nobody → Michael Still (mikalstill)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/11999

Changed in nova:
status: Triaged → In Progress
Revision history for this message
Michael Still (mikal) wrote :

The proposed patch failed to receive enough common on gerrit, so I am throwing this bug back into the queue.

Changed in nova:
assignee: Michael Still (mikalstill) → nobody
Michael Still (mikal)
Changed in nova:
status: In Progress → Triaged
Revision history for this message
Justin Shepherd (jshepher) wrote :

Setting this as a application configuration option is a fairly common practice for applications.

example: http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tmpdir

While this could be accomplished by adding ( TMPDIR|TEMP|TMP = /some/tmpdir ) to /etc/environment for Ubuntu and /etc/profile or /etc/profile.d/nova.sh for RHEL based systems.. I would hesitate to use that method as a systems administrator. I would be worried about what unintended consequences i would end up with by taking this route.. as the expected behavior for the rest of the system is to utilize /tmp for temp dirs/files..

Given that this function in nova can have huge space ramifications, the sane (from an ops perspective) approach is not to modify the global environment variables, but allow for fine grained administrator control by providing a configuration option.

Revision history for this message
Justin Shepherd (jshepher) wrote :

Michael.. if you want to re-submit, I will happily +1 this change as I have been burned a couple of times by this issue in production environments.

Changed in nova:
status: Triaged → In Progress
assignee: nobody → Rafi Khardalian (rkhardalian)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/20288

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/20288
Committed: http://github.com/openstack/nova/commit/e8386a27968f5a53f97681e7caf63b2243b7ed05
Submitter: Jenkins
Branch: master

commit e8386a27968f5a53f97681e7caf63b2243b7ed05
Author: Rafi Khardalian <email address hidden>
Date: Wed Jan 23 01:55:09 2013 +0000

    Allow users to specify a tmp location via config

    Fixes bug 981104

    Although the temporary directory used can be controlled via
    environment variables, this patch provides a way to define it
    explicitly via a config option.

    The default value is None, which behaves per the doc below:
    http://docs.python.org/2/library/tempfile.html#tempfile.tempdir

    Flags: DocImpact
    Change-Id: I47b6d8bac734f453c80d541b46086a30e847c859

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.