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/08/26 14:27:21 UTC

[GitHub] [cloudstack] wido commented on a change in pull request #3563: Limit API from trying to start a VM that is already running

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:
users@infra.apache.org


With regards,
Apache Git Services