Search in sources :

Example 41 with Network

use of com.cloud.legacymodel.network.Network in project cosmic by MissionCriticalCloud.

the class NiciraNvpGuestNetworkGuruTest method testDesign.

@Test
public void testDesign() {
    final PhysicalNetworkVO physnet = mock(PhysicalNetworkVO.class);
    when(physnetdao.findById((Long) any())).thenReturn(physnet);
    when(physnet.getIsolationMethods()).thenReturn(Arrays.asList(new String[] { "STT", "VXLAN" }));
    when(physnet.getId()).thenReturn(NETWORK_ID);
    final NiciraNvpDeviceVO device = mock(NiciraNvpDeviceVO.class);
    when(nvpdao.listByPhysicalNetwork(NETWORK_ID)).thenReturn(Arrays.asList(new NiciraNvpDeviceVO[] { device }));
    when(device.getId()).thenReturn(1L);
    final NetworkOffering offering = mock(NetworkOffering.class);
    when(offering.getId()).thenReturn(NETWORK_ID);
    when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
    when(offering.getGuestType()).thenReturn(GuestType.Isolated);
    when(nosd.areServicesSupportedByNetworkOffering(NETWORK_ID, Service.Connectivity)).thenReturn(true);
    final DeploymentPlan plan = mock(DeploymentPlan.class);
    final Network network = mock(Network.class);
    final Account account = mock(Account.class);
    final Network designednetwork = guru.design(offering, plan, network, account);
    assertTrue(designednetwork != null);
    assertTrue(designednetwork.getBroadcastDomainType() == BroadcastDomainType.Lswitch);
}
Also used : Account(com.cloud.legacymodel.user.Account) NetworkOffering(com.cloud.offering.NetworkOffering) NiciraNvpDeviceVO(com.cloud.network.NiciraNvpDeviceVO) Network(com.cloud.legacymodel.network.Network) PhysicalNetworkVO(com.cloud.network.dao.PhysicalNetworkVO) DeploymentPlan(com.cloud.deploy.DeploymentPlan) Test(org.junit.Test)

Example 42 with Network

use of com.cloud.legacymodel.network.Network in project cosmic by MissionCriticalCloud.

the class CreatePrivateNetworkTest method setup.

@Before
public void setup() throws Exception {
    MockitoAnnotations.initMocks(this);
    networkService._accountMgr = _accountMgr;
    networkService._networkOfferingDao = _networkOfferingDao;
    networkService._physicalNetworkDao = _physicalNetworkDao;
    networkService._dcDao = _dcDao;
    networkService._networksDao = _networkDao;
    networkService._networkMgr = _networkMgr;
    networkService._privateIpDao = _privateIpDao;
    final Account account = new AccountVO("testaccount", 1, "networkdomain", (short) 0, UUID.randomUUID().toString());
    when(networkService._accountMgr.getAccount(anyLong())).thenReturn(account);
    final NetworkOfferingVO ntwkOff = new NetworkOfferingVO("offer", "fakeOffer", TrafficType.Guest, true, true, null, null, false, null, null, GuestType.Isolated, false, false, false, false, false, false, false, false, false, false, false, false, false);
    when(networkService._networkOfferingDao.findById(anyLong())).thenReturn(ntwkOff);
    final List<NetworkOfferingVO> netofferlist = new ArrayList<>();
    netofferlist.add(ntwkOff);
    when(networkService._networkOfferingDao.listSystemNetworkOfferings()).thenReturn(netofferlist);
    final PhysicalNetworkVO physicalNetwork = new PhysicalNetworkVO(1L, 1L, "2-5", "200", 1L, null, "testphysicalnetwork");
    when(networkService._physicalNetworkDao.findById(anyLong())).thenReturn(physicalNetwork);
    final DataCenterVO dc = new DataCenterVO(1L, "DC", "Datacenter", "1.2.3.4", null, null, null, "10.1.1.0/24", "unreal.net", 1L, NetworkType.Advanced, null, null);
    when(networkService._dcDao.lockRow(anyLong(), anyBoolean())).thenReturn(dc);
    when(networkService._networksDao.getPrivateNetwork(anyString(), anyString(), eq(1L), eq(1L), anyLong())).thenReturn(null);
    final Network net = new NetworkVO(1L, TrafficType.Guest, DHCPMode.None, BroadcastDomainType.Vlan, 1L, 1L, 1L, 1L, "bla", "fake", "eet.net", GuestType.Isolated, 1L, 1L, ACLType.Account, false, 1L, false, "1.2.3.4", null, null, null, null);
    when(networkService._networkMgr.createGuestNetwork(eq(ntwkOff.getId()), eq("bla"), eq("fake"), eq("10.1.1.1"), eq("10.1.1.0/24"), anyString(), anyString(), eq(account), anyLong(), eq(physicalNetwork), eq(physicalNetwork.getDataCenterId()), eq(ACLType.Account), anyBoolean(), eq(1L), anyString(), anyString(), anyBoolean(), anyString(), eq("1.2.3.4"), eq(null), eq(null), eq(null), eq(null))).thenReturn(net);
    when(networkService._privateIpDao.findByIpAndSourceNetworkId(net.getId(), "10.1.1.2")).thenReturn(null);
    when(networkService._privateIpDao.findByIpAndSourceNetworkIdAndVpcId(eq(1L), anyString(), eq(1L))).thenReturn(null);
}
Also used : DataCenterVO(com.cloud.dc.DataCenterVO) Account(com.cloud.legacymodel.user.Account) NetworkVO(com.cloud.network.dao.NetworkVO) PhysicalNetworkVO(com.cloud.network.dao.PhysicalNetworkVO) Network(com.cloud.legacymodel.network.Network) ArrayList(java.util.ArrayList) PhysicalNetworkVO(com.cloud.network.dao.PhysicalNetworkVO) NetworkOfferingVO(com.cloud.offerings.NetworkOfferingVO) AccountVO(com.cloud.user.AccountVO) Before(org.junit.Before)

Example 43 with Network

use of com.cloud.legacymodel.network.Network in project cosmic by MissionCriticalCloud.

the class UpdateNetworkCmdByAdmin method execute.

@Override
public void execute() throws InsufficientCapacityException, ConcurrentOperationException {
    final User callerUser = _accountService.getActiveUser(CallContext.current().getCallingUserId());
    final Account callerAccount = _accountService.getActiveAccountById(callerUser.getAccountId());
    final Network network = _networkService.getNetwork(id);
    if (network == null) {
        throw new InvalidParameterValueException("Couldn't find network by id");
    }
    final Network result = _networkService.updateGuestNetwork(getId(), getNetworkName(), getDisplayText(), callerAccount, callerUser, getNetworkDomain(), getNetworkOfferingId(), getChangeCidr(), getGuestVmCidr(), getDisplayNetwork(), getCustomId(), getDns1(), getDns2(), getIpExclusionList(), getDhcpTftpServer(), getDhcpBootfileName());
    if (result != null) {
        final NetworkResponse response = _responseGenerator.createNetworkResponse(ResponseView.Full, result);
        response.setResponseName(getCommandName());
        setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network");
    }
}
Also used : Account(com.cloud.legacymodel.user.Account) User(com.cloud.legacymodel.user.User) ServerApiException(com.cloud.api.ServerApiException) InvalidParameterValueException(com.cloud.legacymodel.exceptions.InvalidParameterValueException) Network(com.cloud.legacymodel.network.Network) NetworkResponse(com.cloud.api.response.NetworkResponse)

Example 44 with Network

use of com.cloud.legacymodel.network.Network in project cosmic by MissionCriticalCloud.

the class VirtualMachineManagerImpl method orchestrateMigrateWithStorage.

private void orchestrateMigrateWithStorage(final String vmUuid, final long srcHostId, final long destHostId, final Map<Long, Long> volumeToPool) throws ResourceUnavailableException, ConcurrentOperationException {
    final VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
    final HostVO srcHost = _hostDao.findById(srcHostId);
    final HostVO destHost = _hostDao.findById(destHostId);
    final VirtualMachineGuru vmGuru = getVmGuru(vm);
    final Zone zone = _zoneRepository.findById(destHost.getDataCenterId()).orElse(null);
    final HostPodVO pod = _podDao.findById(destHost.getPodId());
    final Cluster cluster = _clusterDao.findById(destHost.getClusterId());
    final DeployDestination destination = new DeployDestination(zone, pod, cluster, destHost);
    // Create a map of which volume should go in which storage pool.
    final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm);
    final Map<Volume, StoragePool> volumeToPoolMap = getPoolListForVolumesForMigration(profile, destHost, volumeToPool);
    // a vm and not migrating a vm with storage.
    if (volumeToPoolMap == null || volumeToPoolMap.isEmpty()) {
        throw new InvalidParameterValueException("Migration of the vm " + vm + "from host " + srcHost + " to destination host " + destHost + " doesn't involve migrating the volumes.");
    }
    AlertManager.AlertType alertType = AlertManager.AlertType.ALERT_TYPE_USERVM_MIGRATE;
    if (VirtualMachineType.DomainRouter.equals(vm.getType())) {
        alertType = AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER_MIGRATE;
    } else if (VirtualMachineType.ConsoleProxy.equals(vm.getType())) {
        alertType = AlertManager.AlertType.ALERT_TYPE_CONSOLE_PROXY_MIGRATE;
    }
    _networkMgr.prepareNicForMigration(profile, destination);
    volumeMgr.prepareForMigration(profile, destination);
    final HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType());
    final VirtualMachineTO to = hvGuru.implement(profile);
    ItWorkVO work = new ItWorkVO(UUID.randomUUID().toString(), _nodeId, State.Migrating, vm.getType(), vm.getId());
    work.setStep(Step.Prepare);
    work.setResourceType(ItWorkVO.ResourceType.Host);
    work.setResourceId(destHostId);
    work = _workDao.persist(work);
    // Put the vm in migrating state.
    vm.setLastHostId(srcHostId);
    moveVmToMigratingState(vm, destHostId, work);
    boolean migrated = false;
    try {
        // config drive: Detach the config drive at source host
        // After migration successful attach the config drive in destination host
        // On migration failure VM will be stopped, So configIso will be deleted
        final Nic defaultNic = _networkModel.getDefaultNic(vm.getId());
        List<String[]> vmData = null;
        if (defaultNic != null) {
            final UserVmVO userVm = _userVmDao.findById(vm.getId());
            final Map<String, String> details = _vmDetailsDao.listDetailsKeyPairs(vm.getId());
            vm.setDetails(details);
            final Network network = _networkModel.getNetwork(defaultNic.getNetworkId());
            if (_networkModel.isSharedNetworkWithoutServices(network.getId())) {
                final String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getId(), vm.getServiceOfferingId()).getDisplayText();
                final String zoneName = _dcDao.findById(vm.getDataCenterId()).getName();
                final boolean isWindows = _guestOSCategoryDao.findById(_guestOSDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows");
                vmData = _networkModel.generateVmData(userVm.getUserData(), serviceOffering, zoneName, vm.getInstanceName(), vm.getId(), (String) profile.getParameter(VirtualMachineProfile.Param.VmSshPubKey), (String) profile.getParameter(VirtualMachineProfile.Param.VmPassword), isWindows, network);
                final String vmName = vm.getInstanceName();
                final String configDriveIsoRootFolder = "/tmp";
                final String isoFile = configDriveIsoRootFolder + "/" + vmName + "/configDrive/" + vmName + ".iso";
                profile.setVmData(vmData);
                profile.setConfigDriveLabel(VmConfigDriveLabel.value());
                profile.setConfigDriveIsoRootFolder(configDriveIsoRootFolder);
                profile.setConfigDriveIsoFile(isoFile);
                // At source host detach the config drive iso.
                final AttachOrDettachConfigDriveCommand dettachCommand = new AttachOrDettachConfigDriveCommand(vm.getInstanceName(), vmData, VmConfigDriveLabel.value(), false);
                try {
                    _agentMgr.send(srcHost.getId(), dettachCommand);
                    s_logger.debug("Deleted config drive ISO for  vm " + vm.getInstanceName() + " In host " + srcHost);
                } catch (final OperationTimedoutException e) {
                    s_logger.debug("TIme out occured while exeuting command AttachOrDettachConfigDrive " + e.getMessage());
                }
            }
        }
        // Migrate the vm and its volume.
        volumeMgr.migrateVolumes(vm, to, srcHost, destHost, volumeToPoolMap);
        // Put the vm back to running state.
        moveVmOutofMigratingStateOnSuccess(vm, destHost.getId(), work);
        try {
            if (!checkVmOnHost(vm, destHostId)) {
                s_logger.error("Vm not found on destination host. Unable to complete migration for " + vm);
                try {
                    _agentMgr.send(srcHostId, new Commands(cleanup(vm.getInstanceName())), null);
                } catch (final AgentUnavailableException e) {
                    s_logger.error("AgentUnavailableException while cleanup on source host: " + srcHostId);
                }
                cleanup(vmGuru, new VirtualMachineProfileImpl(vm), work, Event.AgentReportStopped, true);
                throw new CloudRuntimeException("VM not found on desintation host. Unable to complete migration for " + vm);
            }
        } catch (final OperationTimedoutException e) {
            s_logger.warn("Error while checking the vm " + vm + " is on host " + destHost, e);
        }
        migrated = true;
    } finally {
        if (!migrated) {
            s_logger.info("Migration was unsuccessful.  Cleaning up: " + vm);
            _alertMgr.sendAlert(alertType, srcHost.getDataCenterId(), srcHost.getPodId(), "Unable to migrate vm " + vm.getInstanceName() + " from host " + srcHost.getName() + " in zone " + zone.getName() + " and pod " + zone.getName(), "Migrate Command failed.  Please check logs.");
            try {
                _agentMgr.send(destHostId, new Commands(cleanup(vm.getInstanceName())), null);
                stateTransitTo(vm, Event.OperationFailed, srcHostId);
            } catch (final AgentUnavailableException e) {
                s_logger.warn("Looks like the destination Host is unavailable for cleanup.", e);
            } catch (final NoTransitionException e) {
                s_logger.error("Error while transitioning vm from migrating to running state.", e);
            }
        }
        work.setStep(Step.Done);
        _workDao.update(work.getId(), work);
    }
}
Also used : AlertManager(com.cloud.alert.AlertManager) OperationTimedoutException(com.cloud.legacymodel.exceptions.OperationTimedoutException) StoragePool(com.cloud.legacymodel.storage.StoragePool) HostPodVO(com.cloud.dc.HostPodVO) VirtualMachineTO(com.cloud.legacymodel.to.VirtualMachineTO) HypervisorGuru(com.cloud.hypervisor.HypervisorGuru) InvalidParameterValueException(com.cloud.legacymodel.exceptions.InvalidParameterValueException) AgentUnavailableException(com.cloud.legacymodel.exceptions.AgentUnavailableException) CloudRuntimeException(com.cloud.legacymodel.exceptions.CloudRuntimeException) Network(com.cloud.legacymodel.network.Network) Commands(com.cloud.agent.manager.Commands) TimeZone(java.util.TimeZone) Zone(com.cloud.db.model.Zone) Cluster(com.cloud.legacymodel.dc.Cluster) Nic(com.cloud.legacymodel.network.Nic) HostVO(com.cloud.host.HostVO) AttachOrDettachConfigDriveCommand(com.cloud.legacymodel.communication.command.AttachOrDettachConfigDriveCommand) Volume(com.cloud.legacymodel.storage.Volume) DeployDestination(com.cloud.deploy.DeployDestination) NoTransitionException(com.cloud.legacymodel.exceptions.NoTransitionException)

Example 45 with Network

use of com.cloud.legacymodel.network.Network in project cosmic by MissionCriticalCloud.

the class NetworkOrchestrator method destroyNetwork.

@Override
@DB
public boolean destroyNetwork(final long networkId, final ReservationContext context, final boolean forced) {
    final Account callerAccount = context.getAccount();
    NetworkVO network = _networksDao.findById(networkId);
    if (network == null) {
        s_logger.debug("Unable to find network with id: " + networkId);
        return false;
    }
    // Make sure that there are no user vms in the network that are not Expunged/Error
    final List<UserVmVO> userVms = _userVmDao.listByNetworkIdAndStates(networkId);
    for (final UserVmVO vm : userVms) {
        if (!(vm.getState() == VirtualMachine.State.Expunging && vm.getRemoved() != null)) {
            s_logger.warn("Can't delete the network, not all user vms are expunged. Vm " + vm + " is in " + vm.getState() + " state");
            return false;
        }
    }
    // Don't allow to delete network via api call when it has vms assigned to it
    final int nicCount = getActiveNicsInNetwork(networkId);
    if (nicCount > 0) {
        s_logger.debug("The network id=" + networkId + " has active Nics, but shouldn't.");
        // at this point we have already determined that there are no active user vms in network
        // if the op_networks table shows active nics, it's a bug in releasing nics updating op_networks
        _networksDao.changeActiveNicsBy(networkId, -1 * nicCount);
    }
    // In Basic zone, make sure that there are no non-removed console proxies and SSVMs using the network
    final Zone zone = _zoneRepository.findById(network.getDataCenterId()).orElse(null);
    if (zone.getNetworkType() == com.cloud.model.enumeration.NetworkType.Basic) {
        final List<VMInstanceVO> systemVms = _vmDao.listNonRemovedVmsByTypeAndNetwork(network.getId(), VirtualMachineType.ConsoleProxy, VirtualMachineType.SecondaryStorageVm);
        if (systemVms != null && !systemVms.isEmpty()) {
            s_logger.warn("Can't delete the network, not all consoleProxy/secondaryStorage vms are expunged");
            return false;
        }
    }
    // Shutdown network first
    shutdownNetwork(networkId, context, false);
    // get updated state for the network
    network = _networksDao.findById(networkId);
    if (network.getState() != Network.State.Allocated && network.getState() != Network.State.Setup && !forced) {
        s_logger.debug("Network is not not in the correct state to be destroyed: " + network.getState());
        return false;
    }
    boolean success = true;
    if (!cleanupNetworkResources(networkId, callerAccount, context.getCaller().getId())) {
        s_logger.warn("Unable to delete network id=" + networkId + ": failed to cleanup network resources");
        return false;
    }
    // get providers to destroy
    final List<Provider> providersToDestroy = getNetworkProviders(network.getId());
    for (final NetworkElement element : networkElements) {
        if (providersToDestroy.contains(element.getProvider())) {
            try {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("Sending destroy to " + element);
                }
                if (!element.destroy(network, context)) {
                    success = false;
                    s_logger.warn("Unable to complete destroy of the network: failed to destroy network element " + element.getName());
                }
            } catch (final ResourceUnavailableException e) {
                s_logger.warn("Unable to complete destroy of the network due to element: " + element.getName(), e);
                success = false;
            } catch (final ConcurrentOperationException e) {
                s_logger.warn("Unable to complete destroy of the network due to element: " + element.getName(), e);
                success = false;
            } catch (final Exception e) {
                s_logger.warn("Unable to complete destroy of the network due to element: " + element.getName(), e);
                success = false;
            }
        }
    }
    if (success) {
        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Network id=" + networkId + " is destroyed successfully, cleaning up corresponding resources now.");
        }
        final NetworkVO networkFinal = network;
        try {
            Transaction.execute(new TransactionCallbackNoReturn() {

                @Override
                public void doInTransactionWithoutResult(final TransactionStatus status) {
                    final NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, networkFinal.getGuruName());
                    // Deleting sync networks
                    final List<NetworkVO> syncNetworks = _networksDao.listSyncNetworksByRelatedNetwork(networkId);
                    syncNetworks.forEach(syncNetwork -> removeAndShutdownSyncNetwork(syncNetwork.getId()));
                    guru.trash(networkFinal, _networkOfferingDao.findById(networkFinal.getNetworkOfferingId()));
                    if (!deleteVlansInNetwork(networkFinal.getId(), context.getCaller().getId(), callerAccount)) {
                        s_logger.warn("Failed to delete network " + networkFinal + "; was unable to cleanup corresponding ip ranges");
                        throw new CloudRuntimeException("Failed to delete network " + networkFinal + "; was unable to cleanup corresponding ip ranges");
                    } else {
                        // commit transaction only when ips and vlans for the network are released successfully
                        try {
                            stateTransitTo(networkFinal, Event.DestroyNetwork);
                        } catch (final NoTransitionException e) {
                            s_logger.debug(e.getMessage());
                        }
                        if (_networksDao.remove(networkFinal.getId())) {
                            final NetworkDomainVO networkDomain = _networkDomainDao.getDomainNetworkMapByNetworkId(networkFinal.getId());
                            if (networkDomain != null) {
                                _networkDomainDao.remove(networkDomain.getId());
                            }
                            final NetworkAccountVO networkAccount = _networkAccountDao.getAccountNetworkMapByNetworkId(networkFinal.getId());
                            if (networkAccount != null) {
                                _networkAccountDao.remove(networkAccount.getId());
                            }
                        }
                        final NetworkOffering ntwkOff = _entityMgr.findById(NetworkOffering.class, networkFinal.getNetworkOfferingId());
                        final boolean updateResourceCount = resourceCountNeedsUpdate(ntwkOff, networkFinal.getAclType());
                        if (updateResourceCount) {
                            _resourceLimitMgr.decrementResourceCount(networkFinal.getAccountId(), ResourceType.network, networkFinal.getDisplayNetwork());
                        }
                    }
                }
            });
            if (_networksDao.findById(network.getId()) == null) {
                // remove its related ACL permission
                final Pair<Class<?>, Long> networkMsg = new Pair<>(Network.class, networkFinal.getId());
                _messageBus.publish(_name, EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, networkMsg);
            }
            return true;
        } catch (final CloudRuntimeException e) {
            s_logger.error("Failed to delete network", e);
            return false;
        }
    }
    return success;
}
Also used : PhysicalNetworkTrafficTypeDao(com.cloud.network.dao.PhysicalNetworkTrafficTypeDao) NetworkModel(com.cloud.network.NetworkModel) ConfigKey(com.cloud.framework.config.ConfigKey) HostDao(com.cloud.host.dao.HostDao) ConnectionException(com.cloud.legacymodel.exceptions.ConnectionException) VMNetworkMapVO(com.cloud.engine.cloud.entity.api.db.VMNetworkMapVO) InvalidParameterValueException(com.cloud.legacymodel.exceptions.InvalidParameterValueException) Nic(com.cloud.legacymodel.network.Nic) PodVlanMapDao(com.cloud.dc.dao.PodVlanMapDao) Scope(com.cloud.framework.config.ConfigKey.Scope) Transaction(com.cloud.utils.db.Transaction) TransactionCallbackWithExceptionNoReturn(com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn) AgentManager(com.cloud.agent.AgentManager) PhysicalNetworkTrafficTypeVO(com.cloud.network.dao.PhysicalNetworkTrafficTypeVO) ReservationContext(com.cloud.vm.ReservationContext) VlanDao(com.cloud.dc.dao.VlanDao) Map(java.util.Map) NetworkServiceMapDao(com.cloud.network.dao.NetworkServiceMapDao) ZoneRepository(com.cloud.db.repository.ZoneRepository) PhysicalNetworkDao(com.cloud.network.dao.PhysicalNetworkDao) Host(com.cloud.legacymodel.dc.Host) PhysicalNetworkSetupInfo(com.cloud.legacymodel.network.PhysicalNetworkSetupInfo) PhysicalNetworkVO(com.cloud.network.dao.PhysicalNetworkVO) NetworkGuru(com.cloud.network.guru.NetworkGuru) FirewallRule(com.cloud.legacymodel.network.FirewallRule) DataCenterVnetVO(com.cloud.dc.DataCenterVnetVO) NicTO(com.cloud.legacymodel.to.NicTO) TransactionStatus(com.cloud.utils.db.TransactionStatus) StartupCommand(com.cloud.legacymodel.communication.command.startup.StartupCommand) Set(java.util.Set) StaticNatRule(com.cloud.legacymodel.network.StaticNatRule) NetworkElement(com.cloud.network.element.NetworkElement) NetworkOfferingVO(com.cloud.offerings.NetworkOfferingVO) Executors(java.util.concurrent.Executors) ACLType(com.cloud.legacymodel.acl.ControlledEntity.ACLType) ReservationStrategy(com.cloud.legacymodel.network.Nic.ReservationStrategy) DataCenter(com.cloud.legacymodel.dc.DataCenter) PortForwardingRulesDao(com.cloud.network.rules.dao.PortForwardingRulesDao) StaticNatRuleImpl(com.cloud.network.rules.StaticNatRuleImpl) AccountDao(com.cloud.user.dao.AccountDao) AdapterBase(com.cloud.utils.component.AdapterBase) ResourceAllocationException(com.cloud.legacymodel.exceptions.ResourceAllocationException) IpAddressManager(com.cloud.network.IpAddressManager) NumbersUtil(com.cloud.utils.NumbersUtil) ManagerBase(com.cloud.utils.component.ManagerBase) NetworkOrchestrationService(com.cloud.engine.orchestration.service.NetworkOrchestrationService) StateMachine2(com.cloud.legacymodel.statemachine.StateMachine2) UserDataServiceProvider(com.cloud.network.element.UserDataServiceProvider) VirtualMachine(com.cloud.legacymodel.vm.VirtualMachine) CallContext(com.cloud.context.CallContext) Zone(com.cloud.db.model.Zone) IpDeployer(com.cloud.network.element.IpDeployer) NetworkOfferingServiceMapDao(com.cloud.offerings.dao.NetworkOfferingServiceMapDao) NicProfile(com.cloud.vm.NicProfile) ArrayList(java.util.ArrayList) Purpose(com.cloud.legacymodel.network.FirewallRule.Purpose) LinkedHashMap(java.util.LinkedHashMap) LoadBalancingServiceProvider(com.cloud.network.element.LoadBalancingServiceProvider) VlanVO(com.cloud.dc.VlanVO) ConfigurationDao(com.cloud.framework.config.dao.ConfigurationDao) DomainRouterVO(com.cloud.vm.DomainRouterVO) BroadcastDomainType(com.cloud.model.enumeration.BroadcastDomainType) StaticNatServiceProvider(com.cloud.network.element.StaticNatServiceProvider) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) VMInstanceDao(com.cloud.vm.dao.VMInstanceDao) ConcurrentOperationException(com.cloud.legacymodel.exceptions.ConcurrentOperationException) DomainRouterDao(com.cloud.vm.dao.DomainRouterDao) MessageBus(com.cloud.framework.messagebus.MessageBus) VirtualMachineType(com.cloud.model.enumeration.VirtualMachineType) Op(com.cloud.utils.db.SearchCriteria.Op) EntityManager(com.cloud.dao.EntityManager) UserVmDao(com.cloud.vm.dao.UserVmDao) HostStatus(com.cloud.legacymodel.dc.HostStatus) InsufficientVirtualNetworkCapacityException(com.cloud.legacymodel.exceptions.InsufficientVirtualNetworkCapacityException) NoTransitionException(com.cloud.legacymodel.exceptions.NoTransitionException) NicDao(com.cloud.vm.dao.NicDao) PhysicalNetwork(com.cloud.network.PhysicalNetwork) RemoteAccessVpn(com.cloud.network.RemoteAccessVpn) DB(com.cloud.utils.db.DB) ReservationContextImpl(com.cloud.vm.ReservationContextImpl) ManagedContextRunnable(com.cloud.common.managed.context.ManagedContextRunnable) InsufficientAddressCapacityException(com.cloud.legacymodel.exceptions.InsufficientAddressCapacityException) GlobalLock(com.cloud.utils.db.GlobalLock) NetworkOfferingDetailsDao(com.cloud.offerings.dao.NetworkOfferingDetailsDao) RulesManager(com.cloud.network.rules.RulesManager) CheckNetworkAnswer(com.cloud.legacymodel.communication.answer.CheckNetworkAnswer) NicSecondaryIpDao(com.cloud.vm.dao.NicSecondaryIpDao) AggregatedCommandExecutor(com.cloud.network.element.AggregatedCommandExecutor) LoggerFactory(org.slf4j.LoggerFactory) InsufficientCapacityException(com.cloud.legacymodel.exceptions.InsufficientCapacityException) Service(com.cloud.legacymodel.network.Network.Service) NetworkType(com.cloud.model.enumeration.NetworkType) Networks(com.cloud.network.Networks) NetworkAccountVO(com.cloud.network.dao.NetworkAccountVO) AlertManager(com.cloud.alert.AlertManager) StateMachine2Transitions(com.cloud.utils.fsm.StateMachine2Transitions) AgentControlAnswer(com.cloud.legacymodel.communication.answer.AgentControlAnswer) NetworkMigrationResponder(com.cloud.network.NetworkMigrationResponder) IllegalVirtualMachineException(com.cloud.legacymodel.exceptions.IllegalVirtualMachineException) DeploymentPlan(com.cloud.deploy.DeploymentPlan) VMNetworkMapDao(com.cloud.engine.cloud.entity.api.db.dao.VMNetworkMapDao) ResourceLimitService(com.cloud.user.ResourceLimitService) URI(java.net.URI) Vlan(com.cloud.legacymodel.dc.Vlan) Scheme(com.cloud.legacymodel.network.LoadBalancerContainer.Scheme) NetworkProfile(com.cloud.network.NetworkProfile) TransactionCallbackNoReturn(com.cloud.utils.db.TransactionCallbackNoReturn) PublishScope(com.cloud.framework.messagebus.PublishScope) TrafficType(com.cloud.model.enumeration.TrafficType) VMInstanceVO(com.cloud.vm.VMInstanceVO) TransactionCallback(com.cloud.utils.db.TransactionCallback) DeployDestination(com.cloud.deploy.DeployDestination) IpAddress(com.cloud.network.IpAddress) VpcVirtualNetworkApplianceService(com.cloud.network.VpcVirtualNetworkApplianceService) AccountGuestVlanMapVO(com.cloud.network.dao.AccountGuestVlanMapVO) Command(com.cloud.legacymodel.communication.command.Command) AgentControlCommand(com.cloud.legacymodel.communication.command.agentcontrol.AgentControlCommand) NicVO(com.cloud.vm.NicVO) UUID(java.util.UUID) VpcManager(com.cloud.network.vpc.VpcManager) HypervisorType(com.cloud.model.enumeration.HypervisorType) PodVlanMapVO(com.cloud.dc.PodVlanMapVO) List(java.util.List) Provider(com.cloud.legacymodel.network.Network.Provider) NetworkDomainVO(com.cloud.network.dao.NetworkDomainVO) NetworkOfferingServiceMapVO(com.cloud.offerings.NetworkOfferingServiceMapVO) User(com.cloud.legacymodel.user.User) DhcpServiceProvider(com.cloud.network.element.DhcpServiceProvider) Answer(com.cloud.legacymodel.communication.answer.Answer) NetUtils(com.cloud.utils.net.NetUtils) NetworkServiceMapVO(com.cloud.network.dao.NetworkServiceMapVO) NetworkDomainDao(com.cloud.network.dao.NetworkDomainDao) DataCenterVnetDao(com.cloud.dc.dao.DataCenterVnetDao) VirtualMachineProfile(com.cloud.vm.VirtualMachineProfile) ResourceType(com.cloud.legacymodel.configuration.Resource.ResourceType) Event(com.cloud.legacymodel.network.Network.Event) DataCenterDeployment(com.cloud.deploy.DataCenterDeployment) SearchBuilder(com.cloud.utils.db.SearchBuilder) StartupRoutingCommand(com.cloud.legacymodel.communication.command.startup.StartupRoutingCommand) Configurable(com.cloud.framework.config.Configurable) HashMap(java.util.HashMap) UnsupportedServiceException(com.cloud.legacymodel.exceptions.UnsupportedServiceException) NetworkDao(com.cloud.network.dao.NetworkDao) ConfigurationException(javax.naming.ConfigurationException) Domain(com.cloud.legacymodel.domain.Domain) PortForwardingRuleVO(com.cloud.network.rules.PortForwardingRuleVO) JoinType(com.cloud.utils.db.JoinBuilder.JoinType) ResourceUnavailableException(com.cloud.legacymodel.exceptions.ResourceUnavailableException) Inject(javax.inject.Inject) HashSet(java.util.HashSet) Listener(com.cloud.agent.Listener) CheckNetworkCommand(com.cloud.legacymodel.communication.command.CheckNetworkCommand) IPAddressVO(com.cloud.network.dao.IPAddressVO) NetworkVO(com.cloud.network.dao.NetworkVO) PhysicalNetworkServiceProviderDao(com.cloud.network.dao.PhysicalNetworkServiceProviderDao) IPAddressDao(com.cloud.network.dao.IPAddressDao) GuestType(com.cloud.model.enumeration.GuestType) RedundantState(com.cloud.legacymodel.network.VirtualRouter.RedundantState) FirewallRulesDao(com.cloud.network.dao.FirewallRulesDao) NamedThreadFactory(com.cloud.utils.concurrency.NamedThreadFactory) PublicIp(com.cloud.network.addr.PublicIp) Network(com.cloud.legacymodel.network.Network) ConfigurationManager(com.cloud.configuration.ConfigurationManager) LoadBalancingRulesManager(com.cloud.network.lb.LoadBalancingRulesManager) Logger(org.slf4j.Logger) Pair(com.cloud.legacymodel.utils.Pair) NetworkACLManager(com.cloud.network.vpc.NetworkACLManager) Account(com.cloud.legacymodel.user.Account) Capability(com.cloud.legacymodel.network.Network.Capability) CloudRuntimeException(com.cloud.legacymodel.exceptions.CloudRuntimeException) PrivateIpDao(com.cloud.network.vpc.dao.PrivateIpDao) AccountGuestVlanMapDao(com.cloud.network.dao.AccountGuestVlanMapDao) NetworkOffering(com.cloud.offering.NetworkOffering) TimeUnit(java.util.concurrent.TimeUnit) UserVmVO(com.cloud.vm.UserVmVO) RemoteAccessVpnService(com.cloud.network.vpn.RemoteAccessVpnService) NetworkOfferingDao(com.cloud.offerings.dao.NetworkOfferingDao) NetworkAccountDao(com.cloud.network.dao.NetworkAccountDao) Vpc(com.cloud.legacymodel.network.vpc.Vpc) FirewallRuleVO(com.cloud.network.rules.FirewallRuleVO) FirewallManager(com.cloud.network.rules.FirewallManager) NicSecondaryIpVO(com.cloud.vm.dao.NicSecondaryIpVO) Comparator(java.util.Comparator) Collections(java.util.Collections) Account(com.cloud.legacymodel.user.Account) UserVmVO(com.cloud.vm.UserVmVO) TransactionStatus(com.cloud.utils.db.TransactionStatus) TransactionCallbackNoReturn(com.cloud.utils.db.TransactionCallbackNoReturn) NetworkElement(com.cloud.network.element.NetworkElement) CloudRuntimeException(com.cloud.legacymodel.exceptions.CloudRuntimeException) NetworkDomainVO(com.cloud.network.dao.NetworkDomainVO) ArrayList(java.util.ArrayList) List(java.util.List) Pair(com.cloud.legacymodel.utils.Pair) PhysicalNetworkVO(com.cloud.network.dao.PhysicalNetworkVO) NetworkVO(com.cloud.network.dao.NetworkVO) NetworkOffering(com.cloud.offering.NetworkOffering) Zone(com.cloud.db.model.Zone) NetworkGuru(com.cloud.network.guru.NetworkGuru) VMInstanceVO(com.cloud.vm.VMInstanceVO) ConcurrentOperationException(com.cloud.legacymodel.exceptions.ConcurrentOperationException) ConnectionException(com.cloud.legacymodel.exceptions.ConnectionException) InvalidParameterValueException(com.cloud.legacymodel.exceptions.InvalidParameterValueException) ResourceAllocationException(com.cloud.legacymodel.exceptions.ResourceAllocationException) ConcurrentOperationException(com.cloud.legacymodel.exceptions.ConcurrentOperationException) InsufficientVirtualNetworkCapacityException(com.cloud.legacymodel.exceptions.InsufficientVirtualNetworkCapacityException) NoTransitionException(com.cloud.legacymodel.exceptions.NoTransitionException) InsufficientAddressCapacityException(com.cloud.legacymodel.exceptions.InsufficientAddressCapacityException) InsufficientCapacityException(com.cloud.legacymodel.exceptions.InsufficientCapacityException) IllegalVirtualMachineException(com.cloud.legacymodel.exceptions.IllegalVirtualMachineException) UnsupportedServiceException(com.cloud.legacymodel.exceptions.UnsupportedServiceException) ConfigurationException(javax.naming.ConfigurationException) ResourceUnavailableException(com.cloud.legacymodel.exceptions.ResourceUnavailableException) CloudRuntimeException(com.cloud.legacymodel.exceptions.CloudRuntimeException) UserDataServiceProvider(com.cloud.network.element.UserDataServiceProvider) LoadBalancingServiceProvider(com.cloud.network.element.LoadBalancingServiceProvider) StaticNatServiceProvider(com.cloud.network.element.StaticNatServiceProvider) Provider(com.cloud.legacymodel.network.Network.Provider) DhcpServiceProvider(com.cloud.network.element.DhcpServiceProvider) NoTransitionException(com.cloud.legacymodel.exceptions.NoTransitionException) ResourceUnavailableException(com.cloud.legacymodel.exceptions.ResourceUnavailableException) NetworkAccountVO(com.cloud.network.dao.NetworkAccountVO) DB(com.cloud.utils.db.DB)

Aggregations

Network (com.cloud.legacymodel.network.Network)160 ArrayList (java.util.ArrayList)57 InvalidParameterValueException (com.cloud.legacymodel.exceptions.InvalidParameterValueException)56 Account (com.cloud.legacymodel.user.Account)46 CloudRuntimeException (com.cloud.legacymodel.exceptions.CloudRuntimeException)42 NetworkOffering (com.cloud.offering.NetworkOffering)36 PhysicalNetwork (com.cloud.network.PhysicalNetwork)34 IPAddressVO (com.cloud.network.dao.IPAddressVO)32 ResourceUnavailableException (com.cloud.legacymodel.exceptions.ResourceUnavailableException)30 NetworkVO (com.cloud.network.dao.NetworkVO)28 List (java.util.List)28 Zone (com.cloud.db.model.Zone)27 DB (com.cloud.utils.db.DB)27 NicProfile (com.cloud.vm.NicProfile)26 Nic (com.cloud.legacymodel.network.Nic)21 DataCenter (com.cloud.legacymodel.dc.DataCenter)20 ConcurrentOperationException (com.cloud.legacymodel.exceptions.ConcurrentOperationException)20 PhysicalNetworkVO (com.cloud.network.dao.PhysicalNetworkVO)19 DomainRouterVO (com.cloud.vm.DomainRouterVO)18 ActionEvent (com.cloud.event.ActionEvent)17