Skip to content

Commit bbc23a7

Browse files
fix install path for systemvm templates when introducing new sec storage (#11605)
1 parent 44793da commit bbc23a7

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
@@ -1318,9 +1318,10 @@ public void addSystemVMTemplatesToSecondary(DataStore store) {
13181318
if (_vmTemplateStoreDao.isTemplateMarkedForDirectDownload(tmplt.getId())) {
13191319
continue;
13201320
}
1321-
tmpltStore =
1322-
new TemplateDataStoreVO(storeId, tmplt.getId(), new Date(), 100, Status.DOWNLOADED, null, null, null,
1323-
TemplateConstants.DEFAULT_SYSTEM_VM_TEMPLATE_PATH + tmplt.getId() + '/', tmplt.getUrl());
1321+
String templateDirectoryPath = TemplateConstants.DEFAULT_TMPLT_ROOT_DIR + File.separator + TemplateConstants.DEFAULT_TMPLT_FIRST_LEVEL_DIR;
1322+
String installPath = templateDirectoryPath + tmplt.getAccountId() + File.separator + tmplt.getId() + File.separator;
1323+
tmpltStore = new TemplateDataStoreVO(storeId, tmplt.getId(), new Date(), 100, Status.DOWNLOADED,
1324+
null, null, null, installPath, tmplt.getUrl());
13241325
tmpltStore.setSize(0L);
13251326
tmpltStore.setPhysicalSize(0); // no size information for
13261327
// pre-seeded system vm templates

0 commit comments

Comments
 (0)