diff options
| author | Eoghan Glynn <eglynn@redhat.com> | 2012-07-14 21:30:43 +0100 |
|---|---|---|
| committer | Eoghan Glynn <eglynn@redhat.com> | 2012-07-17 18:29:22 +0100 |
| commit | b898badbbc237cceb8ced9d89f4c53e2df98ee4d (patch) | |
| tree | 7ab32eaa45f5ea175fe1347e1ac04d1f035d363d /nova/api | |
| parent | 8600394ec4dd4f800d774e4ed0c24fe087d8e1d3 (diff) | |
| download | nova-b898badbbc237cceb8ced9d89f4c53e2df98ee4d.tar.gz nova-b898badbbc237cceb8ced9d89f4c53e2df98ee4d.tar.xz nova-b898badbbc237cceb8ced9d89f4c53e2df98ee4d.zip | |
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
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 4 |
1 files changed, 3 insertions, 1 deletions
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' |
