nova compute race condition on truncate

Bug #731750 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya

Bug Description

The code that caches and creates the base image needs some kind of guard so that multiple greenthreads don't try to run the caching code at the same time. Specifically it is the truncate command that it is failing. Note that the offending resize only happens for images of size m1.small and greater

(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 116, in _wrap
(nova.exception): TRACE: return f(*args, **kw)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/libvirt_conn.py", line 407, in spawn
(nova.exception): TRACE: self._create_image(instance, xml)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/libvirt_conn.py", line 623, in _create_image
(nova.exception): TRACE: size=size)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/libvirt_conn.py", line 549, in _cache_image
(nova.exception): TRACE: fn(target=base, *args, **kwargs)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/libvirt_conn.py", line 561, in _fetch_image
(nova.exception): TRACE: disk.extend(target, size)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/virt/disk.py", line 52, in extend
(nova.exception): TRACE: utils.execute('truncate -s %s %s' % (size, image))
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/utils.py", line 159, in execute
(nova.exception): TRACE: cmd=cmd)
(nova.exception): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.exception): TRACE: Command: truncate -s 10737418240 /var/lib/nova/instances/_base/ami-maverick
(nova.exception): TRACE: Exit code: 1
(nova.exception): TRACE: Stdout: ''
(nova.exception): TRACE: Stderr: "truncate: cannot open `/var/lib/nova/instances/_base/ami-maverick' for writing: Permission denied\n"
(nova.exception): TRACE:

Related branches

Changed in nova:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Vish Ishaya (vishvananda)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
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.