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.
This commit is contained in:
Min Chen 2013-08-27 17:15:11 -07:00
parent 18b301edb9
commit b67a832f77
1 changed files with 4 additions and 0 deletions

View File

@ -1347,6 +1347,10 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
AsyncCallFuture<TemplateApiResult> future = null;
if (snapshotId != null) {
SnapshotInfo snapInfo = _snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
DataStore snapStore = snapInfo.getDataStore();
if (snapStore != null) {
store = snapStore; // pick snapshot image store to create template
}
future = _tmpltSvr.createTemplateFromSnapshotAsync(snapInfo, tmplInfo, store);
} else if (volumeId != null) {
VolumeInfo volInfo = _volFactory.getVolume(volumeId);