From fb32f1ed9be3e4f2f46d5aea405c62ef21397640 Mon Sep 17 00:00:00 2001 From: Nikola Dipanov Date: Wed, 19 Dec 2012 16:23:30 +0100 Subject: 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 --- nova/volume/cinder.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nova/volume') 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 -- cgit