Updated Branches:
  refs/heads/4.2 8268a8ee3 -> 75dff7cc7

CLOUDSTACK-4530:Create Template from a Snapshot fails with unable to
find any snapshot ova/ovf when we have multiple secondary storage for a
zone.
(cherry picked from commit 4ba68e3b3fd58bd1e7333bb68e8970b3af7a954f)

Signed-off-by: animesh <anim...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ddc4990a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ddc4990a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ddc4990a

Branch: refs/heads/4.2
Commit: ddc4990a0dc9d9dca5c8cc707cb8678a83795717
Parents: 8268a8e
Author: Min Chen <min.c...@citrix.com>
Authored: Tue Aug 27 16:56:21 2013 -0700
Committer: animesh <anim...@apache.org>
Committed: Tue Aug 27 21:56:03 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/template/TemplateManagerImpl.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ddc4990a/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java 
b/server/src/com/cloud/template/TemplateManagerImpl.java
index 2a0e04d..fa92a02 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1374,6 +1374,10 @@ public class TemplateManagerImpl extends ManagerBase 
implements TemplateManager,
             AsyncCallFuture<TemplateApiResult> future = null;
             if (snapshotId != null) {
                 SnapshotInfo snapInfo = 
this._snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
+                DataStore snapStore = snapInfo.getDataStore();
+                if ( snapStore != null ){
+                    store = snapStore; // pick snapshot image store to create 
template
+                }
                 future = 
this._tmpltSvr.createTemplateFromSnapshotAsync(snapInfo, tmplInfo, store);
             } else if (volumeId != null) {
                 VolumeInfo volInfo = this._volFactory.getVolume(volumeId);

Reply via email to