Package com.cloud.network.vpc

Examples of com.cloud.network.vpc.Vpc


    private void createSite2SiteVpnCfgCommands(Site2SiteVpnConnection conn, boolean isCreate, VirtualRouter router, Commands cmds) {
        Site2SiteCustomerGatewayVO gw = _s2sCustomerGatewayDao.findById(conn.getCustomerGatewayId());
        Site2SiteVpnGatewayVO vpnGw = _s2sVpnGatewayDao.findById(conn.getVpnGatewayId());
        IpAddress ip = _ipAddressDao.findById(vpnGw.getAddrId());
        Vpc vpc = _vpcDao.findById(ip.getVpcId());
        String localPublicIp = ip.getAddress().toString();
        String localGuestCidr = vpc.getCidr();
        String localPublicGateway = _vlanDao.findById(ip.getVlanId()).getVlanGateway();
        String peerGatewayIp = gw.getGatewayIp();
        String peerGuestCidrList = gw.getGuestCidrList();
        String ipsecPsk = gw.getIpsecPsk();
        String ikePolicy = gw.getIkePolicy();
View Full Code Here


        return true;
    }

    @Override
    public String[] applyVpnUsers(RemoteAccessVpn vpn, List<? extends VpnUser> users, VirtualRouter router) throws ResourceUnavailableException {
        Vpc vpc = _vpcDao.findById(vpn.getVpcId());

        if (router.getState() != State.Running) {
            s_logger.warn("Failed to add/remove Remote Access VPN users: router not in running state");
            throw new ResourceUnavailableException("Failed to add/remove Remote Access VPN users: router not in running state: " + router.getState(), DataCenter.class,
                vpc.getZoneId());
        }

        Commands cmds = new Commands(Command.OnError.Continue);

        createApplyVpnUsersCommand(users, router, cmds);
View Full Code Here

    @Override
    protected String getVpnCidr(RemoteAccessVpn vpn) {
        if (vpn.getVpcId() == null) {
            return super.getVpnCidr(vpn);
        }
        Vpc vpc = _vpcDao.findById(vpn.getVpcId());
        return vpc.getCidr();
    }
View Full Code Here

       if (vpcId == null) {
           s_logger.warn("Network " + network + " is not associated with any VPC");
           return false;
       }
      
       Vpc vpc = _vpcMgr.getActiveVpc(vpcId);
       if (vpc == null) {
           s_logger.warn("Unable to find Enabled VPC by id " + vpcId);
           return false;
       }
      
       Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1);
       params.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
      
       List<DomainRouterVO> routers = _vpcRouterMgr.deployVirtualRouterInVpc(vpc, dest, _accountMgr.getAccount(vpc.getAccountId()), params);
       if ((routers == null) || (routers.size() == 0)) {
           throw new ResourceUnavailableException("Can't find at least one running router!",
                   DataCenter.class, network.getDataCenterId());
       }
      
View Full Code Here

        if (vpcId == null) {
            s_logger.warn("Network " + network + " is not associated with any VPC");
            return false;
        }
       
        Vpc vpc = _vpcMgr.getActiveVpc(vpcId);
        if (vpc == null) {
            s_logger.warn("Unable to find Enabled VPC by id " + vpcId);
            return false;
        }
       
        if (vm.getType() == Type.User) {
            Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1);
            params.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
            List<DomainRouterVO> routers = _vpcRouterMgr.deployVirtualRouterInVpc(vpc, dest,
                    _accountMgr.getAccount(vpc.getAccountId()), params);
            if ((routers == null) || (routers.size() == 0)) {
                throw new ResourceUnavailableException("Can't find at least one running router!",
                        DataCenter.class, network.getDataCenterId());
            }
           
View Full Code Here

            s_logger.error("try to start site 2 site vpn on unsupported network element?");
            return false;
        }
       
        Long vpcId = ip.getVpcId();
        Vpc vpc = _vpcMgr.getVpc(vpcId);
       
        if (!_vpcMgr.vpcProviderEnabledInZone(vpc.getZoneId())) {
            throw new ResourceUnavailableException("VPC provider is not enabled in zone " + vpc.getZoneId(),
                    DataCenter.class, vpc.getZoneId());
        }

        List<DomainRouterVO> routers = _vpcMgr.getVpcRouters(ip.getVpcId());
        if (routers == null || routers.size() != 1) {
            throw new ResourceUnavailableException("Cannot enable site-to-site VPN on the backend; virtual router doesn't exist in the vpc " + ip.getVpcId(),
                    DataCenter.class, vpc.getZoneId());
        }

        return _vpcRouterMgr.startSite2SiteVpn(conn, routers.get(0));
    }
View Full Code Here

            s_logger.error("try to stop site 2 site vpn on unsupported network element?");
            return false;
        }
       
        Long vpcId = ip.getVpcId();
        Vpc vpc = _vpcMgr.getVpc(vpcId);
       
        if (!_vpcMgr.vpcProviderEnabledInZone(vpc.getZoneId())) {
            throw new ResourceUnavailableException("VPC provider is not enabled in zone " + vpc.getZoneId(),
                    DataCenter.class, vpc.getZoneId());
        }

        List<DomainRouterVO> routers = _vpcMgr.getVpcRouters(ip.getVpcId());
        if (routers == null || routers.size() != 1) {
            throw new ResourceUnavailableException("Cannot enable site-to-site VPN on the backend; virtual router doesn't exist in the vpc " + ip.getVpcId(),
                    DataCenter.class, vpc.getZoneId());
        }

        return _vpcRouterMgr.stopSite2SiteVpn(conn, routers.get(0));
    }
View Full Code Here

        return networkId;
    }

    @Override
    public long getEntityOwnerId() {
        Vpc vpc = _vpcService.getVpc(getVpcId());
        if (vpc == null) {
            throw new InvalidParameterValueException("Invalid vpcId is given");
        }

        Account account = _accountService.getAccount(vpc.getAccountId());
        return account.getId();
    }
View Full Code Here

        return account.getId();
    }

    @Override
    public long getDomainId() {
        Vpc vpc = _vpcService.getVpc(getVpcId());
        return vpc.getDomainId();
    }
View Full Code Here

        return ("Createing Network ACL for Netowrk: " + network + " for protocol:" + this.getProtocol());
    }

    @Override
    public long getAccountId() {
        Vpc vpc = _vpcService.getVpc(getVpcId());
        return vpc.getAccountId();
    }
View Full Code Here

TOP

Related Classes of com.cloud.network.vpc.Vpc

Copyright © 2018 www.massapicom. 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.