Skip to content

Commit 580ebb0

Browse files
committed
CLOUDSTACK-5989: Trying to start a vm while 'vm snapshot' is in progress results in inconsistency
The fix is to fail the start operation if a vm snapshot is in progress
1 parent f2f605d commit 580ebb0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,11 @@ private void setStateMachine() {
15251525
}
15261526

15271527
protected boolean stateTransitTo(VMInstanceVO vm, VirtualMachine.Event e, Long hostId, String reservationId) throws NoTransitionException {
1528+
// if there are active vm snapshots task, state change is not allowed
1529+
if (_vmSnapshotMgr.hasActiveVMSnapshotTasks(vm.getId())) {
1530+
s_logger.error("State transit with event: " + e + " failed due to: " + vm.getInstanceName() + " has active VM snapshots tasks");
1531+
return false;
1532+
}
15281533
vm.setReservationId(reservationId);
15291534
return _stateMachine.transitTo(vm, e, new Pair<Long, Long>(vm.getHostId(), hostId), _vmDao);
15301535
}

0 commit comments

Comments
 (0)