Skip to content

Commit adee8d0

Browse files
committed
server: prevent autoscalevmpolicy with external template
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent d1c554c commit adee8d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/main/java/com/cloud/network/as/AutoScaleManagerImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ public AutoScaleVmProfile createAutoScaleVmProfile(CreateAutoScaleVmProfileCmd c
553553
if (template == null) {
554554
throw new InvalidParameterValueException("Unable to find template by id " + cmd.getTemplateId());
555555
}
556+
if (HypervisorType.External.equals(template.getHypervisorType())) {
557+
logger.error("Cannot create AutoScale Vm Profile with {} as it is an {} hypervisor template", template, HypervisorType.External);
558+
throw new InvalidParameterValueException(String.format("Unable to create AutoScale Vm Profile with template: %s", template.getName()));
559+
}
556560

557561
// validations
558562
HashMap<String, String> deployParams = cmd.getDeployParamMap();

0 commit comments

Comments
 (0)