network.setDns2(zone.getDns2()); network.setState(State.Implemented); _networkDao.persist(network, false, getServicesAndProvidersForNetwork(networkOfferingId)); id++;
s_logger.debug("setting public network " + publicNetwork + " to broadcast type vxlan"); publicNetwork.setBroadcastDomainType(BroadcastDomainType.Vxlan); _networksDao.persist(publicNetwork);
@Override public void deleteCopyOfNetwork(long networkCopyId, long originalNetworkId) { NetworkVO networkCopy = _networksDao.findById(networkCopyId); NicVO userNic = _nicDao.findByNetworkIdAndType(networkCopyId, VirtualMachine.Type.User); if (userNic != null) { s_logger.error("Something went wrong while migrating nics from the old network to the new network. Failed to delete copy of network. There are still user nics present in the network."); throw new CloudRuntimeException("Failed to delete copy of network. There are still user nics present in the network."); } NetworkVO originalNetwork = _networksDao.findById(originalNetworkId); swapUuids(originalNetwork, networkCopy); try { if (!_networkService.deleteNetwork(networkCopy.getId(), true)) { throw new CloudRuntimeException("Failed to delete network. Clean up not successful."); } } finally { swapUuids(networkCopy, originalNetwork); } originalNetwork.setRelated(originalNetworkId); _networksDao.persist(originalNetwork); }
@Override public void doInTransactionWithoutResult(final TransactionStatus status) { final NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(), relatedFile, name, displayText, predefined .getNetworkDomain(), offering.getGuestType(), plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType, offering.isSpecifyIpRanges(), vpcId, offering.isRedundantRouter(), predefined.getExternalId()); vo.setDisplayNetwork(isDisplayNetworkEnabled == null ? true : isDisplayNetworkEnabled); vo.setStrechedL2Network(offering.isSupportingStrechedL2()); final NetworkVO networkPersisted = _networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated, finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId())); networks.add(networkPersisted); if (predefined instanceof NetworkVO && guru instanceof NetworkGuruAdditionalFunctions){ final NetworkGuruAdditionalFunctions functions = (NetworkGuruAdditionalFunctions) guru; functions.finalizeNetworkDesign(networkPersisted.getId(), ((NetworkVO)predefined).getVlanIdAsUUID()); } if (domainId != null && aclType == ACLType.Domain) { _networksDao.addDomainToNetwork(id, domainId, subdomainAccess == null ? true : subdomainAccess); } } });
_ntwkDao.persist(gatewaynet);