From 31bf321cf11783ebd1b7233bd752d23f3883101b Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Wed, 23 May 2012 14:31:47 -0400 Subject: Record instance architecture types. In order to support image architectures other than x86, we need to record the instance architecture when it is running. Glance has the information that we need so we take the information that glance provides us. This is the first step for support other arches like armhf. Change-Id: Ia9ca1353a7cf56955d00d17f7bc1bfb3712a89ab Signed-off-by: Chuck Short --- nova/compute/api.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 3fd358a34..3990a9596 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -387,6 +387,9 @@ class API(base.Base): if reservation_id is None: reservation_id = utils.generate_uid('r') + # grab the architecture from glance + architecture = image['properties'].get('architecture', 'Unknown') + root_device_name = block_device.properties_root_device_name( image['properties']) @@ -421,6 +424,7 @@ class API(base.Base): 'access_ip_v6': access_ip_v6, 'availability_zone': availability_zone, 'root_device_name': root_device_name, + 'architecture': architecture, 'progress': 0} options_from_image = self._inherit_properties_from_image( @@ -636,6 +640,8 @@ class API(base.Base): updates['vm_state'] = vm_states.BUILDING updates['task_state'] = task_states.SCHEDULING + updates['architecture'] = image['properties'].get('architecture') + if (image['properties'].get('mappings', []) or image['properties'].get('block_device_mapping', []) or block_device_mapping): -- cgit