Comment 2 for bug 1460079

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

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

commit 77ecc3d8c5853f5498bc6ed2d22d6ff0dd75a075
Author: Daniel P. Berrange <email address hidden>
Date: Mon Jun 1 16:18:30 2015 +0100

    compute: remove get_image_metadata method

    The get_image_metadata method has some unhelpful semantics
    where it takes the image metadata from the instance's
    system metadata record, and then overwrites it with the
    current metadata associated with the original image.

    The result is that, if the image metadata in glance was
    changed after the instance was first booted, Nova will
    end up making decisions based on image metadata that does
    not correspond to that which the instance was booted with.
    Since the image metadata controls many aspects of hardware
    configuration, this could lead to incorrect behaviour when
    modifying hardware later, eg disk/vif/pci hotplug.

    What is worse, is that some of the nova operations will
    update the instance system metadata when completed, thus
    permanently overwriting the original image metadata with
    the new data.

    Almost all code which operates against an existing instance
    is updated to use nova.utils.get_image_from_system_metadata.
    The exception is the rescue codepath, which must use the
    metadata associated with the new rescue image.

    The nova.compute.utils.get_image_metadata method can thus
    be removed from use, avoiding the problematic logic.

    Closes-bug: #1460079
    Change-Id: I35c9d26e3967e93a2c368c3f9fdc807a69816dd2