mirror of https://github.com/apache/cloudstack.git
server: Fixed delayed power state update after vm shutdown (#4284)
After a vm is shutdown, the power state isn't updated immediately. This prevents changing the service offering. This PR updates the power state immediately after the vm is confirmed to be shutdown. Fixes: #3159
This commit is contained in:
parent
d5acabdbf7
commit
cb717741fc
|
|
@ -1658,6 +1658,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
}
|
||||
|
||||
guru.finalizeStop(profile, answer);
|
||||
final UserVmVO userVm = _userVmDao.findById(vm.getId());
|
||||
userVm.setPowerState(PowerState.PowerOff);
|
||||
_userVmDao.update(userVm.getId(), userVm);
|
||||
} else {
|
||||
s_logger.error("Invalid answer received in response to a StopCommand for " + vm.getInstanceName());
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue