Search in sources :

Example 16 with RuleApplier

use of com.cloud.network.rules.RuleApplier in project cloudstack by apache.

the class BasicNetworkTopology method applyUserData.

@Override
public boolean applyUserData(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final DomainRouterVO router) throws ResourceUnavailableException {
    s_logger.debug("APPLYING USERDATA RULES");
    final String typeString = "userdata and password entry";
    final Long podId = dest.getPod().getId();
    boolean isPodLevelException = false;
    if (podId != null && profile.getVirtualMachine().getType() == VirtualMachine.Type.User && network.getTrafficType() == TrafficType.Guest && network.getGuestType() == Network.GuestType.Shared) {
        isPodLevelException = true;
    }
    final boolean failWhenDisconnect = false;
    final UserdataPwdRules pwdRules = new UserdataPwdRules(network, nic, profile, dest);
    return applyRules(network, router, typeString, isPodLevelException, podId, failWhenDisconnect, new RuleApplierWrapper<RuleApplier>(pwdRules));
}
Also used : UserdataPwdRules(com.cloud.network.rules.UserdataPwdRules) RuleApplier(com.cloud.network.rules.RuleApplier)

Example 17 with RuleApplier

use of com.cloud.network.rules.RuleApplier in project cloudstack by apache.

the class AdvancedNetworkTopology method applyUserData.

@Override
public boolean applyUserData(final Network network, final NicProfile nic, final VirtualMachineProfile profile, final DeployDestination dest, final DomainRouterVO router) throws ResourceUnavailableException {
    s_logger.debug("APPLYING VPC USERDATA RULES");
    final String typeString = "userdata and password entry";
    final boolean isPodLevelException = false;
    final boolean failWhenDisconnect = false;
    final Long podId = null;
    final UserdataPwdRules pwdRules = new UserdataPwdRules(network, nic, profile, dest);
    return applyRules(network, router, typeString, isPodLevelException, podId, failWhenDisconnect, new RuleApplierWrapper<RuleApplier>(pwdRules));
}
Also used : UserdataPwdRules(com.cloud.network.rules.UserdataPwdRules) RuleApplier(com.cloud.network.rules.RuleApplier)

Aggregations

RuleApplier (com.cloud.network.rules.RuleApplier)17 DhcpEntryRules (com.cloud.network.rules.DhcpEntryRules)4 DataCenter (com.cloud.dc.DataCenter)2 Pod (com.cloud.dc.Pod)2 AgentUnavailableException (com.cloud.exception.AgentUnavailableException)2 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)2 VirtualRouter (com.cloud.network.router.VirtualRouter)2 UserdataPwdRules (com.cloud.network.rules.UserdataPwdRules)2 ArrayList (java.util.ArrayList)2 FirewallRules (com.cloud.network.rules.FirewallRules)1 IpAssociationRules (com.cloud.network.rules.IpAssociationRules)1 LoadBalancingRules (com.cloud.network.rules.LoadBalancingRules)1 NetworkAclsRules (com.cloud.network.rules.NetworkAclsRules)1 NicPlugInOutRules (com.cloud.network.rules.NicPlugInOutRules)1 PasswordToRouterRules (com.cloud.network.rules.PasswordToRouterRules)1 SshKeyToRouterRules (com.cloud.network.rules.SshKeyToRouterRules)1 StaticNatRules (com.cloud.network.rules.StaticNatRules)1 UserdataToRouterRules (com.cloud.network.rules.UserdataToRouterRules)1 VpcIpAssociationRules (com.cloud.network.rules.VpcIpAssociationRules)1