nova-manage flavor convert fails if instance has no flavor in sys_meta

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

Bug Description

nova-manage fails if instance has no flavor in sys_meta when trying to move them all to instance_extra.

But mostly the instance_type table includes the correct information, so it should be possible to copy it from there.

tags: added: unified-objects
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
description: updated
summary: - nova-manage fails if instance has no flavor in sys_meta when trying to
- move them all to instance_extra
+ nova-manage flavor convert fails if instance has no flavor in sys_meta
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/187206

Changed in nova:
assignee: nobody → Dan Smith (danms)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/187227

Dan Smith (danms)
tags: added: kilo-backport-potential
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/187740

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

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

commit 240fb9c5392f71e59e6ef2f8f917b098f1cf9960
Author: Dan Smith <email address hidden>
Date: Mon Jun 1 07:31:26 2015 -0700

    Make nova-manage handle completely missing flavor information

    If you have a really (really) old instance without any flavor information
    stashed in sysmeta, then nova-manage will not be able to convert it to
    a proper flavor object in extra. This patch makes it handle that case
    by looking up the flavor by id instead. Not only will this facilitate
    the transition, but will also ensure that any such legacy instances are
    properly brought up to date so that going forward we can just assume that
    they have all been converted (and remove some other places where we
    handle the has-no-flavor-info case).

    This involves changing the flavor cache to contain flavor objects
    instead of DB objects so that the two methods that use the cache can
    coexist. It doesn't much affect the _augment_flavors_to_migrate() path,
    other than some mechanics and test changes.

    Change-Id: I54a056d339d98bc4092af8cf9f4f5d24b882506b
    Closes-Bug: #1460673

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

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

commit 68b22c1e31c69b6dcc6bf57c8eb8e213904bf963
Author: Dan Smith <email address hidden>
Date: Mon Jun 1 08:15:51 2015 -0700

    Handle FlavorNotFound when augmenting migrated flavors

    When we migrate a partial flavor from system_metadata to a full
    flavor in instance_extra, we need to query for the original flavor in
    order to fill in the missing extra_specs. If that fails because the
    flavor has been deleted, we need to just not augment the flavor, log
    a warning, and continue instead of failing.

    Change-Id: Ida49ddea525fb54e0d0238746b83b0202da437c3
    Related-Bug: #1460673

Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/kilo)

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

commit 22adc624666e5cc94fb533d95c998f59c70d5890
Author: Dan Smith <email address hidden>
Date: Mon Jun 1 07:31:26 2015 -0700

    Make nova-manage handle completely missing flavor information

    If you have a really (really) old instance without any flavor information
    stashed in sysmeta, then nova-manage will not be able to convert it to
    a proper flavor object in extra. This patch makes it handle that case
    by looking up the flavor by id instead. Not only will this facilitate
    the transition, but will also ensure that any such legacy instances are
    properly brought up to date so that going forward we can just assume that
    they have all been converted (and remove some other places where we
    handle the has-no-flavor-info case).

    This involves changing the flavor cache to contain flavor objects
    instead of DB objects so that the two methods that use the cache can
    coexist. It doesn't much affect the _augment_flavors_to_migrate() path,
    other than some mechanics and test changes.

    Conflicts:
     nova/tests/unit/db/test_db_api.py

    Change-Id: I54a056d339d98bc4092af8cf9f4f5d24b882506b
    Closes-Bug: #1460673
    (cherry picked from commit 240fb9c5392f71e59e6ef2f8f917b098f1cf9960)

tags: added: in-stable-kilo
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.