2014-05-14 03:43:39 |
boh.ricky |
description |
Currently, some case like the below, the image can't be used to boot an instance.
1. create volume from image
2. boot instance from the volume
3. createImage to the instance
4. use the instance image to boot an instance
The reason:
The image without the disk_format/container_format/checksum。
When boot the instance from the image, getattr exception is thrown. |
Currently, some case like the below, the image can't be used to boot an instance.
1. create volume from image
2. boot instance from the volume
3. createImage to the instance
4. use the instance image to boot an instance
The reason:
The image without the disk_format/container_format/checksum。
When boot the instance from the image, getattr exception is thrown.
fix:
in nova/nova/image/glance.py
before modify:
def _extract_attributes(image):
...
for attr in IMAGE_ATTRIBUTES:
if attr == 'deleted_at' and not output['deleted']:
output[attr] = None
elif attr == 'checksum' and output['status'] != 'active':
output[attr] = None
else:
output[attr] = getattr(image, attr)
...
after modify :
def _extract_attributes(image):
...
for attr in IMAGE_ATTRIBUTES:
if attr == 'deleted_at' and not output['deleted']:
output[attr] = None
elif attr == 'checksum' and output['status'] != 'active':
output[attr] = None
else:
if hasattr(image, attr):
output[attr] = getattr(image, attr)
... |
|