Search in sources :

Example 6 with RouterDeploymentDefinition

use of org.cloud.network.router.deployment.RouterDeploymentDefinition in project cloudstack by apache.

the class VpcVirtualRouterElement method implementVpc.

@Override
public boolean implementVpc(final Vpc vpc, final DeployDestination dest, final ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
    final Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1);
    params.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
    final RouterDeploymentDefinition routerDeploymentDefinition = routerDeploymentDefinitionBuilder.create().setVpc(vpc).setDeployDestination(dest).setAccountOwner(_accountMgr.getAccount(vpc.getAccountId())).setParams(params).build();
    routerDeploymentDefinition.deployVirtualRouter();
    return true;
}
Also used : RouterDeploymentDefinition(org.cloud.network.router.deployment.RouterDeploymentDefinition) HashMap(java.util.HashMap) VirtualMachineProfile(com.cloud.vm.VirtualMachineProfile)

Aggregations

RouterDeploymentDefinition (org.cloud.network.router.deployment.RouterDeploymentDefinition)6 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)5 DomainRouterVO (com.cloud.vm.DomainRouterVO)5 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)4 HashMap (java.util.HashMap)4 Vpc (com.cloud.network.vpc.Vpc)3 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)1 InsufficientCapacityException (com.cloud.exception.InsufficientCapacityException)1 NetworkOfferingVO (com.cloud.offerings.NetworkOfferingVO)1