CLOUDSTACK-4659: Vmware allows destroying VM that has pending tasks, worker VM GC actually relies on the assumption that Vmware is protected from that which is a false assumption. Recycle Worker VM only it is from previous session
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/92db2d1a Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/92db2d1a Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/92db2d1a Branch: refs/heads/4.2 Commit: 92db2d1a441572e820e7e881167303d5b1ae4027 Parents: df52280 Author: Kelven Yang <kelv...@gmail.com> Authored: Fri Sep 20 10:59:06 2013 -0700 Committer: Kelven Yang <kelv...@gmail.com> Committed: Fri Sep 20 10:59:30 2013 -0700 ---------------------------------------------------------------------- .../com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92db2d1a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index a04a6eb..02b4060 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -572,12 +572,16 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw s_logger.info("Worker VM's owner management server has changed runid, recycle it"); return true; } - + + // disable time-out check until we have found out a VMware API that can check if + // there are pending tasks on the subject VM +/* if(System.currentTimeMillis() - startTick > _hungWorkerTimeout) { if(s_logger.isInfoEnabled()) s_logger.info("Worker VM expired, seconds elapsed: " + (System.currentTimeMillis() - startTick) / 1000); return true; } +*/ return false; }