mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
CLOUDSTACK-9199: Fixed deployVirtualMachine API does not throw an error when cpunumber is specified for static compute offering
This commit is contained in:
parent
7e12ebf280
commit
149f6c0514
@ -553,6 +553,14 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd {
|
||||
throw new InvalidParameterValueException("Unable to find service offering: " + serviceOfferingId);
|
||||
}
|
||||
|
||||
if(!serviceOffering.isDynamic()) {
|
||||
for(String detail: getDetails().keySet()) {
|
||||
if(detail.equalsIgnoreCase("cpuNumber") || detail.equalsIgnoreCase("cpuSpeed") || detail.equalsIgnoreCase("memory")) {
|
||||
throw new InvalidParameterValueException("cpuNumber or cpuSpeed or memory should not be specified for static service offering");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, templateId);
|
||||
// Make sure a valid template ID was specified
|
||||
if (template == null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user