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 4ba68e3b3f)

Signed-off-by: animesh <animesh@apache.org>
This commit is contained in:
Min Chen 2013-08-27 16:56:21 -07:00 committed by animesh
parent 8268a8ee36
commit ddc4990a0d
1 changed files with 4 additions and 0 deletions

View File

@ -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);