@Override public List<? extends Network> listNetworksByVpc(long vpcId) { return _networksDao.listByVpc(vpcId); }
@Override public List<? extends Network> getVpcNetworks(final long vpcId) { return _ntwkDao.listByVpc(vpcId); }
private void verifyAlreadyMigratedTiers(long migratedVpcId, long vpcOfferingId, Map<String, String> networkToOffering) { Vpc migratedVpc = _vpcDao.findById(migratedVpcId); if (migratedVpc.getVpcOfferingId() != vpcOfferingId) { s_logger.error("The vpc is already partially migrated in a previous run. The provided vpc offering is not the same as the one used during the first migration process."); throw new InvalidParameterValueException("Failed to resume migrating VPC as VPC offering does not match previously specified VPC offering (" + migratedVpc.getVpcOfferingId() + ")"); } List<NetworkVO> migratedTiers = _networksDao.listByVpc(migratedVpcId); for (Network tier : migratedTiers) { String tierNetworkOfferingUuid = networkToOffering.get(tier.getUuid()); if (!StringUtils.isNotBlank(tierNetworkOfferingUuid)) { throwInvalidIdException("Failed to resume migrating VPC as the specified tierNetworkOfferings is not complete", String.valueOf(tier.getUuid()), "networkUuid"); } NetworkOfferingVO newNetworkOffering = _networkOfferingDao.findByUuid(tierNetworkOfferingUuid); if (newNetworkOffering == null) { throw new InvalidParameterValueException("Failed to migrate VPC as at least one tier offering in tierNetworkOfferings does not exist."); } if (newNetworkOffering.getId() != tier.getNetworkOfferingId()) { NetworkOfferingVO tierNetworkOffering = _networkOfferingDao.findById(tier.getNetworkOfferingId()); throw new InvalidParameterValueException( "Failed to resume migrating VPC as at least one network offering in tierNetworkOfferings does not match previously specified network offering (network uuid=" + tier.getUuid() + " was previously specified with offering uuid=" + tierNetworkOffering.getUuid() + ")"); } } }
final List<? extends Network> ntwks = _ntwkDao.listByVpc(vpc.getId()); for (final Network ntwk : ntwks) { assert cidr != null : "Why the network cidr is null when it belongs to vpc?";
boolean isVpc = designedNetwork.getVpcId() != null; if (isVpc && _networkDao.listByVpc(designedNetwork.getVpcId()).size() > 1) { boolean isVsdManagedVpc = isVsdManagedVpc(designedNetwork.getVpcId()); if (isVsdManagedVpc && externalId == null) {
List<NetworkVO> tiersInVpc = _networksDao.listByVpc(vpcId); vpcTiersCanBeMigrated(tiersInVpc, account, networkToOffering, resume);