xml format create volume requests silently ignore imageRef, snapshot_id or source_volid

Bug #1188581 reported by stephen mulcahy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
stephen mulcahy

Bug Description

The xml deserializer for volume requests does not recognise imageRef, snapshot_id or source_volid attributes

To reproduce on devstack:

curl -i -H "Content-Type: application/json" -H "x-auth-token: ${AUTH_TOKEN}" -d '{"volume": {"size": 10, "availability_zone": "nova", "imageRef": "'${IMAGE_ID}'" }}' ${HOST_URI}/v1/${TENANT_ID}/volumes

results in a volume create operation being logged by cinder-volume which includes the specified imageRef

while

curl -i -H "Accept: application/xml" -H "Content-Type: application/xml" -H "x-auth-token: ${AUTH_TOKEN}" -d '<volume availability_zone="nova" size="10" imageRef="'${IMAGE_ID}'"/>' ${HOST_URI}/v1/${TENANT_ID}/volumes

results in a volume create operation being logged by cinder-volume which omits the specified imageRef

Similar results for snapshot_id or source_volid

This seems to be a problem with both v1 and v2 of the api

Changed in cinder:
assignee: nobody → stephen mulcahy (stephen-mulcahy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/32123
Committed: http://github.com/openstack/cinder/commit/0ec58418103f5097ba3bb0ce0e45fe890be12c2e
Submitter: Jenkins
Branch: master

commit 0ec58418103f5097ba3bb0ce0e45fe890be12c2e
Author: Stephen Mulcahy <email address hidden>
Date: Fri Jun 7 11:52:11 2013 +0000

    Add missing attributes to xml deserializer for volume request

    The v1 and v2 xml deserializers for volume requests are missing
    support for the imageRef, snapshot_id and source_volid attributes
    resulting in xml format create volume requests which specify any
    of those attributes being silently ignored. This fix adds support
    to v1 and v2 and extends the volumes unit tests to check for this.
    Also includes some minor debug logging enhancements to make this
    easier to find in future.

    Fixes bug #1188581

    Change-Id: Ib661c4a961c57e682e0e4e6db98d863b3a99cf71

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