From b898badbbc237cceb8ced9d89f4c53e2df98ee4d Mon Sep 17 00:00:00 2001 From: Eoghan Glynn Date: Sat, 14 Jul 2012 21:30:43 +0100 Subject: EC2 DescribeImages reports correct rootDeviceType Fixes LP 1024354 A root device type of instance-store was incorrectly reported for boot-from-volume images (i.e. the analogue of EBS-backed AMIs). When comparing the block device mapping device name with the root device name, we now tolerate a missing leading '/dev/' path. Change-Id: I1d3bda780deee52f5d41e3af041aba7e6305dfde --- nova/api/ec2/cloud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nova/api') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index af74e75b8..3807ff323 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1303,8 +1303,10 @@ class CloudController(object): properties = image['properties'] root_device_name = block_device.properties_root_device_name(properties) root_device_type = 'instance-store' + for bdm in properties.get('block_device_mapping', []): - if (bdm.get('device_name') == root_device_name and + if (block_device.strip_dev(bdm.get('device_name')) == + block_device.strip_dev(root_device_name) and ('snapshot_id' in bdm or 'volume_id' in bdm) and not bdm.get('no_device')): root_device_type = 'ebs' -- cgit