image-without-format

Bug #1318968 reported by boh.ricky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
boh.ricky

Bug 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.

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)
...

boh.ricky (bohai)
description: updated
Changed in nova:
status: New → Confirmed
assignee: nobody → boh.ricky (bohai)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/93595

Changed in nova:
status: Confirmed → In Progress
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.