mirror of https://github.com/apache/cloudstack.git
Internallb:
1) InternalLb and PublicLb can't be enabled on the same network offering 2) Can have internalLb only on VPC tier
This commit is contained in:
parent
d73ca7ef73
commit
7680e1cc10
|
|
@ -39,7 +39,6 @@ import javax.naming.NamingException;
|
|||
import javax.naming.directory.DirContext;
|
||||
import javax.naming.directory.InitialDirContext;
|
||||
|
||||
import com.cloud.dc.dao.*;
|
||||
import org.apache.cloudstack.acl.SecurityChecker;
|
||||
import org.apache.cloudstack.api.ApiConstants.LDAPParams;
|
||||
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
|
||||
|
|
@ -86,6 +85,15 @@ import com.cloud.dc.PodVlanMapVO;
|
|||
import com.cloud.dc.Vlan;
|
||||
import com.cloud.dc.Vlan.VlanType;
|
||||
import com.cloud.dc.VlanVO;
|
||||
import com.cloud.dc.dao.AccountVlanMapDao;
|
||||
import com.cloud.dc.dao.ClusterDao;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.dc.dao.DataCenterIpAddressDao;
|
||||
import com.cloud.dc.dao.DataCenterLinkLocalIpAddressDao;
|
||||
import com.cloud.dc.dao.DcDetailsDao;
|
||||
import com.cloud.dc.dao.HostPodDao;
|
||||
import com.cloud.dc.dao.PodVlanMapDao;
|
||||
import com.cloud.dc.dao.VlanDao;
|
||||
import com.cloud.deploy.DataCenterDeployment;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.domain.DomainVO;
|
||||
|
|
@ -3633,6 +3641,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//in the current version of the code, publicLb and specificLb can't both be set to true for the same network offering
|
||||
if (publicLb && internalLb) {
|
||||
throw new InvalidParameterValueException("Public lb and internal lb can't be enabled at the same time on the offering");
|
||||
}
|
||||
|
||||
Map<Capability, String> sourceNatServiceCapabilityMap = serviceCapabilityMap.get(Service.SourceNat);
|
||||
if ((sourceNatServiceCapabilityMap != null) && (!sourceNatServiceCapabilityMap.isEmpty())) {
|
||||
|
|
@ -3977,6 +3990,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
public boolean isOfferingForVpc(NetworkOffering offering) {
|
||||
boolean vpcProvider = _ntwkOffServiceMapDao.isProviderForNetworkOffering(offering.getId(),
|
||||
Provider.VPCVirtualRouter);
|
||||
boolean internalLb = offering.getInternalLb();
|
||||
return vpcProvider;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1166,6 +1166,10 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
|
|||
if (_configMgr.isOfferingForVpc(ntwkOff)){
|
||||
throw new InvalidParameterValueException("Network offering can be used for VPC networks only");
|
||||
}
|
||||
if (ntwkOff.getInternalLb()) {
|
||||
throw new InvalidParameterValueException("Internal Lb can be enabled on vpc networks only");
|
||||
}
|
||||
|
||||
network = _networkMgr.createGuestNetwork(networkOfferingId, name, displayText, gateway, cidr, vlanId,
|
||||
networkDomain, owner, sharedDomainId, pNtwk, zoneId, aclType, subdomainAccess, vpcId, ip6Gateway, ip6Cidr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue