Remove the hacking way of blocking VM state transition introduced by individual VM snapshot orchestration flow
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/434f8dab Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/434f8dab Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/434f8dab Branch: refs/heads/master Commit: 434f8dab72bfda3f1df414a46cf9235f6c7fbd89 Parents: 58c26ee Author: Kelven Yang <[email protected]> Authored: Tue Feb 4 16:42:57 2014 -0800 Committer: Kelven Yang <[email protected]> Committed: Fri Feb 28 15:35:58 2014 -0800 ---------------------------------------------------------------------- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/434f8dab/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 69f92c9..09a9980 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -1543,10 +1543,15 @@ 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; - } + + // Disable this hacking thing, VM snapshot task need to be managed by its orchestartion flow istelf instead of + // hacking it here at general VM manager + /* + 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); }
