mirror of https://github.com/apache/cloudstack.git
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
(cherry picked from commit 775fa0f0d0)
Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
parent
d7e1d38d48
commit
523cbdda68
|
|
@ -1529,6 +1529,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
}
|
||||
|
||||
protected boolean stateTransitTo(VMInstanceVO vm, VirtualMachine.Event e, Long hostId, String reservationId) throws NoTransitionException {
|
||||
// if there are active vm snapshots task, state change is not allowed
|
||||
if (_vmSnapshotMgr.hasActiveVMSnapshotTasks(vm.getId())) {
|
||||
s_logger.error("State transit with event: " + e + " failed due to: " + vm.getInstanceName() + " has active VM snapshots tasks");
|
||||
return false;
|
||||
}
|
||||
vm.setReservationId(reservationId);
|
||||
return _stateMachine.transitTo(vm, e, new Pair<Long, Long>(vm.getHostId(), hostId), _vmDao);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue