mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.14'
This commit is contained in:
commit
a8b4d9d0e1
@ -29,6 +29,8 @@ import java.util.Set;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import com.cloud.offerings.NetworkOfferingServiceMapVO;
|
||||||
|
import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
|
||||||
import org.apache.cloudstack.api.ApiConstants;
|
import org.apache.cloudstack.api.ApiConstants;
|
||||||
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd;
|
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd;
|
||||||
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
|
import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
|
||||||
@ -209,6 +211,8 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||||||
@Inject
|
@Inject
|
||||||
NetworkDao _networkDao;
|
NetworkDao _networkDao;
|
||||||
@Inject
|
@Inject
|
||||||
|
NetworkOfferingServiceMapDao _networkOfferingServiceDao;
|
||||||
|
@Inject
|
||||||
FirewallRulesDao _firewallDao;
|
FirewallRulesDao _firewallDao;
|
||||||
@Inject
|
@Inject
|
||||||
DomainService _domainMgr;
|
DomainService _domainMgr;
|
||||||
@ -260,6 +264,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||||||
@Inject
|
@Inject
|
||||||
NicSecondaryIpDao _nicSecondaryIpDao;
|
NicSecondaryIpDao _nicSecondaryIpDao;
|
||||||
|
|
||||||
|
private static final int DNS_PORT = 53;
|
||||||
// Will return a string. For LB Stickiness this will be a json, for
|
// Will return a string. For LB Stickiness this will be a json, for
|
||||||
// autoscale this will be "," separated values
|
// autoscale this will be "," separated values
|
||||||
@Override
|
@Override
|
||||||
@ -1598,9 +1603,18 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||||||
// LoadBalancer result = _elbMgr.handleCreateLoadBalancerRule(lb,
|
// LoadBalancer result = _elbMgr.handleCreateLoadBalancerRule(lb,
|
||||||
// lbOwner, lb.getNetworkId());
|
// lbOwner, lb.getNetworkId());
|
||||||
LoadBalancer result = null;
|
LoadBalancer result = null;
|
||||||
if (result == null) {
|
|
||||||
IpAddress systemIp = null;
|
IpAddress systemIp = null;
|
||||||
NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
|
NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
|
||||||
|
|
||||||
|
if (srcPortStart == DNS_PORT && ipVO.isSourceNat()) {
|
||||||
|
List<NetworkOfferingServiceMapVO> offeringServices = _networkOfferingServiceDao.listByNetworkOfferingId(network.getNetworkOfferingId());
|
||||||
|
for (NetworkOfferingServiceMapVO serviceMapVo: offeringServices) {
|
||||||
|
if (serviceMapVo.getService().equals(Service.Dns.getName())) {
|
||||||
|
throw new InvalidParameterValueException("Error adding load balancer rule, cannot add port 53 with network service offering having DNS service and Source NAT.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (off.isElasticLb() && ipVO == null && network.getVpcId() == null) {
|
if (off.isElasticLb() && ipVO == null && network.getVpcId() == null) {
|
||||||
systemIp = _ipAddrMgr.assignSystemIp(networkId, lbOwner, true, false);
|
systemIp = _ipAddrMgr.assignSystemIp(networkId, lbOwner, true, false);
|
||||||
if (systemIp != null) {
|
if (systemIp != null) {
|
||||||
@ -1658,7 +1672,6 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
|
|||||||
_vpcMgr.unassignIPFromVpcNetwork(ipVO.getId(), networkId);
|
_vpcMgr.unassignIPFromVpcNetwork(ipVO.getId(), networkId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw new CloudRuntimeException("Failed to create load balancer rule: " + name);
|
throw new CloudRuntimeException("Failed to create load balancer rule: " + name);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user