VFAT config drive

Bug #1092560 reported by Ricardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Michael Still

Bug Description

Trying to spawn an instace with config drive formatted as a VFAT disk fails with error "/bin/chown: changing ownership of `/tmp/cd_mnt_XXXXXX': Operation not permitted\n". A snippet of nova-compute.log: http://paste.openstack.org/show/28444/

The error happens in the /usr/lib/python2.7/dist-packages/nova/virt/configdrive.py file, method _make_vfat, line 116. The issue is caused by the attempt to chown a mounted vfat partition. As far as I have tested, this cannot be done even by root, even though it can be done with other filesystems such as ext3.

To fix the issue all that it takes is to remove the problematic chown call altogether and to include two additional options to the mount command: uid=<nova_uid>,gid=<nova_gid>. My own fix:

            _out, err = utils.trycmd('mount', '-o', 'loop,uid=%s,gid=%s' % (os.getuid(), os.getgid()), path, mountdir,
                                     run_as_root=True)

I'm using Ubuntu 12.04 with Folsom and python-nova package version 2012.2+git201210091907~precise-0ubuntu1.

Michael Still (mikal)
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
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/19569

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

Thanks for the detailed bug report, it made this bug super easy to fix.

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

Reviewed: https://review.openstack.org/19569
Committed: http://github.com/openstack/nova/commit/60b38f1c8279db935a45c873fb1a072209f12061
Submitter: Jenkins
Branch: master

commit 60b38f1c8279db935a45c873fb1a072209f12061
Author: Michael Still <email address hidden>
Date: Sun Jan 13 17:36:10 2013 +1100

    Chown doesn't work on mounted vfat.

    As reported by a user. Resolves bug 1092560.

    Change-Id: I44c847d5e7f3242ca46a7436bcbc6e519baa88fc

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.