mirror of
https://github.com/apache/cloudstack
synced 2026-08-05 10:36:44 +00:00
CLOUDSTACK-3535: fix regression introduced in 5d9fa5d42e
This commit is contained in:
parent
4c6ec5f3c6
commit
6b4aed2aca
@ -522,6 +522,7 @@ public class VolumeServiceImpl implements VolumeService {
|
||||
if (result.isSuccess()) {
|
||||
vo.processEvent(Event.OperationSuccessed, result.getAnswer());
|
||||
} else {
|
||||
|
||||
vo.processEvent(Event.OperationFailed);
|
||||
volResult.setResult(result.getResult());
|
||||
}
|
||||
|
||||
@ -59,15 +59,19 @@ public class KVMInvestigator extends AdapterBase implements Investigator {
|
||||
return null;
|
||||
}
|
||||
CheckOnHostCommand cmd = new CheckOnHostCommand(agent);
|
||||
List<HostVO> neighbors = _resourceMgr.listAllHostsInCluster(agent.getClusterId());
|
||||
List<HostVO> neighbors = _resourceMgr.listHostsInClusterByStatus(agent.getClusterId(), Status.Up);
|
||||
for (HostVO neighbor : neighbors) {
|
||||
if (neighbor.getId() == agent.getId() || neighbor.getHypervisorType() != Hypervisor.HypervisorType.KVM) {
|
||||
continue;
|
||||
}
|
||||
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd);
|
||||
|
||||
return answer.getResult() ? Status.Down : Status.Up;
|
||||
|
||||
try {
|
||||
Answer answer = _agentMgr.easySend(neighbor.getId(), cmd);
|
||||
if (answer != null) {
|
||||
return answer.getResult() ? Status.Down : Status.Up;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
s_logger.debug("Failed to send command to host: " + neighbor.getId());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@ -1254,10 +1254,14 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
|
||||
} catch (AgentUnavailableException e) {
|
||||
s_logger.warn("Unable to stop vm, agent unavailable: " + e.toString());
|
||||
throw e;
|
||||
if (!forced) {
|
||||
throw e;
|
||||
}
|
||||
} catch (OperationTimedoutException e) {
|
||||
s_logger.warn("Unable to stop vm, operation timed out: " + e.toString());
|
||||
throw e;
|
||||
if (!forced) {
|
||||
throw e;
|
||||
}
|
||||
} finally {
|
||||
if (!stopped) {
|
||||
if (!forced) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user