Ironic virt driver in Nova calls destroy unnecessarily if spawn fails

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

Bug Description

To give some context, calling destroy [5] was added as a bug fix [1]. It was required back then because, Nova compute was not calling destroy on catching the exception [2]. But now, Nova compute catches all exceptions that happen during spawn and calls destroy (_shutdown_instance) [3]

Since Nova compute is already taking care of destroying the instance before rescheduling, we shouldn't have to call destroy separately in the driver. I confirmed in logs that destroy gets called twice if there is any failure during _wait_for_active() [4] or timeout happens [5]

[1] https://review.openstack.org/#/c/99519/
[2] https://github.com/openstack/nova/blob/2014.1.5/nova/compute/manager.py#L2116-L2118
[3] https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L2171-L2191
[4] https://github.com/openstack/nova/blob/master/nova/virt/ironic/driver.py#L431-L462
[5] https://github.com/openstack/nova/blob/master/nova/virt/ironic/driver.py#L823-L836

Tags: ironic
affects: nova-hyper → nova
Changed in nova:
assignee: nobody → Shraddha Pandhe (shraddha-pandhe)
Michael Davies (mrda)
Changed in nova:
importance: Undecided → Low
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/240357

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

Reviewed: https://review.openstack.org/240357
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a36001fbee4ac039a9121127f7b9daa7f24a0acc
Submitter: Jenkins
Branch: master

commit a36001fbee4ac039a9121127f7b9daa7f24a0acc
Author: Shraddha Pandhe <email address hidden>
Date: Fri Oct 30 00:38:18 2015 +0000

    Remove unnecessary destroy call from Ironic virt driver

    To give some context, calling destroy [5] was added as a
    bug fix [1]. It was required back then because, Nova compute
    was not calling destroy on catching the exception [2]. But now,
    Nova compute catches all exceptions that happen during spawn
    and calls destroy (_shutdown_instance) [3]

    Since Nova compute is already taking care of destroying the
    instance before rescheduling, we shouldn't have to call destroy
    separately in the driver. I confirmed in logs that destroy gets
    called twice if there is any failure during
    _wait_for_active() [4] or timeout happens [5]

    [1] https://review.openstack.org/#/c/99519/
    [2] https://github.com/openstack/nova/blob/2014.1.5/nova/compute/manager.py#L2116-L2118
    [3] https://github.com/openstack/nova/blob/2015.1.2/nova/compute/manager.py#L2472-L2497
    [4] https://github.com/openstack/nova/blob/2015.1.2/nova/virt/ironic/driver.py#L359-L384
    [5] https://github.com/openstack/nova/blob/2015.1.2/nova/virt/ironic/driver.py#L730-L741

    Closes-Bug: #1506234

    Change-Id: I09da7910befc4167d9cf043d12b19432ed70bcac

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0b1

This issue was fixed in the openstack/nova 13.0.0.0b1 development milestone.

Changed in nova:
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