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 2021/06/30 14:07:08 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5165: Prevent starting a VM in destroyed state (or any state but Stopped)

DaanHoogland commented on a change in pull request #5165:
URL: https://github.com/apache/cloudstack/pull/5165#discussion_r661509300



##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -881,8 +881,8 @@ protected boolean checkWorkItems(final VMInstanceVO vm, final State state) throw
             }
 
             if (state != State.Stopped) {
-                s_logger.debug("VM " + vm + " is not in a state to be started: " + state);
-                return null;
+                s_logger.warn("VM " + vm + " is not in a state to be started: " + state);
+                throw new CloudRuntimeException(String.format("Cannot start VM: %s in %s state", vm, state));

Review comment:
       ```suggestion
                   String msg = String.format("Cannot start VM: %s in %s state", vm, state)
                   s_logger.warn(msg);
                   throw new CloudRuntimeException(msg));
   ```




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org