cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/4.3-forward to 775fa0f
Date Thu, 30 Jan 2014 12:47:55 GMT
Updated Branches:
  refs/heads/4.3-forward db3dc2ee1 -> 775fa0f0d


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


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/775fa0f0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/775fa0f0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/775fa0f0

Branch: refs/heads/4.3-forward
Commit: 775fa0f0d02f182e3cba02faed569272b00e9926
Parents: db3dc2e
Author: Koushik Das <koushik@apache.org>
Authored: Thu Jan 30 18:07:24 2014 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Thu Jan 30 18:10:56 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java             | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/775fa0f0/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 d32f144..3405d44 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);
     }


Mime
View raw message