protected List<HypervisorType> getHypervisors(final DeployDestination dest, final DeploymentPlan plan, final List<HypervisorType> supportedHypervisors) throws InsufficientServerCapacityException { List<HypervisorType> hypervisors = new ArrayList<HypervisorType>(); final HypervisorType defaults = _resourceMgr.getDefaultHypervisor(dest.getDataCenter().getId()); if (defaults != HypervisorType.None) { hypervisors.add(defaults); } else { //if there is no default hypervisor, get it from the cluster hypervisors = _resourceMgr.getSupportedHypervisorTypes(dest.getDataCenter().getId(), true, plan.getPodId()); } //keep only elements defined in supported hypervisors final StringBuilder hTypesStr = new StringBuilder(); if (supportedHypervisors != null && !supportedHypervisors.isEmpty()) { hypervisors.retainAll(supportedHypervisors); for (final HypervisorType hType : supportedHypervisors) { hTypesStr.append(hType).append(" "); } } if (hypervisors.isEmpty()) { throw new InsufficientServerCapacityException("Unable to create internal lb vm, " + "there are no clusters in the zone ", DataCenter.class, dest.getDataCenter().getId()); } return hypervisors; }
protected List<HypervisorType> getHypervisors(final RouterDeploymentDefinition routerDeploymentDefinition) throws InsufficientServerCapacityException { final DeployDestination dest = routerDeploymentDefinition.getDest(); List<HypervisorType> hypervisors = new ArrayList<HypervisorType>(); if (dest.getCluster() != null) { if (dest.getCluster().getHypervisorType() == HypervisorType.Ovm) { hypervisors.add(getClusterToStartDomainRouterForOvm(dest.getCluster().getPodId())); } else { hypervisors.add(dest.getCluster().getHypervisorType()); } } else { final HypervisorType defaults = _resourceMgr.getDefaultHypervisor(dest.getDataCenter().getId()); if (defaults != HypervisorType.None) { hypervisors.add(defaults); } else { // if there is no default hypervisor, get it from the cluster hypervisors = _resourceMgr.getSupportedHypervisorTypes(dest.getDataCenter().getId(), true, routerDeploymentDefinition.getPlan().getPodId()); } } filterSupportedHypervisors(hypervisors); if (hypervisors.isEmpty()) { if (routerDeploymentDefinition.getPodId() != null) { throw new InsufficientServerCapacityException("Unable to create virtual router, there are no clusters in the pod." + getNoHypervisorsErrMsgDetails(), Pod.class, routerDeploymentDefinition.getPodId()); } throw new InsufficientServerCapacityException("Unable to create virtual router, there are no clusters in the zone." + getNoHypervisorsErrMsgDetails(), DataCenter.class, dest.getDataCenter().getId()); } return hypervisors; }
s_logger.debug("Unable to find destination for migrating the vm " + profile); throw new InsufficientServerCapacityException("Unable to find a server to migrate to.", host.getClusterId());
throw new InsufficientServerCapacityException("Unable to find a server to scale the vm to.", host.getClusterId());
throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId(), areAffinityGroupsAssociated(vmProfile));
continue; throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId(), areAffinityGroupsAssociated(vmProfile));