Remaining instance['instance_type'] uses should be removed

Bug #1140119 reported by Dan Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Dan Smith

Bug Description

Remaining instance['instance_type'] uses should be removed and replaced with sys_meta

Recently, a change caused the instance type information to be copied into system_metadata, decoupling a running instance from the system flavors. This allows both changing of flavor details as well as deleting flavors without affecting running instances. Further, having the information in system_metadata will allow us to eventually remove the joinedload of the instance_types table at instance fetch time.

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/23490

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23499

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23500

Revision history for this message
Mark McLoughlin (markmc) wrote :

> Remaining instance['instance_type'] uses should be removed and replaced with sys_meta

why? is the plan to remove instance_type itself?

Dan Smith (danms)
description: updated
Revision history for this message
Vish Ishaya (vishvananda) wrote :

The main issue is that anything that uses instance_type is extremely fragile. If an administratror deletes an instance type then it can potentially break things. This was the reason for moving to using instance_system_metadata in the first place. We just missed a few spots so dan is cleaning the rest of them up.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23712

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23713

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

Reviewed: https://review.openstack.org/23490
Committed: http://github.com/openstack/nova/commit/2f414f316cb71d0ab8987e56b928697b5d267674
Submitter: Jenkins
Branch: master

commit 2f414f316cb71d0ab8987e56b928697b5d267674
Author: Dan Smith <email address hidden>
Date: Mon Mar 4 19:18:08 2013 -0500

    Remove uses of instance['instance_type'] from xenapi driver.

    Note that this includes a fix to tests/db/fakes.py to make the fake
    instance_type structures look like the database models.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: Ieb107fbaf0f3b5a42681aefc0ffdefdb8c0f98a5

Changed in nova:
status: In Progress → Fix Committed
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/23860

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23941

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23949

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/23950

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

Reviewed: https://review.openstack.org/23499
Committed: http://github.com/openstack/nova/commit/f163bffa55d770e70725751f53212792b9de128b
Submitter: Jenkins
Branch: master

commit f163bffa55d770e70725751f53212792b9de128b
Author: Dan Smith <email address hidden>
Date: Mon Mar 4 19:27:17 2013 -0500

    Remove uses of instance['instance_type'] from powervm driver.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: I885a807d00f7f909665da6e7a3382295a43258c9

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23500
Committed: http://github.com/openstack/nova/commit/5fdcf190aa79eaa04b20cc6acf63dd99bce5e106
Submitter: Jenkins
Branch: master

commit 5fdcf190aa79eaa04b20cc6acf63dd99bce5e106
Author: Dan Smith <email address hidden>
Date: Mon Mar 4 20:38:09 2013 -0500

    Remove uses of instance['instance_type'] from libvirt driver.

    Note that this includes a few tweaks to the libvirt tests where the instance
    type in use was expected to have no swap, but the actual id-matching fake
    did. This integration makes it a little harder for the tests to be out
    of whack like that, which is good.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: I190258bd0947944d9bcdf49956eed40d402606f5

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23712
Committed: http://github.com/openstack/nova/commit/86e4587fb36aec74102d58c50d614fc6c006ebd3
Submitter: Jenkins
Branch: master

commit 86e4587fb36aec74102d58c50d614fc6c006ebd3
Author: Dan Smith <email address hidden>
Date: Tue Mar 5 13:57:10 2013 -0500

    Remove uses of instance['instance_type'] from nova/compute

    Note that some tests were verifying things that can no longer fail, namely
    rebuilding instances who use flavors that have since been disabled. These
    tests are removed here.

    Also, this changes the order of a piece of logic in the resize/migrate
    path where before we would have ended up checking the instance type that
    we fetched from sys_meta to see if it was disabled (which makes no sense
    now). Reversing the check (to see if we're doing a resize or a migrate
    before checking the new flavor) eliminates the problem of the stashed
    type not having the 'disabled' attribute.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: I214a693e3bb16c0a365eb9b3afe73601beba4a22

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23713
Committed: http://github.com/openstack/nova/commit/fcdd30a5fb99dd272cf29d909c46416f2e5084e1
Submitter: Jenkins
Branch: master

commit fcdd30a5fb99dd272cf29d909c46416f2e5084e1
Author: Dan Smith <email address hidden>
Date: Wed Mar 6 09:34:40 2013 -0500

    Remove uses of instance['instance_type'] from nova/network

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: I43c9e9b7d560d8803899360bd7142e393b793f3d

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23860
Committed: http://github.com/openstack/nova/commit/d64f61f976a0243f48effd97d1e5e2e0bc20040b
Submitter: Jenkins
Branch: master

commit d64f61f976a0243f48effd97d1e5e2e0bc20040b
Author: Dan Smith <email address hidden>
Date: Thu Mar 7 17:13:12 2013 -0500

    Remove uses of instance['instance_type'] from nova/api

    This removes a test that attempted to delete the data from the
    instance['instance_type'] structure and confirm that the flavor can
    still be fetched. Since this data is no longer consulted in that
    action (and will be removed altogether soon), this test is removed.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: I3ba56f9419aece5b9269a181264d09b117ecdb81

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23941
Committed: http://github.com/openstack/nova/commit/cc8ec3d40678c3a7d868c4d4e4eabf242ec081db
Submitter: Jenkins
Branch: master

commit cc8ec3d40678c3a7d868c4d4e4eabf242ec081db
Author: Dan Smith <email address hidden>
Date: Fri Mar 8 12:46:24 2013 -0500

    Remove uses of instance['instance_type'] from nova/scheduler

    This is a tiny change in the actual code, but requires a bunch of
    silly changes in the tests because we're so inconsistent with our
    (ab)use of instance types there. This attempts to help clean that
    up locally a bit.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: Ied1a944a7c762129597d18ded61ce1632657f070

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23949
Committed: http://github.com/openstack/nova/commit/bd5a9b87a784135d9da808fec77e23b8f4d538d0
Submitter: Jenkins
Branch: master

commit bd5a9b87a784135d9da808fec77e23b8f4d538d0
Author: Dan Smith <email address hidden>
Date: Fri Mar 8 13:45:45 2013 -0500

    Remove uses of instance['instance_type'] from nova/notifications

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: Iebbb0fa0bf306d6a7c8b83594e13a4b99f27c404

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/23950
Committed: http://github.com/openstack/nova/commit/fed1ea1d7528e7a3d2da181112da62cf04cb5092
Submitter: Jenkins
Branch: master

commit fed1ea1d7528e7a3d2da181112da62cf04cb5092
Author: Dan Smith <email address hidden>
Date: Fri Mar 8 13:46:59 2013 -0500

    Remove instance['instance_type'] relationship from db api

    This removes the entire relationship between an instance and the flavor
    it was created from. As such, it removes two tests entirely which
    examined the old behavior.

    This is one change in a series aimed at removing the use of instance-linked
    instance_type objects, in favor of the decoupled type data in
    system_metadata. See bug 1140119 for more details.

    Change-Id: I8b525a900bf2dc6b193e54aae35fc32248e4cff4

Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
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.