xenapi: stop races when creating a cached image

Bug #1226073 reported by John Garbutt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
John Garbutt

Bug Description

Currently, when creating an instanced from a cached image there is a race where we can end up fetching the wrong base image, leading to the creation of a bushier VHD chain that should be possible.

We should us a mutex to stop some of these issues.

Tags: xenserver
Changed in nova:
status: Triaged → In Progress
Revision history for this message
John Garbutt (johngarbutt) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit ce8e95c7a3fe9d94d6b03ee70c147e5e92aa3b5b
Author: John Garbutt <email address hidden>
Date: Fri Sep 13 17:04:06 2013 +0100

    xenapi: stop using get_all_vdis_in_sr in spawn

    Currently when trying to find a cached image, the very expensive call to
    get_all_vdis_in_sr is used, where we could instead fetch the VDI
    directly using a more targeted query.

    Now we are fetching the VDI by name_label we must ensure to clear the
    name_label on newly created VDIs to ensure they do not get picked up by
    later calls to _find_cached_image().

    Fixes bug 1221292

    The above code that checks for _find_cached_images has race conditions
    where its possible to end up with two VDIs returned. To stop this
    happening the code to create the cached images is now synchronized on
    the image being fetched.

    Fixes bug 1226073

    Change-Id: I534fb8f42b00b5d39dc17dd5fee297144b5f379a

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.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.