Skip to content

Commit 2227eb1

Browse files
committed
CLOUDSTACK-3535: fix regression introduced in 5d9fa5d
1 parent 6489b3b commit 2227eb1

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,14 @@ private void advanceStop(VMInstanceVO vm, boolean cleanUpEvenIfUnableToStop) thr
12031203

12041204
} catch (AgentUnavailableException e) {
12051205
s_logger.warn("Unable to stop vm, agent unavailable: " + e.toString());
1206-
throw e;
1206+
if (!forced) {
1207+
throw e;
1208+
}
12071209
} catch (OperationTimedoutException e) {
12081210
s_logger.warn("Unable to stop vm, operation timed out: " + e.toString());
1209-
throw e;
1211+
if (!forced) {
1212+
throw e;
1213+
}
12101214
} finally {
12111215
if (!stopped) {
12121216
if (!cleanUpEvenIfUnableToStop) {

‎engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ protected Void createVolumeFromBaseImageCallBack(
518518
if (result.isSuccess()) {
519519
vo.processEvent(Event.OperationSuccessed, result.getAnswer());
520520
} else {
521+
521522
vo.processEvent(Event.OperationFailed);
522523
volResult.setResult(result.getResult());
523524
// hack for Vmware: host is down, previously download template to the host needs to be re-downloaded, so we need to reset

‎plugins/hypervisors/kvm/src/com/cloud/ha/KVMInvestigator.java‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,19 @@ public Status isAgentAlive(Host agent) {
5858
return null;
5959
}
6060
CheckOnHostCommand cmd = new CheckOnHostCommand(agent);
61-
List<HostVO> neighbors = _resourceMgr.listAllHostsInCluster(agent.getClusterId());
61+
List<HostVO> neighbors = _resourceMgr.listHostsInClusterByStatus(agent.getClusterId(), Status.Up);
6262
for (HostVO neighbor : neighbors) {
6363
if (neighbor.getId() == agent.getId() || neighbor.getHypervisorType() != Hypervisor.HypervisorType.KVM) {
6464
continue;
6565
}
66-
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd);
67-
68-
return answer.getResult() ? Status.Down : Status.Up;
69-
66+
try {
67+
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd);
68+
if (answer != null) {
69+
return answer.getResult() ? Status.Down : Status.Up;
70+
}
71+
} catch (Exception e) {
72+
s_logger.debug("Failed to send command to host: " + neighbor.getId());
73+
}
7074
}
7175

7276
return null;

0 commit comments

Comments
 (0)