You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2014/01/31 03:08:09 UTC
[06/11] git commit: updated refs/heads/4.3 to e089b91
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 775fa0f0d02f182e3cba02faed569272b00e9926)
Signed-off-by: Animesh Chaturvedi <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/523cbdda
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/523cbdda
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/523cbdda
Branch: refs/heads/4.3
Commit: 523cbdda687f259fd0bee7e6b79fa0fb035fc990
Parents: d7e1d38
Author: Koushik Das <ko...@apache.org>
Authored: Thu Jan 30 18:07:24 2014 +0530
Committer: Animesh Chaturvedi <an...@apache.org>
Committed: Thu Jan 30 17:54:50 2014 -0800
----------------------------------------------------------------------
.../src/com/cloud/vm/VirtualMachineManagerImpl.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/523cbdda/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 6dc5894..e533386 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -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);
}