inline flavor migration fails with pre-kilo instances

Bug #1459758 reported by John Garbutt
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
John Garbutt
Kilo
Fix Released
Undecided
Dan Smith

Bug Description

If instance.save() is used to migrate the flavor from sys_meta to instance_extra, this only works in that instance already has an instance_extra row.

In the case where its missing, the update call silently fails to make any changes to the database, and you get lots of OrphanedInstanceErrors when listing instances, because the instance no longer has any flavors.

tags: added: db
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
assignee: nobody → John Garbutt (johngarbutt)
Changed in nova:
status: Triaged → In Progress
Revision history for this message
John Garbutt (johngarbutt) wrote :
Matt Riedemann (mriedem)
tags: added: unified-objects
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/186505

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 94debcfaf0e6d20d46dd7df467018b4f7223e595
Author: John Garbutt <email address hidden>
Date: Wed May 27 18:30:22 2015 +0100

    Create instance_extra entry if it doesn't update

    When updating an instance, if there is no instance_extra, for older
    instances, we make sure we create one if there is not one already.

    This keeps flavor data migrations (ie system_metadata ->
    instance_extra) from failing when the system_metadata entries are soft
    deleted but an instance_extra entry is not created because it was
    "updated" assuming an instance_extra entry already existed, leaving
    the instance with no flavor data.

    Closes-Bug: #1459758
    Change-Id: I715217d98729c6c5ac45d64d8bacaaca745ff3d7

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

Reviewed: https://review.openstack.org/186505
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a0f093a266c2a2aff0a96e8041cb383bc8d86049
Submitter: Jenkins
Branch: stable/kilo

commit a0f093a266c2a2aff0a96e8041cb383bc8d86049
Author: John Garbutt <email address hidden>
Date: Wed May 27 18:30:22 2015 +0100

    Create instance_extra entry if it doesn't update

    When updating an instance, if there is no instance_extra, for older
    instances, we make sure we create one if there is not one already.

    This keeps flavor data migrations (ie system_metadata ->
    instance_extra) from failing when the system_metadata entries are soft
    deleted but an instance_extra entry is not created because it was
    "updated" assuming an instance_extra entry already existed, leaving
    the instance with no flavor data.

    Closes-Bug: #1459758
    Change-Id: I715217d98729c6c5ac45d64d8bacaaca745ff3d7
    (cherry picked from commit e776d6fddf047ff5dc77420263bd60756ba6a988)

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