public List<Long> getNetworkIds() { if (ipToNetworkList != null && !ipToNetworkList.isEmpty()) { if ((networkIds != null && !networkIds.isEmpty()) || ipAddress != null || getIp6Address() != null) { throw new InvalidParameterValueException("ipToNetworkMap can't be specified along with networkIds or ipAddress"); } else { List<Long> networks = new ArrayList<Long>(); networks.addAll(getIpToNetworkMap().keySet()); return networks; } } return networkIds; }
Account owner = _accountService.getActiveAccountById(cmd.getEntityOwnerId()); verifyDetails(cmd.getDetails()); Long zoneId = cmd.getZoneId(); Long serviceOfferingId = cmd.getServiceOfferingId(); Long templateId = cmd.getTemplateId(); for(String detail: cmd.getDetails().keySet()) { if(detail.equalsIgnoreCase(VmDetailConstants.CPU_NUMBER) || detail.equalsIgnoreCase(VmDetailConstants.CPU_SPEED) || detail.equalsIgnoreCase(VmDetailConstants.MEMORY)) { throw new InvalidParameterValueException("cpuNumber or cpuSpeed or memory should not be specified for static service offering"); Long diskOfferingId = cmd.getDiskOfferingId(); DiskOffering diskOffering = null; if (diskOfferingId != null) { String ipAddress = cmd.getIpAddress(); String ip6Address = cmd.getIp6Address(); String macAddress = cmd.getMacAddress(); String name = cmd.getName(); String displayName = cmd.getDisplayName(); UserVm vm = null; IpAddresses addrs = new IpAddresses(ipAddress, ip6Address, macAddress); Long size = cmd.getSize(); String group = cmd.getGroup(); String userData = cmd.getUserData(); String sshKeyPairName = cmd.getSSHKeyPairName();
UserVm result; if (getStartVm()) { try { CallContext.current().setEventDetails("Vm Id: " + getEntityUuid()); result = _userVmService.startVirtualMachine(this); } catch (ResourceUnavailableException ex) { result = _userVmService.getUserVm(getEntityId()); response.setResponseName(getCommandName()); setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to deploy vm uuid:"+getEntityUuid());
InsufficientCapacityException, ConcurrentOperationException { long vmId = cmd.getEntityId(); Long hostId = cmd.getHostId(); UserVmVO vm = _vmDao.findById(vmId); if (!cmd.getDataDiskTemplateToDiskOfferingMap().isEmpty()) { List<VolumeVO> vols = _volsDao.findByInstance(tmpVm.getId()); for (VolumeVO vol : vols) {
public List<Long> getAffinityGroupIdList() { if (affinityGroupNameList != null && affinityGroupIdList != null) { throw new InvalidParameterValueException("affinitygroupids parameter is mutually exclusive with affinitygroupnames parameter"); } // transform group names to ids here if (affinityGroupNameList != null) { List<Long> affinityGroupIds = new ArrayList<Long>(); for (String groupName : affinityGroupNameList) { Long groupId = _responseGenerator.getAffinityGroupId(groupName, getEntityOwnerId()); if (groupId == null) { throw new InvalidParameterValueException("Unable to find affinity group by name " + groupName); } else { affinityGroupIds.add(groupId); } } return affinityGroupIds; } else { return affinityGroupIdList; } }
public Map<Long, IpAddresses> getIpToNetworkMap() { if ((networkIds != null || ipAddress != null || getIp6Address() != null) && ipToNetworkList != null) { throw new InvalidParameterValueException("NetworkIds and ipAddress can't be specified along with ipToNetworkMap parameter");