Skip to content

Commit 320d989

Browse files
fix install path for systemvm templates when introducing new sec storage
1 parent 9349b69 commit 320d989

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,10 @@ public void addSystemVMTemplatesToSecondary(DataStore store) {
12351235
if (_vmTemplateStoreDao.isTemplateMarkedForDirectDownload(tmplt.getId())) {
12361236
continue;
12371237
}
1238-
tmpltStore =
1239-
new TemplateDataStoreVO(storeId, tmplt.getId(), new Date(), 100, Status.DOWNLOADED, null, null, null,
1240-
TemplateConstants.DEFAULT_SYSTEM_VM_TEMPLATE_PATH + tmplt.getId() + '/', tmplt.getUrl());
1238+
String templateDirectoryPath = TemplateConstants.DEFAULT_TMPLT_ROOT_DIR + File.separator + TemplateConstants.DEFAULT_TMPLT_FIRST_LEVEL_DIR;
1239+
String installPath = templateDirectoryPath + tmplt.getAccountId() + File.separator + tmplt.getId() + File.separator;
1240+
tmpltStore = new TemplateDataStoreVO(storeId, tmplt.getId(), new Date(), 100, Status.DOWNLOADED,
1241+
null, null, null, installPath, tmplt.getUrl());
12411242
tmpltStore.setSize(0L);
12421243
tmpltStore.setPhysicalSize(0); // no size information for
12431244
// pre-seeded system vm templates

0 commit comments

Comments
 (0)