CLOUDSTACK-7212: Failed creating LB rule on public port 8081 for VR as LB provider

This commit is contained in:
Jayapal 2014-08-01 12:35:45 +05:30
parent 79fcbd4a59
commit d28da9d986
4 changed files with 14 additions and 0 deletions

View File

@ -323,6 +323,8 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements L
} catch (InsufficientAddressCapacityException e) {
s_logger.warn("Exception: ", e);
throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, e.getMessage());
} catch (InvalidParameterValueException e) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.getMessage());
}
}

View File

@ -25,6 +25,7 @@ import java.util.Set;
import javax.ejb.Local;
import javax.inject.Inject;
import com.cloud.utils.net.NetUtils;
import org.apache.log4j.Logger;
import com.google.gson.Gson;
@ -303,6 +304,11 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
public static boolean validateHAProxyLBRule(LoadBalancingRule rule) {
String timeEndChar = "dhms";
if (rule.getSourcePortStart() == NetUtils.HAPROXY_STATS_PORT) {
s_logger.debug("Can't create LB on port 8081, haproxy is listening for LB stats on this port");
return false;
}
for (LbStickinessPolicy stickinessPolicy : rule.getStickinessPolicies()) {
List<Pair<String, String>> paramsList = stickinessPolicy.getParams();

View File

@ -1637,6 +1637,11 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
if (ex instanceof NetworkRuleConflictException) {
throw (NetworkRuleConflictException)ex;
}
if (ex instanceof InvalidParameterValueException) {
throw (InvalidParameterValueException)ex;
}
} finally {
if (result == null && systemIp != null) {
s_logger.debug("Releasing system IP address " + systemIp + " as corresponding lb rule failed to create");

View File

@ -58,6 +58,7 @@ public class NetUtils {
public final static int VPN_PORT = 500;
public final static int VPN_NATT_PORT = 4500;
public final static int VPN_L2TP_PORT = 1701;
public final static int HAPROXY_STATS_PORT = 8081;
public final static String UDP_PROTO = "udp";
public final static String TCP_PROTO = "tcp";