Skip to content

Commit 9a73688

Browse files
bernardodemarcoLocharla, Sandeep
authored andcommitted
fix install path for systemvm templates when introducing new sec storage (apache#11605)
1 parent 74a85dd commit 9a73688

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

0 commit comments

Comments
 (0)