From 55c09da1b0ff4e2a147b07fcfa986a76815c7703 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Tue, 20 Nov 2012 00:50:27 +0000 Subject: [PATCH] Pass in correct volume_ref to create_from_snapshot. The new rpc versioning change introduced a bug in the create_from_snapshot code. The originating volume_ref was being passed in instead of the newly created volume_ref as expected. Fixes bug 1080898 Change-Id: I6ba4f4989c77e29685abb2649af8e003c447ab0f --- cinder/volume/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cinder/volume/api.py b/cinder/volume/api.py index faed8a35b..627f17b35 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -199,7 +199,6 @@ class API(base.Base): # If snapshot_id is set, make the call create volume directly to # the volume host where the snapshot resides instead of passing it # through the scheduler. So snapshot can be copy to new volume. - volume_id = request_spec['volume_id'] snapshot_id = request_spec['snapshot_id'] image_id = request_spec['image_id'] @@ -208,9 +207,11 @@ class API(base.Base): snapshot_ref = self.db.snapshot_get(context, snapshot_id) src_volume_ref = self.db.volume_get(context, snapshot_ref['volume_id']) + volume_ref = self.db.volume_get(context, + volume_id) # bypass scheduler and send request directly to volume self.volume_rpcapi.create_volume(context, - src_volume_ref, + volume_ref, src_volume_ref['host'], snapshot_id, image_id) -- 2.45.2