Skip to content

Commit 387f958

Browse files
author
Daman Arora
committed
Allow endpoint selection logic for system templates in region and zone scopes
1 parent 6a324da commit 387f958

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ public EndPoint select(DataObject object) {
400400
}
401401
if (object instanceof TemplateInfo) {
402402
TemplateInfo tmplInfo = (TemplateInfo)object;
403-
if (store.getScope().getScopeType() == ScopeType.ZONE && store.getScope().getScopeId() == null && tmplInfo.getTemplateType() == TemplateType.SYSTEM) {
403+
if (tmplInfo.getTemplateType() == TemplateType.SYSTEM &&
404+
(store.getScope().getScopeType() == ScopeType.REGION ||
405+
(store.getScope().getScopeType() == ScopeType.ZONE && store.getScope().getScopeId() == null))) {
404406
return LocalHostEndpoint.getEndpoint(); // for bootstrap system vm template downloading to region image store
405407
}
406408
}

0 commit comments

Comments
 (0)