CLOUDSTACK-6124: During MS maintenance unfinished work items are not cleaned up resulting in them getting repeated for every subsequent maintenance Updating the op_it_work table entry appropriately in db once the unfinished work item is completed. (cherry picked from commit c6a8659ac2c2c85c6f0e9fb8af11606aaa2f9a37)
Signed-off-by: Animesh Chaturvedi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/360b7e3b Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/360b7e3b Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/360b7e3b Branch: refs/heads/4.3 Commit: 360b7e3b29061d88572a609bc5be7f3c7320f64a Parents: 26002ae Author: Koushik Das <[email protected]> Authored: Fri Feb 21 16:16:52 2014 +0530 Committer: Animesh Chaturvedi <[email protected]> Committed: Tue Mar 4 23:37:42 2014 -0800 ---------------------------------------------------------------------- .../orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360b7e3b/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 e533386..bcfe3b4 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -2129,10 +2129,12 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac if (work.getType() == State.Starting) { _haMgr.scheduleRestart(vm, true); work.setManagementServerId(_nodeId); + work.setStep(Step.Done); _workDao.update(work.getId(), work); } else if (work.getType() == State.Stopping) { _haMgr.scheduleStop(vm, vm.getHostId(), WorkType.CheckStop); work.setManagementServerId(_nodeId); + work.setStep(Step.Done); _workDao.update(work.getId(), work); } else if (work.getType() == State.Migrating) { _haMgr.scheduleMigration(vm);
