instance.host not cleared after reschedule

Bug #1427944 reported by Joe Cropper
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Joe Cropper

Bug Description

For example, take this scenario:

1. Assume an environment with a single host… call it host-1
2. Deploy a VM, but force an exception in the spawn path somewhere to simulate some "hypervisor error”
3. The scheduler correctly attempts to reschedule the VM, and ultimately ends up (correctly) with a NoValidHost error because there was only 1 host
4. However, the instance.host (e.g., [nova show <vm>]) is still showing ‘host-1’

After discussion on the mailing list and IRC, we decided this should be considered a bug since the instance is no longer tied to the host since it blew up in spawn and tried to reschedule. As such, we should clear it out when the claim is aborted.

Tags: compute
Joe Cropper (jwcroppe)
Changed in nova:
assignee: nobody → Joe Cropper (jwcroppe)
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/161069

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Low
tags: added: compute
Changed in nova:
assignee: Joe Cropper (jwcroppe) → nobody
status: In Progress → Confirmed
Changed in nova:
assignee: nobody → Joe Cropper (jwcroppe)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 5d8eb7184ebcf0a1ad245de28d6405bda385b680
Author: Joe Cropper <email address hidden>
Date: Tue Mar 3 19:46:21 2015 -0600

    Nil out inst.host and inst.node when build fails

    This patch addresses a bug that leaves instance.host/node set after
    a VM fails to build or reschedule (e.g., due to an error in the spawn
    path). Rather, we should nil these out at the end of the build
    process so that the instance is not erroneously being associated
    with stale host/node information.

    Also included are a few cosmetic updates in comments and eliminating
    some implied 'None' parameters from "dict.get(key, None)" calls I
    found during the course of investigating this change.

    Change-Id: I4d9c90b1d3fcce5237323fffcc6db1fb93d23e37
    Closes-Bug: #1427944

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.