Skip to content

Commit bec4e0b

Browse files
committed
template: Ensuring template is cross zone if type changed to system
1 parent 6718be0 commit bec4e0b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,9 @@ private VMTemplateVO updateTemplateOrIso(BaseUpdateTemplateOrIsoCmd cmd) {
21082108
if (templateType != null && cmd.isRoutingType() != null && (TemplateType.ROUTING.equals(templateType) != cmd.isRoutingType())) {
21092109
throw new InvalidParameterValueException("Please specify a valid templatetype (consistent with isrouting parameter).");
21102110
}
2111+
if (templateType != null && (templateType == TemplateType.SYSTEM || templateType == TemplateType.BUILTIN) && !template.isCrossZones()) {
2112+
throw new InvalidParameterValueException("System and Builtin templates must be cross zone");
2113+
}
21112114
}
21122115

21132116
// update is needed if any of the fields below got filled by the user

0 commit comments

Comments
 (0)