diff options
| author | Nikola Dipanov <ndipanov@redhat.com> | 2012-12-19 16:23:30 +0100 |
|---|---|---|
| committer | Nikola Dipanov <ndipanov@redhat.com> | 2012-12-19 18:25:52 +0100 |
| commit | fb32f1ed9be3e4f2f46d5aea405c62ef21397640 (patch) | |
| tree | ee807eaaec45e10000696a1a48a0b4b32bf2d6c1 /nova/volume | |
| parent | 420e0518c37a4eafb54509e5b4abd692b1caa055 (diff) | |
| download | nova-fb32f1ed9be3e4f2f46d5aea405c62ef21397640.tar.gz nova-fb32f1ed9be3e4f2f46d5aea405c62ef21397640.tar.xz nova-fb32f1ed9be3e4f2f46d5aea405c62ef21397640.zip | |
Extract image metadata from Cinder
This patch makes nova extract image metadata if it is present in the
volume dict received from Cinder API.
The volume image metadata is received from Cinder when the
volume_image_metadata Cinder extension is loaded.
This patch is part of the work done on blueprint improve-boot-from-volume
as this metadata will be used when booting instances from volumes
without the need to supply an image just for the metadata. Subsequent
patches will make Nova consider this metadata when booting instances
without and image id.
Change-Id: I9e5925ea4147a41c41f9019933a47c5ccf756747
Diffstat (limited to 'nova/volume')
| -rw-r--r-- | nova/volume/cinder.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py index 1b8305505..04c151d1e 100644 --- a/nova/volume/cinder.py +++ b/nova/volume/cinder.py @@ -20,6 +20,7 @@ Handles all requests relating to volumes + cinder. """ +from copy import deepcopy import sys from cinderclient import exceptions as cinder_exception @@ -117,6 +118,9 @@ def _untranslate_volume_summary_view(context, vol): item['value'] = value d['volume_metadata'].append(item) + if hasattr(vol, 'volume_image_metadata'): + d['volume_image_metadata'] = deepcopy(vol.volume_image_metadata) + return d |
