Skip to content

Commit 9450205

Browse files
committed
Revert "CLOUDSTACK-6485: private gateway network should not be associated with vpc"
This reverts commit 90600f1.
1 parent 882bf07 commit 9450205

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎server/src/com/cloud/network/NetworkServiceImpl.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3977,9 +3977,9 @@ public Network doInTransaction(TransactionStatus status) throws ResourceAllocati
39773977
} else {
39783978
s_logger.debug("Private network already exists: " + privateNetwork);
39793979
//Do not allow multiple private gateways with same Vlan within a VPC
3980-
if (vpcId != null && vpcId.equals(privateNetwork.getVpcId())) {
3981-
throw new InvalidParameterValueException("Private network for the vlan: " + uriString + " and cidr " + cidr + " already exists " + "for Vpc " + vpcId
3982-
+ " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
3980+
if (vpcId.equals(privateNetwork.getVpcId())) {
3981+
throw new InvalidParameterValueException("Private network for the vlan: " + uriString + " and cidr " + cidr + " already exists " + "for Vpc " + vpcId
3982+
+ " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName());
39833983
}
39843984
}
39853985

‎server/src/com/cloud/network/vpc/VpcManagerImpl.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,9 +1588,9 @@ public VpcGatewayVO doInTransaction(TransactionStatus status) throws ResourceAll
15881588
if (privateNtwk == null) {
15891589
s_logger.info("creating new network for vpc " + vpc + " using broadcast uri: " + broadcastUri);
15901590
String networkName = "vpc-" + vpc.getName() + "-privateNetwork";
1591-
/* vpcid should not be set on the new network as it is not part of the vpc but an outside net */
1592-
privateNtwk = _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null,
1593-
gateway, netmask, gatewayOwnerId, null, isSourceNat, networkOfferingId);
1591+
privateNtwk =
1592+
_ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null, gateway, netmask,
1593+
gatewayOwnerId, vpcId, isSourceNat, networkOfferingId);
15941594
} else { // create the nic/ip as createPrivateNetwork doesn''t do that work for us now
15951595
s_logger.info("found and using existing network for vpc " + vpc + ": " + broadcastUri);
15961596
DataCenterVO dc = _dcDao.lockRow(physNetFinal.getDataCenterId(), true);

0 commit comments

Comments
 (0)