You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/05/10 05:35:35 UTC

[GitHub] [cloudstack] shwstppr commented on a change in pull request #3320: server: fix for inactive service offering for VM

shwstppr commented on a change in pull request #3320: server: fix for inactive service offering for VM
URL: https://github.com/apache/cloudstack/pull/3320#discussion_r282751272
 
 

 ##########
 File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -965,6 +965,9 @@ public UserVm upgradeVirtualMachine(UpgradeVMCmd cmd) throws ResourceAllocationE
         // Check resource limits for CPU and Memory.
         Map<String, String> customParameters = cmd.getDetails();
         ServiceOfferingVO newServiceOffering = _offeringDao.findById(svcOffId);
+        if (newServiceOffering.getState() == DiskOffering.State.Inactive) {
+            throw new InvalidParameterValueException(String.format("Unable to upgrade virtual machine %s with an inactive service offering %s", vmInstance.toString(), newServiceOffering.getUuid()));
 
 Review comment:
   @anuragaw instead vmInstance.getUuid()? As we show UUIDs mostly.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services