Volumes not cleaned up on rescheduled VM deploys

Bug #1730761 reported by Tyler Blakeslee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Triaged
Medium
Unassigned

Bug Description

Description:
When attempting to deploy an instance, if the instance fails to deploy on multiple hosts, the volumes are not cleaned up after the last deploy fails. The issue appears to only affect instances which fail an initial deploy and are rescheduled, and still ultimately fail for either NoValidHost or MaxRetriesExceeded. Instances which fail the initial deploy are cleaned up correctly.

Steps to Reproduce:
 - Perform a virtual machine deploy that fails an initial deploy and attempts to reschedule.
 - Raise an error during the reschedule.

Expected Result:
 - Volumes should be cleaned up similarly to when exception are raised in nova.compute.manager.ComputeManager._build_and_run_instance().

Actual Result:
 - Volumes are not cleaned up and remain even after the virtual machine deploy fails.

Additional Notes:
In nova.conductor.manager.ComputeTaskManager.build_instances(), an exception can be raised by the call to self._schedule_instances(). If this occurs, the exception is caught, but only the networks are cleaned up. No clean up of the volumes is performed.
 - https://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L551-L565
In nova.compute.manager.ComputeManager._do_build_and_run_instance(), if an exception is raised by the call to self._build_and_run_instance() the volumes are cleaned up by a call to self._cleanup_volumes()
 - https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1854-L1866

Environment:
 - nova version: openstack-nova-16.0.0

Matt Riedemann (mriedem)
Changed in nova:
status: New → Triaged
importance: Undecided → Medium
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.