Examples of NiciraNvpDeviceVO


Examples of com.cloud.network.NiciraNvpDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No NiciraNvp Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());
        _hostDao.loadDetails(niciraNvpHost);

        Account owner = context.getAccount();

        /**
 
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No NiciraNvp Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());

        NiciraNvpNicMappingVO existingNicMap = _niciraNvpNicMappingDao
                .findByNicUuid(nicVO.getUuid());
        if (existingNicMap != null) {
            FindLogicalSwitchPortCommand findCmd = new FindLogicalSwitchPortCommand(
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No NiciraNvp Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());

        NiciraNvpNicMappingVO nicMap = _niciraNvpNicMappingDao
                .findByNicUuid(nicVO.getUuid());
        if (nicMap == null) {
            s_logger.error("No mapping for nic " + nic.getName());
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No NiciraNvp Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());

        if (_networkModel.isProviderSupportServiceInNetwork(network.getId(),
                Service.SourceNat, Provider.NiciraNvp)) {
            s_logger.debug("Apparently we were providing SourceNat on this network");
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

        ServerResource resource = new NiciraNvpResource();
        String deviceName = Network.Provider.NiciraNvp.getName();
        NetworkDevice networkDevice = NetworkDevice
                .getNetworkDevice(deviceName);
        Long physicalNetworkId = cmd.getPhysicalNetworkId();
        NiciraNvpDeviceVO niciraNvpDevice = null;

        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao
                .findById(physicalNetworkId);
        if (physicalNetwork == null) {
            throw new InvalidParameterValueException(
                    "Could not find phyical network with ID: "
                            + physicalNetworkId);
        }
        long zoneId = physicalNetwork.getDataCenterId();

        PhysicalNetworkServiceProviderVO ntwkSvcProvider = _physicalNetworkServiceProviderDao
                .findByServiceProvider(physicalNetwork.getId(),
                        networkDevice.getNetworkServiceProvder());
        if (ntwkSvcProvider == null) {
            throw new CloudRuntimeException("Network Service Provider: "
                    + networkDevice.getNetworkServiceProvder()
                    + " is not enabled in the physical network: "
                    + physicalNetworkId + "to add this device");
        } else if (ntwkSvcProvider.getState() == PhysicalNetworkServiceProvider.State.Shutdown) {
            throw new CloudRuntimeException("Network Service Provider: "
                    + ntwkSvcProvider.getProviderName()
                    + " is in shutdown state in the physical network: "
                    + physicalNetworkId + "to add this device");
        }

        if (_niciraNvpDao.listByPhysicalNetwork(physicalNetworkId).size() != 0) {
            throw new CloudRuntimeException(
                    "A NiciraNvp device is already configured on this physical network");
        }

        Map<String, String> params = new HashMap<String, String>();
        params.put("guid", UUID.randomUUID().toString());
        params.put("zoneId", String.valueOf(physicalNetwork.getDataCenterId()));
        params.put("physicalNetworkId", String.valueOf(physicalNetwork.getId()));
        params.put("name", "Nicira Controller - " + cmd.getHost());
        params.put("ip", cmd.getHost());
        params.put("adminuser", cmd.getUsername());
        params.put("adminpass", cmd.getPassword());
        params.put("transportzoneuuid", cmd.getTransportzoneUuid());
        // FIXME What to do with multiple isolation types
        params.put("transportzoneisotype",
                physicalNetwork.getIsolationMethods().get(0).toLowerCase());
        if (cmd.getL3GatewayServiceUuid() != null) {
            params.put("l3gatewayserviceuuid", cmd.getL3GatewayServiceUuid());
        }

        Map<String, Object> hostdetails = new HashMap<String, Object>();
        hostdetails.putAll(params);

        Transaction txn = Transaction.currentTxn();
        try {
            resource.configure(cmd.getHost(), hostdetails);

            Host host = _resourceMgr.addHost(zoneId, resource,
                    Host.Type.L2Networking, params);
            if (host != null) {
                txn.start();

                niciraNvpDevice = new NiciraNvpDeviceVO(host.getId(),
                        physicalNetworkId, ntwkSvcProvider.getProviderName(),
                        deviceName);
                _niciraNvpDao.persist(niciraNvpDevice);

                DetailVO detail = new DetailVO(host.getId(),
                        "niciranvpdeviceid", String.valueOf(niciraNvpDevice
                                .getId()));
                _hostDetailsDao.persist(detail);

                txn.commit();
                return niciraNvpDevice;
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

    }

    @Override
    public boolean deleteNiciraNvpDevice(DeleteNiciraNvpDeviceCmd cmd) {
        Long niciraDeviceId = cmd.getNiciraNvpDeviceId();
        NiciraNvpDeviceVO niciraNvpDevice = _niciraNvpDao
                .findById(niciraDeviceId);
        if (niciraNvpDevice == null) {
            throw new InvalidParameterValueException(
                    "Could not find a nicira device with id " + niciraDeviceId);
        }       

        // Find the physical network we work for
        Long physicalNetworkId = niciraNvpDevice.getPhysicalNetworkId();
        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao
                .findById(physicalNetworkId);
        if (physicalNetwork != null) {
            // Lets see if there are networks that use us
            // Find the nicira networks on this physical network
            List<NetworkVO> networkList = _networkDao
                    .listByPhysicalNetwork(physicalNetworkId);

            // Networks with broadcast type lswitch are ours
            for (NetworkVO network : networkList) {
                if (network.getBroadcastDomainType() == Networks.BroadcastDomainType.Lswitch) {
                    if ((network.getState() != Network.State.Shutdown)
                            && (network.getState() != Network.State.Destroy)) {
                        throw new CloudRuntimeException(
                                "This Nicira Nvp device can not be deleted as there are one or more logical networks provisioned by cloudstack.");
                    }
                }
            }
        }

        HostVO niciraHost = _hostDao.findById(niciraNvpDevice.getHostId());
        Long hostId = niciraHost.getId();

        niciraHost.setResourceState(ResourceState.Maintenance);
        _hostDao.update(hostId, niciraHost);
        _resourceMgr.deleteHost(hostId, false, false);
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

            throw new InvalidParameterValueException(
                    "Either physical network Id or nicira device Id must be specified");
        }

        if (niciraNvpDeviceId != null) {
            NiciraNvpDeviceVO niciraNvpDevice = _niciraNvpDao
                    .findById(niciraNvpDeviceId);
            if (niciraNvpDevice == null) {
                throw new InvalidParameterValueException(
                        "Could not find Nicira Nvp device with id: "
                                + niciraNvpDevice);
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

    @Override   
    public List<? extends Network> listNiciraNvpDeviceNetworks(
            ListNiciraNvpDeviceNetworksCmd cmd) {
        Long niciraDeviceId = cmd.getNiciraNvpDeviceId();
        NiciraNvpDeviceVO niciraNvpDevice = _niciraNvpDao
                .findById(niciraDeviceId);
        if (niciraNvpDevice == null) {
            throw new InvalidParameterValueException(
                    "Could not find a nicira device with id " + niciraDeviceId);
        }       

        // Find the physical network we work for
        Long physicalNetworkId = niciraNvpDevice.getPhysicalNetworkId();
        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao
                .findById(physicalNetworkId);
        if (physicalNetwork == null) {
            // No such physical network, so no provisioned networks
            return Collections.emptyList();
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

            if (devices.isEmpty()) {
                s_logger.error("No NiciraNvp Controller on physical network "
                        + network.getPhysicalNetworkId());
                return false;
            }
            NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
            HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());
            _hostDao.loadDetails(niciraNvpHost);

            NiciraNvpRouterMappingVO routermapping = _niciraNvpRouterMappingDao
                    .findByNetworkId(network.getId());
            if (routermapping == null) {
View Full Code Here

Examples of com.cloud.network.NiciraNvpDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No NiciraNvp Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);
        HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId());

        NiciraNvpRouterMappingVO routermapping = _niciraNvpRouterMappingDao
                .findByNetworkId(network.getId());
        if (routermapping == null) {
            s_logger.error("No logical router uuid found for network "
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.