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 2020/08/26 06:53:46 UTC

[GitHub] [cloudstack] rhtyd commented on a change in pull request #4284: Fixed delayed power state update after vm shutdown

rhtyd commented on a change in pull request #4284:
URL: https://github.com/apache/cloudstack/pull/4284#discussion_r477073840



##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -1657,6 +1657,10 @@ protected boolean sendStop(final VirtualMachineGuru guru, final VirtualMachinePr
                     return false;
                 }
 
+                final UserVmVO userVm = _userVmDao.findById(vm.getId());
+                userVm.setPowerState(PowerState.PowerOff);
+                _userVmDao.update(userVm.getId(), userVm);
+
                 guru.finalizeStop(profile, answer);

Review comment:
       @Spaceman1984 should we update the power state after guru finalises the stop? What is there is an exception then the power state will be off while VM may actually be running?




----------------------------------------------------------------
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