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

This reverts commit 90600f1bdf.
This commit is contained in:
Daan Hoogland 2014-05-08 11:32:20 +02:00
parent 882bf079fa
commit 9450205f77
2 changed files with 6 additions and 6 deletions

View File

@ -3977,9 +3977,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 != 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());
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());
}
}

View File

@ -1588,9 +1588,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";
/* 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);
privateNtwk =
_ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null, gateway, netmask,
gatewayOwnerId, vpcId, 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);