xenapi doesn't fully clean up on build failures

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

Bug Description

The build process in xenapi has an Undo manager. As steps are executed, methods to undo are registered. If there's a failure at any point, Undo methods are called for the *previous* calls. This means that if there's a failure in a step, that step also needs to make sure to clean itself up if needed.

The create_vm_step() calls _create_vm()... does a number of things. It creates the VM record, attaches disks, etc. Unfortunately, if there's a failure when attaching disks, it does not remove the VM record. (I didn't check, but I'm not sure if it cleans up any disks that succeeded in attaching, also.)

We need to make _create_vm() clean up the VM record if any disks fail to attach... including detaching disks that succeeded, etc. The undo manager does not work for this, because it assumes the whole step failed such that there's nothing to clean up. (Other possible solution is to perhaps breakup the create_vm_step() into multiple steps)

Chris Behrens (cbehrens)
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
Chris Behrens (cbehrens)
Changed in nova:
assignee: nobody → Chris Behrens (cbehrens)
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/15054

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

Reviewed: https://review.openstack.org/15054
Committed: http://github.com/openstack/nova/commit/78ebce99803522ceb98754f2765386f39858b627
Submitter: Jenkins
Branch: master

commit 78ebce99803522ceb98754f2765386f39858b627
Author: Chris Behrens <email address hidden>
Date: Tue Oct 30 18:33:18 2012 +0000

    Clean up xenapi VM records on failed disk attaches

    Breaks the create_vm_step up so that we can clean up the VM record in
    case of disk attach failures.

    Fixes bug 1073219

    Change-Id: I54e28e2cce6fe4f29a03566eff998479410f7555

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