CLOUDSTACK-6485: private gateway network should not be associated with vpc

Signed-off-by: Daan Hoogland <daan@onecht.net>
This commit is contained in:
Daan Hoogland 2014-04-19 02:25:41 +02:00
parent b9c136d9aa
commit 90600f1bdf
2 changed files with 6 additions and 6 deletions

View File

@ -3781,9 +3781,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
} else {
s_logger.debug("Private network already exists: " + privateNetwork);
//Do not allow multiple private gateways with same Vlan within a VPC
if (vpcId.equals(privateNetwork.getVpcId())) {
throw new InvalidParameterValueException("Private network for the vlan: " + uriString + " and cidr " + cidr + " already exists " + "for Vpc " + vpcId
+ " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
if (vpcId != null && vpcId.equals(privateNetwork.getVpcId())) {
throw new InvalidParameterValueException("Private network for the vlan: " + uriString + " and cidr " + cidr + " already exists " + "for Vpc " + vpcId
+ " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
}
}

View File

@ -1590,9 +1590,9 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
if (privateNtwk == null) {
s_logger.info("creating new network for vpc " + vpc + " using broadcast uri: " + broadcastUri);
String networkName = "vpc-" + vpc.getName() + "-privateNetwork";
privateNtwk =
_ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null, gateway, netmask,
gatewayOwnerId, vpcId, isSourceNat, networkOfferingId);
/* vpcid should not be set on the new network as it is not part of the vpc but an outside net */
privateNtwk = _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null,
gateway, netmask, gatewayOwnerId, null, isSourceNat, networkOfferingId);
} else { // create the nic/ip as createPrivateNetwork doesn''t do that work for us now
s_logger.info("found and using existing network for vpc " + vpc + ": " + broadcastUri);
DataCenterVO dc = _dcDao.lockRow(physNetFinal.getDataCenterId(), true);