Skip to content

Commit de7173a

Browse files
Likitha Shettysanjaytripathi
authored andcommitted
CLOUDSTACK-8410. ESXi host stuck disconnects frequently.
During ping task, while scanning and updating status of all VMs on the host that are stuck in a transitional state and are missing from the power report, do so only for VMs that are not removed.
1 parent f45e6b9 commit de7173a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3837,7 +3837,8 @@ private List<Long> listStalledVMInTransitionStateOnUpHost(final long hostId, fin
38373837
final String sql = "SELECT i.* FROM vm_instance as i, host as h WHERE h.status = 'UP' " +
38383838
"AND h.id = ? AND i.power_state_update_time < ? AND i.host_id = h.id " +
38393839
"AND (i.state ='Starting' OR i.state='Stopping' OR i.state='Migrating') " +
3840-
"AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)";
3840+
"AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)" +
3841+
"AND i.removed IS NULL";
38413842

38423843
final List<Long> l = new ArrayList<Long>();
38433844
TransactionLegacy txn = null;
@@ -3872,7 +3873,8 @@ private List<Long> listVMInTransitionStateWithRecentReportOnUpHost(final long ho
38723873
final String sql = "SELECT i.* FROM vm_instance as i, host as h WHERE h.status = 'UP' " +
38733874
"AND h.id = ? AND i.power_state_update_time > ? AND i.host_id = h.id " +
38743875
"AND (i.state ='Starting' OR i.state='Stopping' OR i.state='Migrating') " +
3875-
"AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)";
3876+
"AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)" +
3877+
"AND i.removed IS NULL";
38763878

38773879
final List<Long> l = new ArrayList<Long>();
38783880
TransactionLegacy txn = null;
@@ -3904,7 +3906,8 @@ private List<Long> listStalledVMInTransitionStateOnDisconnectedHosts(final Date
39043906
final String sql = "SELECT i.* FROM vm_instance as i, host as h WHERE h.status != 'UP' " +
39053907
"AND i.power_state_update_time < ? AND i.host_id = h.id " +
39063908
"AND (i.state ='Starting' OR i.state='Stopping' OR i.state='Migrating') " +
3907-
"AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)";
3909+
"AND i.id NOT IN (SELECT w.vm_instance_id FROM vm_work_job AS w JOIN async_job AS j ON w.id = j.id WHERE j.job_status = ?)" +
3910+
"AND i.removed IS NULL";
39083911

39093912
final List<Long> l = new ArrayList<Long>();
39103913
TransactionLegacy txn = null;

0 commit comments

Comments
 (0)