Can use volume_id in nova.volume.cinder.API to reduce roundtrips with Cinder

Bug #1172297 reported by Oleg Bondarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Oleg Bondarev

Bug Description

Currently volume.cinder.API methods accept volume object as a parameter while the majority of them only needs volume_id.
So API users need to do a redundant roundtrip with Cinder: first to get volume object and then pass it to another method (which only needs volume_id).
For example:
nova.api.openstack.compute.contrib.volumes.VolumeController.delete():
 ...
        try:
            vol = self.volume_api.get(context, id)
            self.volume_api.delete(context, vol)
 ...

while volume_api.delete() method is just:
    def delete(self, context, volume):
        cinderclient(context).volumes.delete(volume['id'])

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/27537

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: Oleg Bondarev (obondarev) → Mark McLoughlin (markmc)
Changed in nova:
assignee: Mark McLoughlin (markmc) → Oleg Bondarev (obondarev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/27537
Committed: http://github.com/openstack/nova/commit/586e752e69ca891714f390bf59ad30d5081d4498
Submitter: Jenkins
Branch: master

commit 586e752e69ca891714f390bf59ad30d5081d4498
Author: Oleg Bondarev <email address hidden>
Date: Fri Apr 26 12:52:26 2013 +0400

    Refactor nova.volume.cinder.API to reduce roundtrips with Cinder

    Make cinder.API methods accept volume_id instead of the whole volume object.
    This will remove redundant roundtrip to get the volume before
    passing it to other methods as in fact they only need the id.

    Fixes bug 1172297

    Change-Id: I5e7f944c1c29b2f211ece2ef86c0959c81e806df

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