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

Bug #1188581 reported by stephen mulcahy on 2013-06-07
This bug affects 2 people
Affects Status Importance Assigned to Milestone
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


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)

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

Changed in cinder:
status: New → In Progress

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) on 2013-07-17
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in cinder:
milestone: havana-2 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers