@Override public Answer sendMessage(Command cmd) { String errMsg = null; try { long newHostId = _hvGuruMgr.getGuruProcessedCommandTargetHost(hostId, cmd); if (newHostId != hostId) { // update endpoint with new host if changed setId(newHostId); } return agentMgr.send(newHostId, cmd); } catch (AgentUnavailableException e) { errMsg = e.toString(); s_logger.debug("Failed to send command, due to Agent:" + getId() + ", " + e.toString()); } catch (OperationTimedoutException e) { errMsg = e.toString(); s_logger.debug("Failed to send command, due to Agent:" + getId() + ", " + e.toString()); } throw new CloudRuntimeException("Failed to send command, due to Agent:" + getId() + ", " + errMsg); }
protected void handleVmMigrated(VMInstanceVO vm) { if (!isVmSecurityGroupEnabled(vm.getId())) { return; } if (vm.getType() != VirtualMachine.Type.User) { Commands cmds = null; NetworkRulesSystemVmCommand nrc = new NetworkRulesSystemVmCommand(vm.getInstanceName(), vm.getType()); cmds = new Commands(nrc); try { _agentMgr.send(vm.getHostId(), cmds); } catch (AgentUnavailableException e) { s_logger.debug(e.toString()); } catch (OperationTimedoutException e) { s_logger.debug(e.toString()); } } else { List<Long> affectedVms = new ArrayList<Long>(); affectedVms.add(vm.getId()); scheduleRulesetUpdateToHosts(affectedVms, true, null); } }
protected DomainRouterVO start(DomainRouterVO router, final User user, final Account caller, final Map<Param, Object> params, final DeploymentPlan planToDeploy) throws StorageUnavailableException, InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { s_logger.debug("Starting router " + router); try { _itMgr.advanceStart(router.getUuid(), params, planToDeploy, null); } catch (final OperationTimedoutException e) { throw new ResourceUnavailableException("Starting router " + router + " failed! " + e.toString(), DataCenter.class, router.getDataCenterId()); } if (router.isStopPending()) { s_logger.info("Clear the stop pending flag of router " + router.getHostName() + " after start router successfully!"); router.setStopPending(false); router = _routerDao.persist(router); } // We don't want the failure of VPN Connection affect the status of // router, so we try to make connection // only after router start successfully final Long vpcId = router.getVpcId(); if (vpcId != null) { _s2sVpnMgr.reconnectDisconnectedVpnByVpc(vpcId); } return _routerDao.findById(router.getId()); }
s_logger.debug(e.toString()); } catch (OperationTimedoutException e) { s_logger.debug(e.toString());
s_logger.warn("Unable to stop vm, agent unavailable: " + e.toString()); } catch (final OperationTimedoutException e) { s_logger.warn("Unable to stop vm, operation timed out: " + e.toString()); } finally { if (!stopped) {
s_logger.debug("Creating VM snapshot: " + vmSnapshot.getName() + " failed: " + e.toString()); throw new CloudRuntimeException("Creating VM snapshot: " + vmSnapshot.getName() + " failed: " + e.toString()); } catch (AgentUnavailableException e) { s_logger.debug("Creating VM snapshot: " + vmSnapshot.getName() + " failed", e);