@Override public Quota getLeftQuota(String projectId) throws VimException, PluginException { Quota result = new Quota(); for (BaseVimInstance vimInstance : vimInstanceRepository.findByProjectId(projectId)) { if (vimInstance.getType().equals("test")) { continue; } Quota tmp = vimBroker.getLeftQuota(vimInstance); result.setCores(result.getCores() + tmp.getCores()); result.setFloatingIps(result.getFloatingIps() + tmp.getFloatingIps()); result.setInstances(result.getInstances() + tmp.getInstances()); result.setRam(result.getRam() + tmp.getRam()); } return result; } }
@Override public Quota getAllQuota(String projectId) throws PluginException, VimException { Quota result = new Quota(); for (BaseVimInstance vimInstance : vimInstanceRepository.findByProjectId(projectId)) { if (vimInstance.getType().equals("test")) { continue; } Quota tmp = vimBroker.getVim(vimInstance.getType()).getQuota(vimInstance); result.setCores(result.getCores() + tmp.getCores()); result.setFloatingIps(result.getFloatingIps() + tmp.getFloatingIps()); result.setInstances(result.getInstances() + tmp.getInstances()); result.setRam(result.getRam() + tmp.getRam()); } return result; }
.get(vimInstance) .setFloatingIps( requirements.get(vimInstance).getFloatingIps() + floatingIpCount); || leftQuota.getCores() < neededQuota.getCores() || leftQuota.getInstances() < neededQuota.getInstances() || leftQuota.getFloatingIps() < neededQuota.getFloatingIps()) { throw new VimException( "The VIM "
maximalQuota.setKeyPairs(Integer.MAX_VALUE); if (maximalQuota.getFloatingIps() == -1) { maximalQuota.setFloatingIps(Integer.MAX_VALUE); || maximalQuota.getCores() < 0 || maximalQuota.getKeyPairs() < 0 || maximalQuota.getFloatingIps() < 0) { log.error( "Infinite quota are not allowed. Please set nfvo.vim.drivers.allowInfiniteQuota to true or change the "