can't update volume meta-data

Bug #1046382 reported by clayg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
James King

Bug Description

Volumes can support arbitrary meta-data which can be set on create, but the current api does not expose a means to update the values or keys.

Changed in cinder:
status: New → Confirmed
importance: Undecided → Medium
James King (jking-6)
Changed in cinder:
assignee: nobody → James King (jking-6)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/14772
Committed: http://github.com/openstack/cinder/commit/9fe4477f9b1f4e825941cb1ce42ced1a1a862b33
Submitter: Jenkins
Branch: master

commit 9fe4477f9b1f4e825941cb1ce42ced1a1a862b33
Author: jking-6 <email address hidden>
Date: Wed Oct 24 13:15:03 2012 -0400

    Allow the user to update a volume's metadata

    The fix mainly involves updating the VolumeController's update method
    to allow the 'metadata' key to be a valid key in a request body.

    The _translate_volume_summary_view method is updated to check for a
    'metadata' key in the vol parameter after checking first for
    'volume_metadata'. This is to avoid making a third call to the
    database after updating the volume model. This solution introduces
    the least amount of new code.

    Change-Id: I41256d03f9c4c7a0866ff0f2d35fce8e4fd26b11
    Fixes: bug #1046382

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Revision history for this message
Rohan (kanaderohan) wrote :

According to the fix released for this bug, The code cannot update an individual metadata key. Also if we try to update an individual metadata key, all other metadata keys will be deleted according to this line of code. Which is a new bug.
https://github.com/openstack/cinder/commit/9fe4477f9b1f4e825941cb1ce42ced1a1a862b33#L1R1070
https://github.com/openstack/cinder/blob/9fe4477f9b1f4e825941cb1ce42ced1a1a862b33/cinder/db/sqlalchemy/api.py#L1125

Since there are separate REST API urls for metadata read/update/delete for servers, images
v2/{tenant_id}/servers/{server_id}/metadata
v2/{tenant_id}/servers/{server_id}/metadata/{key}

v2/images/{image_id}/metadata
v2/images/{image_id}/metadata/{key}

I think that the same rest api should be implemented for cinder volume metadata CRUD operations.

Thierry Carrez (ttx)
Changed in cinder:
milestone: grizzly-1 → 2013.1
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.