sureshanaparti commented on a change in pull request #5008:
URL: https://github.com/apache/cloudstack/pull/5008#discussion_r699036940



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -5367,12 +5414,17 @@ public UserVm createVirtualMachine(DeployVMCmd cmd) 
throws InsufficientCapacityE
         }
 
         Long serviceOfferingId = cmd.getServiceOfferingId();
+        Long overrideDiskOfferingId = cmd.getOverrideDiskOfferingId();
 
         ServiceOffering serviceOffering = 
_entityMgr.findById(ServiceOffering.class, serviceOfferingId);
         if (serviceOffering == null) {
             throw new InvalidParameterValueException("Unable to find service 
offering: " + serviceOfferingId);
         }
 
+        if (serviceOffering.getDiskOfferingStrictness() && 
overrideDiskOfferingId != null) {
+            throw new InvalidParameterValueException(String.format("Cannot 
user override disk offering id %d since provided service offering is strictly 
mapped to its disk offering", overrideDiskOfferingId));

Review comment:
       ```suggestion
               throw new InvalidParameterValueException(String.format("Cannot 
override disk offering id %d since provided service offering is strictly mapped 
to its disk offering", overrideDiskOfferingId));
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to