Skip to content

Commit

Permalink
engine: fix reboot on powering up VM
Browse files Browse the repository at this point in the history
When the VM was powering UP and had the
next run configuration, the cold reboot did not
work. It had several reasons that have been fixed
in this patch:

1. the VM was just cleared based on getVmManager().getPowerOffTimeout()
2. the VmAnalyzer:proceedDisappearedVm did not have
RebootInProgress case and the default one was executed.
However, the code never reached the setColdRebootFlag() as
the VM was listed as asyncRunning and scheduled for rerun.
3. the next run config was never applied as the VM was present
in asyncRunning and never added to movedDown list.

Bug-Url: https://bugzilla.redhat.com/1912911
  • Loading branch information
ljelinkova authored and ahadas committed Jul 28, 2022
1 parent c9f947e commit 14b24a8
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ private void logVmDown() {
* 3. Otherwise, the VM went down unexpectedly
*/
private void proceedDisappearedVm() {
if (System.nanoTime() - getVmManager().getPowerOffTimeout() < 0) {
if (!getVmManager().isColdReboot() && System.nanoTime() - getVmManager().getPowerOffTimeout() < 0) {
auditVmOnDownNormal(true);
resourceManager.removeAsyncRunningVm(dbVm.getId());
clearVm(VmExitStatus.Normal,
Expand All @@ -874,15 +874,16 @@ private void proceedDisappearedVm() {

break;

case RebootInProgress:
case PoweringDown:
if (getVmManager().isColdReboot()) {
setColdRebootFlag();
resourceManager.removeAsyncRunningVm(dbVm.getId());
}
clearVm(VmExitStatus.Normal,
String.format("VM %s shutdown complete", getVmManager().getName()),
VmExitReason.Success);

// not sure about that..
if (getVmManager().isColdReboot()) {
setColdRebootFlag();
}
break;

default:
Expand Down

0 comments on commit 14b24a8

Please sign in to comment.