CLOUDSTACK-9618: Load Balancer configuration page does not have "Source" method in the drop down list

Added the source method to supported algorithm list in Netscaler element.
Added a validation check.
This commit is contained in:
Nitin Kumar Maharana 2016-12-06 13:57:21 +05:30
parent 13bfdd71e6
commit 3dc0eed71d

View File

@ -232,6 +232,10 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl
@Override
public boolean validateLBRule(Network network, LoadBalancingRule rule) {
if (canHandle(network, Service.Lb)) {
String algo = rule.getAlgorithm();
return (algo.equals("roundrobin") || algo.equals("leastconn") || algo.equals("source"));
}
return true;
}
@ -260,7 +264,7 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl
Map<Capability, String> lbCapabilities = new HashMap<Capability, String>();
// Specifies that the RoundRobin and Leastconn algorithms are supported for load balancing rules
lbCapabilities.put(Capability.SupportedLBAlgorithms, "roundrobin,leastconn");
lbCapabilities.put(Capability.SupportedLBAlgorithms, "roundrobin, leastconn, source");
// specifies that Netscaler network element can provided both shared and isolation modes
lbCapabilities.put(Capability.SupportedLBIsolation, "dedicated, shared");