Skip to content

Commit b67a832

Browse files
committed
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.
1 parent 18b301e commit b67a832

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎server/src/com/cloud/template/TemplateManagerImpl.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,10 @@ public VirtualMachineTemplate createPrivateTemplate(CreateTemplateCmd command) t
13471347
AsyncCallFuture<TemplateApiResult> future = null;
13481348
if (snapshotId != null) {
13491349
SnapshotInfo snapInfo = _snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Image);
1350+
DataStore snapStore = snapInfo.getDataStore();
1351+
if (snapStore != null) {
1352+
store = snapStore; // pick snapshot image store to create template
1353+
}
13501354
future = _tmpltSvr.createTemplateFromSnapshotAsync(snapInfo, tmplInfo, store);
13511355
} else if (volumeId != null) {
13521356
VolumeInfo volInfo = _volFactory.getVolume(volumeId);

0 commit comments

Comments
 (0)