Skip to content

Commit a58f6d4

Browse files
committed
fix for simulator test failures
1 parent 6c03978 commit a58f6d4

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,17 +1482,19 @@ public void orchestrateStart(final String vmUuid, final Map<VirtualMachineProfil
14821482
volumeMgr.prepare(vmProfile, dest);
14831483
}
14841484

1485-
Boolean returnAfterVolumePrepare = (Boolean) params.get(VirtualMachineProfile.Param.ReturnAfterVolumePrepare);
1486-
if (Boolean.TRUE.equals(returnAfterVolumePrepare)) {
1487-
logger.info("Returning from VM start command execution for VM {} as requested. Volumes are prepared and ready.", vm.getUuid());
1485+
if (params != null) {
1486+
Boolean returnAfterVolumePrepare = (Boolean) params.get(VirtualMachineProfile.Param.ReturnAfterVolumePrepare);
1487+
if (Boolean.TRUE.equals(returnAfterVolumePrepare)) {
1488+
logger.info("Returning from VM start command execution for VM {} as requested. Volumes are prepared and ready.", vm.getUuid());
14881489

1489-
if (!changeState(vm, Event.AgentReportStopped, destHostId, work, Step.Done)) {
1490-
logger.error("Unable to transition to a new state. VM uuid: {}, VM oldstate: {}, Event: {}", vm, vm.getState(), Event.AgentReportStopped);
1491-
throw new ConcurrentOperationException(String.format("Failed to deploy VM %s", vm));
1492-
}
1490+
if (!changeState(vm, Event.AgentReportStopped, destHostId, work, Step.Done)) {
1491+
logger.error("Unable to transition to a new state. VM uuid: {}, VM oldstate: {}, Event: {}", vm, vm.getState(), Event.AgentReportStopped);
1492+
throw new ConcurrentOperationException(String.format("Failed to deploy VM %s", vm));
1493+
}
14931494

1494-
logger.debug("Volume and preparation completed for VM {} (VM state set to Stopped)", vm);
1495-
return;
1495+
logger.debug("Volume preparation completed for VM {} (VM state set to Stopped)", vm);
1496+
return;
1497+
}
14961498
}
14971499

14981500
if (!reuseVolume) {

0 commit comments

Comments
 (0)