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.
Reviewed: https:/ /review. openstack. org/187251 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=77ecc3d8c58 53f5498bc6ed2d2 2d6ff0dd75a075
Committed: https:/
Submitter: Jenkins
Branch: master
commit 77ecc3d8c5853f5 498bc6ed2d22d6f f0dd75a075
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 get_image_ from_system_ metadata.
is updated to use nova.utils.
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 3a2c368c3f9fdc8 07a69816dd2
Change-Id: I35c9d26e3967e9