wido commented on a change in pull request #3563: Limit API from trying to 
start a VM that is already running
URL: https://github.com/apache/cloudstack/pull/3563#discussion_r317629660
 
 

 ##########
 File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
 ##########
 @@ -4591,6 +4591,10 @@ public void finalizeStop(VirtualMachineProfile profile, 
Answer answer) {
             throw new PermissionDeniedException("The owner of " + vm + " is 
disabled: " + vm.getAccountId());
         }
 
+        if (vm.getState()== State.Running){
+            throw new InvalidParameterValueException("The virtual machine "+ 
vm.getDisplayName()+ " is already running");
 
 Review comment:
   Do we want to return ths displayname here and not the regular name of the VM?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to