@Nullable @Override public String apply(@Nullable DomainRouterVO input) { return input != null ? input.getUuid() : null; } });
protected DomainRouterVO start(final DomainRouterVO elbVm, final Map<Param, Object> params) throws ConcurrentOperationException { s_logger.debug("Starting ELB VM " + elbVm); _itMgr.start(elbVm.getUuid(), params); return _routerDao.findById(elbVm.getId()); } }
private DomainRouterVO stop(DomainRouterVO elbVm, boolean forced) throws ConcurrentOperationException, ResourceUnavailableException { s_logger.debug("Stopping ELB vm " + elbVm); try { _itMgr.advanceStop(elbVm.getUuid(), forced); return _routerDao.findById(elbVm.getId()); } catch (OperationTimedoutException e) { throw new CloudRuntimeException("Unable to stop " + elbVm, e); } }
protected VirtualRouter stopInternalLbVm(DomainRouterVO internalLbVm, boolean forced, Account caller, long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException { s_logger.debug("Stopping internal lb vm " + internalLbVm); try { _itMgr.advanceStop(internalLbVm.getUuid(), forced); return _internalLbVmDao.findById(internalLbVm.getId()); } catch (OperationTimedoutException e) { throw new CloudRuntimeException("Unable to stop " + internalLbVm, e); } }
protected VirtualRouter stopInternalLbVm(final DomainRouterVO internalLbVm, final boolean forced, final Account caller, final long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException { s_logger.debug("Stopping internal lb vm " + internalLbVm); try { _itMgr.advanceStop(internalLbVm.getUuid(), forced); return _internalLbVmDao.findById(internalLbVm.getId()); } catch (final OperationTimedoutException e) { throw new CloudRuntimeException("Unable to stop " + internalLbVm, e); } }
@Override public VirtualRouter destroyRouter(final long routerId, final Account caller, final Long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException { if (s_logger.isDebugEnabled()) { s_logger.debug("Attempting to destroy router " + routerId); } final DomainRouterVO router = _routerDao.findById(routerId); if (router == null) { return null; } _accountMgr.checkAccess(caller, null, true, router); _itMgr.expunge(router.getUuid()); _routerDao.remove(router.getId()); return router; }
@Override public boolean destroyInternalLbVm(final long vmId, final Account caller, final Long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException { if (s_logger.isDebugEnabled()) { s_logger.debug("Attempting to destroy Internal LB vm " + vmId); } final DomainRouterVO internalLbVm = _internalLbVmDao.findById(vmId); if (internalLbVm == null) { return true; } _accountMgr.checkAccess(caller, null, true, internalLbVm); _itMgr.expunge(internalLbVm.getUuid()); _internalLbVmDao.remove(internalLbVm.getId()); return true; }
try { s_logger.info("Attempting to destroy ELB VM: " + elbVm); _itMgr.expunge(elbVm.getUuid()); _routerDao.remove(elbVm.getId()); } catch (ResourceUnavailableException e) {
protected DomainRouterVO startInternalLbVm(DomainRouterVO internalLbVm, final Account caller, final long callerUserId, final Map<Param, Object> params) throws StorageUnavailableException, InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException { s_logger.debug("Starting Internal LB VM " + internalLbVm); _itMgr.start(internalLbVm.getUuid(), params, null, null); if (internalLbVm.isStopPending()) { s_logger.info("Clear the stop pending flag of Internal LB VM " + internalLbVm.getHostName() + " after start router successfully!"); internalLbVm.setStopPending(false); internalLbVm = _internalLbVmDao.persist(internalLbVm); } return _internalLbVmDao.findById(internalLbVm.getId()); }
protected VirtualRouter stopNetScalerVm(final long vmId, final boolean forced, final Account caller, final long callerUserId) throws ResourceUnavailableException, ConcurrentOperationException { final DomainRouterVO netscalerVm = _routerDao.findById(vmId); s_logger.debug("Stopping NetScaler vm " + netscalerVm); if (netscalerVm == null || netscalerVm.getRole() != Role.NETSCALER_VM) { throw new InvalidParameterValueException("Can't find NetScaler vm by id specified"); } _accountMgr.checkAccess(caller, null, true, netscalerVm); try { _itMgr.expunge(netscalerVm.getUuid()); return _routerDao.findById(netscalerVm.getId()); } catch (final Exception e) { throw new CloudRuntimeException("Unable to stop " + netscalerVm, e); } }
@Override public VirtualRouter stopNetScalerVm(Long vmId, boolean forced, Account caller, long callingUserId) { final DomainRouterVO netscalerVm = _routerDao.findById(vmId); s_logger.debug("Stopping NetScaler vm " + netscalerVm); if (netscalerVm == null || netscalerVm.getRole() != Role.NETSCALER_VM) { throw new InvalidParameterValueException("Can't find NetScaler vm by id specified"); } _accountMgr.checkAccess(caller, null, true, netscalerVm); try { _itMgr.expunge(netscalerVm.getUuid()); return _routerDao.findById(netscalerVm.getId()); } catch (final Exception e) { throw new CloudRuntimeException("Unable to stop " + netscalerVm, e); } } }
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()); }
e.printStackTrace(); vmVO= _vmDao.findByUuid(nsVpx.getUuid()); Map<String, Object> deployResponse = new HashMap<String, Object>(); deployResponse.put("vm", vmVO);
vmMgr.advanceStart(domR.getUuid(), null, null);