volume create from backup restore fails

Bug #1195403 reported by Patrick Woods
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Patrick Woods

Bug Description

Backup restore in a heat template fails with the following error:

2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource TypeError: 'VolumeBackupsRestore' object has no attribute '__getitem__'

Environment:

    OS: ubuntu 12.04
    Python: 2.7
    Heat branch: Master

Log file segment:

2013-06-27 12:26:07.296 4281 INFO heat.engine.resource [-] creating CinderVolume "DataVolume"
2013-06-27 12:26:07.297 4281 DEBUG heat.engine.scheduler [-] Task resource_create running step /opt/stack/heat/heat/engine/scheduler.py:160
2013-06-27 12:26:08.548 4281 DEBUG heat.engine.clients [-] cinder args {'service_type': 'volume', 'username': u'admin', 'project_id': u'admin', 'auth_url': u'http://9.48.130.241:5000/v2.0', 'api_key': u'passw0rd'} cinder /opt/stack/heat/heat/engine/clients.py:184
2013-06-27 12:26:08.553 4281 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTP connection (1): 9.48.130.241
2013-06-27 12:26:08.901 4281 DEBUG requests.packages.urllib3.connectionpool [-] "POST /v2.0/tokens HTTP/1.1" 200 8414 _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:289
2013-06-27 12:26:09.199 4281 INFO requests.packages.urllib3.connectionpool [-] Starting new HTTP connection (1): 9.48.130.241
2013-06-27 12:26:10.755 4281 DEBUG requests.packages.urllib3.connectionpool [-] "POST /v1/eacfc77429f64ce0898fdfa41b1b56fe/backups/34846b9c-002c-4e30-a047-b320893ce071/restore HTTP/1.1" 202 119 _make_request /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:289
2013-06-27 12:26:10.759 4281 ERROR heat.engine.resource [-] CREATE : CinderVolume "DataVolume"
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource Traceback (most recent call last):
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resource.py", line 347, in _do_action
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource handle_data = handle()
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource File "/opt/stack/heat/heat/engine/resources/volume.py", line 58, in handle_create
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource vol_id = cinder.restores.restore(backup_id)['volume_id']
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource TypeError: 'VolumeBackupsRestore' object has no attribute '__getitem__'
2013-06-27 12:26:10.759 4281 TRACE heat.engine.resource
2013-06-27 12:26:12.303 4281 DEBUG heat.engine.scheduler [-] Task resource_create cancelled cancel /opt/stack/heat/heat/engine/scheduler.py:183
2013-06-27 12:26:12.304 4281 DEBUG heat.engine.scheduler [-] Task resource_create cancelled cancel /opt/stack/heat/heat/engine/scheduler.py:183
2013-06-27 12:26:14.474 4281 DEBUG heat.engine.scheduler [-] Task create_task from Stack "test-Cinder1" complete step /opt/stack/heat/heat/engine/scheduler.py:166
2013-06-27 12:26:14.475 4281 WARNING heat.engine.service [-] Stack create failed, status FAILED

Revision history for this message
Patrick Woods (woodspa) wrote :

I have a fix for this.

Changed in heat:
assignee: nobody → Patrick Woods (woodspa)
Patrick Woods (woodspa)
Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/34789
Committed: http://github.com/openstack/heat/commit/40c07c160a857a6800de0d2fade777a322c82612
Submitter: Jenkins
Branch: master

commit 40c07c160a857a6800de0d2fade777a322c82612
Author: Patrick Woods <email address hidden>
Date: Thu Jun 27 14:44:54 2013 -0500

    Fixup handle_create backup restore.

    The handle_create did not retrieve the volume_id
    correctly and the check_create_complete
    needs to handle the restoring-backup status.

    Also modify and add support for restoring-backup
    status test cases for success and error.
    The additional FakeVolumeFromBackup will force
    the inital status to be checked by the method
    check_create_complete in volume.py.

    Fix bug 1195403.

    Change-Id: I60bf4f9f90be1058d0fb400aa3778d0448b1a898

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: havana-2 → 2013.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.