Invalid snapshot is created from volume backed instance

Bug #1322157 reported by Feodor Tersin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

An incorrect snapshot is created from volume backed instance booted from volume. The snapshot doesn't have disk_format and container_format attributes. As a result booting from the snapshot fails.

Environment: DevStack

Steps to reproduce:
1 Create bootable volume
$ cinder create --image-id xxx 1
Note. I used cirros-0.3.2-x86_64-uec ami image.

2 Boot instance from volume
$ nova boot --flavor m1.nano --block-device id=yyy,source=volume,dest=volume,device=/dev/vda,bootindex=0,shutdown=remove
inst

3 Create instance snapshot
$ nova image-create inst snap

4 Boot instance from snapshot
$ nova boot --flavor m1.nano --image snap inst1

The last command's output:
ERROR (InternalServerError): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-45cb14af-3d80-4980-945e-1db6f958950b)

Nova api log:
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack File "/opt/stack/nova/nova/image/glance.py", line 277, in show
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack base_image_meta = _translate_from_glance(image)
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack File "/opt/stack/nova/nova/image/glance.py", line 462, in _translate_from_glance
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack image_meta = _extract_attributes(image)
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack File "/opt/stack/nova/nova/image/glance.py", line 530, in _extract_attributes
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack output[attr] = getattr(image, attr)
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack File "/opt/stack/python-glanceclient/glanceclient/openstack/common/apiclient/base.py", line 462, in __getattr__
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack return self.__getattr__(k)
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack File "/opt/stack/python-glanceclient/glanceclient/openstack/common/apiclient/base.py", line 464, in __getattr__
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack raise AttributeError(k)
2014-05-22 15:10:48.084 12610 TRACE nova.api.openstack AttributeError: disk_format

6 Check instance snapshot attributes
$ glance image-show snap
Rows for disk and container format are absent.

The problem is in _action_create_image in nova/api/openstack/compute/servers.py. 'not img' branch incorrectly initializes image_meta variable.

Feodor Tersin (ftersin)
Changed in nova:
assignee: nobody → Feodor Tersin (ftersin)
status: New → Confirmed
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/95522

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Feodor Tersin (ftersin) wrote :
Changed in nova:
assignee: Feodor Tersin (ftersin) → nobody
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Feodor Tersin (<email address hidden>) on branch: master
Review: https://review.openstack.org/95522
Reason: Bug #1322157 is resolved by already committed https://review.openstack.org/#/c/93649/.

There is no reason for me to refactor nova when no one looked this changes within two weeks.

Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
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.