Examples of BigSwitchVnsDeviceVO


Examples of com.cloud.network.BigSwitchVnsDeviceVO

    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
        try {
            BigSwitchVnsDeviceVO bigswitchVnsDeviceVO = _bigswitchVnsElementService.addBigSwitchVnsDevice(this);
            if (bigswitchVnsDeviceVO != null) {
                BigSwitchVnsDeviceResponse response = _bigswitchVnsElementService.createBigSwitchVnsDeviceResponse(bigswitchVnsDeviceVO);
                response.setObjectName("bigswitchvnsdevice");
                response.setResponseName(getCommandName());
                this.setResponseObject(response);
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

        List<BigSwitchVnsDeviceVO> devices = _bigswitchVnsDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
        if (devices.isEmpty()) {
            s_logger.error("No BigSwitch Controller on physical network " + network.getPhysicalNetworkId());
            return false;
        }
        BigSwitchVnsDeviceVO bigswitchVnsDevice = devices.get(0);
        HostVO bigswitchVnsHost = _hostDao.findById(bigswitchVnsDevice.getHostId());

        CreateVnsPortCommand cmd = new CreateVnsPortCommand(BroadcastDomainType.getValue(network.getBroadcastUri()), vm.getUuid(), tenantId, nic.getName(), mac);
        CreateVnsPortAnswer answer = (CreateVnsPortAnswer)_agentMgr.easySend(bigswitchVnsHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

        List<BigSwitchVnsDeviceVO> devices = _bigswitchVnsDao.listByPhysicalNetwork(network.getPhysicalNetworkId());
        if (devices.isEmpty()) {
            s_logger.error("No BigSwitch Controller on physical network " + network.getPhysicalNetworkId());
            return false;
        }
        BigSwitchVnsDeviceVO bigswitchVnsDevice = devices.get(0);
        HostVO bigswitchVnsHost = _hostDao.findById(bigswitchVnsDevice.getHostId());

        DeleteVnsPortCommand cmd = new DeleteVnsPortCommand(BroadcastDomainType.getValue(network.getBroadcastUri()), vm.getUuid(), tenantId);
        DeleteVnsPortAnswer answer = (DeleteVnsPortAnswer)_agentMgr.easySend(bigswitchVnsHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

            final Host host = _resourceMgr.addHost(zoneId, resource, Host.Type.L2Networking, params);
            if (host != null) {
                return Transaction.execute(new TransactionCallback<BigSwitchVnsDeviceVO>() {
                    @Override
                    public BigSwitchVnsDeviceVO doInTransaction(TransactionStatus status) {
                        BigSwitchVnsDeviceVO bigswitchVnsDevice =
                            new BigSwitchVnsDeviceVO(host.getId(), physicalNetworkId, ntwkSvcProvider.getProviderName(), deviceName);
                        _bigswitchVnsDao.persist(bigswitchVnsDevice);

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

                        return bigswitchVnsDevice;
                    }
                });
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

    }

    @Override
    public boolean deleteBigSwitchVnsDevice(DeleteBigSwitchVnsDeviceCmd cmd) {
        Long bigswitchVnsDeviceId = cmd.getBigSwitchVnsDeviceId();
        BigSwitchVnsDeviceVO bigswitchVnsDevice = _bigswitchVnsDao.findById(bigswitchVnsDeviceId);
        if (bigswitchVnsDevice == null) {
            throw new InvalidParameterValueException("Could not find a BigSwitch Controller with id " + bigswitchVnsDevice);
        }

        // Find the physical network we work for
        Long physicalNetworkId = bigswitchVnsDevice.getPhysicalNetworkId();
        PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
        if (physicalNetwork != null) {
            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 BigSwitch Controller device can not be deleted as there are one or more "
                            + "logical networks provisioned by cloudstack.");
                    }
                }
            }
        }

        HostVO bigswitchHost = _hostDao.findById(bigswitchVnsDevice.getHostId());
        Long hostId = bigswitchHost.getId();

        //bigswitchHost.setResourceState(ResourceState.Maintenance);
        //_hostDao.update(hostId, bigswitchHost);
        _hostDao.remove(hostId);
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

        if (physicalNetworkId == null && bigswitchVnsDeviceId == null) {
            throw new InvalidParameterValueException("Either physical network Id or bigswitch device Id must be specified");
        }

        if (bigswitchVnsDeviceId != null) {
            BigSwitchVnsDeviceVO bigswitchVnsDevice = _bigswitchVnsDao.findById(bigswitchVnsDeviceId);
            if (bigswitchVnsDevice == null) {
                throw new InvalidParameterValueException("Could not find BigSwitch controller with id: " + bigswitchVnsDevice);
            }
            responseList.add(bigswitchVnsDevice);
        } else {
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

    /////////////////////////////////////////////////////

    @Override
    public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
        try {
            BigSwitchVnsDeviceVO bigswitchVnsDeviceVO = _bigswitchVnsElementService.addBigSwitchVnsDevice(this);
            if (bigswitchVnsDeviceVO != null) {
                BigSwitchVnsDeviceResponse response = _bigswitchVnsElementService.createBigSwitchVnsDeviceResponse(bigswitchVnsDeviceVO);
                response.setObjectName("bigswitchvnsdevice");
                response.setResponseName(getCommandName());
                this.setResponseObject(response);
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No BigSwitch Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        BigSwitchVnsDeviceVO bigswitchVnsDevice = devices.get(0);
        HostVO bigswitchVnsHost = _hostDao.findById(bigswitchVnsDevice.getHostId());

        CreateVnsPortCommand cmd = new CreateVnsPortCommand(
                BroadcastDomainType.getValue(network.getBroadcastUri()),
                vm.getUuid(),
                tenantId,
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

        if (devices.isEmpty()) {
            s_logger.error("No BigSwitch Controller on physical network "
                    + network.getPhysicalNetworkId());
            return false;
        }
        BigSwitchVnsDeviceVO bigswitchVnsDevice = devices.get(0);
        HostVO bigswitchVnsHost = _hostDao.findById(bigswitchVnsDevice.getHostId());

        DeleteVnsPortCommand cmd = new DeleteVnsPortCommand(
                BroadcastDomainType.getValue(network.getBroadcastUri()),
                vm.getUuid(),
                tenantId);
View Full Code Here

Examples of com.cloud.network.BigSwitchVnsDeviceVO

        List<BigSwitchVnsDeviceVO> devices = _bigswitchVnsDao.listByPhysicalNetwork(physicalNetworkId);
        if (devices.isEmpty()) {
            s_logger.error("No BigSwitch Controller on physical network " + physicalNetworkId);
            return null;
        }
        BigSwitchVnsDeviceVO bigswitchVnsDevice = devices.get(0);
        HostVO bigswitchVnsHost = _hostDao.findById(bigswitchVnsDevice.getHostId());
        _hostDao.loadDetails(bigswitchVnsHost);

        CreateVnsNetworkCommand cmd = new CreateVnsNetworkCommand(networkUuid, name, tenantId, vlan);
        CreateVnsNetworkAnswer answer = (CreateVnsNetworkAnswer) _agentMgr.easySend(bigswitchVnsHost.getId(), cmd);
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.