When creating a volume from a glance image, cinder stores the original
image metadata in volume_glance_metadata. This is a key/value store,
and all the values are strings.
When Nova boots an instance from a volume, it passes the image
metadata returned by cinder, which is all strings. If a driver
expects these values to be ints, as they are when booting from an
image, it will get a type error.
This change also pulls size from the volume directly rather than
taking the value from the stored image metadata. This is because the
volume will have been created in 1Gb increments, and is unlikely to be
the same size as the original image. It may also have been
subsequently extended.
Reviewed: https:/ /review. openstack. org/149822 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=33e0813b22f b996558b51f1cba 28dcface8cfed3
Committed: https:/
Submitter: Jenkins
Branch: stable/juno
commit 33e0813b22fb996 558b51f1cba28dc face8cfed3
Author: Matthew Booth <email address hidden>
Date: Thu Sep 25 11:33:49 2014 +0100
Fix image metadata returned for volumes
When creating a volume from a glance image, cinder stores the original glance_ metadata. This is a key/value store,
image metadata in volume_
and all the values are strings.
When Nova boots an instance from a volume, it passes the image
metadata returned by cinder, which is all strings. If a driver
expects these values to be ints, as they are when booting from an
image, it will get a type error.
This change also pulls size from the volume directly rather than
taking the value from the stored image metadata. This is because the
volume will have been created in 1Gb increments, and is unlikely to be
the same size as the original image. It may also have been
subsequently extended.
Cherry picked from https:/ /review. openstack. org/#/c/ 124010/
Closes-Bug: #1367540
Conflicts: compute/ api.py tests/compute/ test_compute. py
nova/
nova/
Change-Id: I7928f6be1ca99f 1502941b9df2b44 3f2ca63a37b