Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
}

Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId());
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu, privateMtu);
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu);

Network associatedNetwork = null;
if (associatedNetworkId != null) {
Expand Down Expand Up @@ -1894,15 +1894,15 @@ private NetworkOffering getAndValidateNetworkOffering(Long networkOfferingId) {
return ntwkOff;
}

protected void mtuCheckForVpcNetwork(Long vpcId, Pair<Integer, Integer> interfaceMTUs, Integer publicMtu, Integer privateMtu) {
protected void mtuCheckForVpcNetwork(Long vpcId, Pair<Integer, Integer> interfaceMTUs, Integer publicMtu) {
if (vpcId != null && publicMtu != null) {
VpcVO vpc = _vpcDao.findById(vpcId);
if (vpc == null) {
throw new CloudRuntimeException(String.format("VPC with id %s not found", vpcId));
}
s_logger.warn(String.format("VPC public MTU already set at VPC creation phase to: %s. Ignoring public MTU " +
"passed during VPC network tier creation ", vpc.getPublicMtu()));
interfaceMTUs.set(vpc.getPublicMtu(), privateMtu);
interfaceMTUs.set(vpc.getPublicMtu(), interfaceMTUs.second());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public void testUpdatePublicInterfaceMtuViaNetworkTiersForVpcNetworks() {
Mockito.when(vpcVO.getPublicMtu()).thenReturn(vpcMtu);

Pair<Integer, Integer> updatedMtus = service.validateMtuConfig(publicMtu, privateMtu, zoneId);
service.mtuCheckForVpcNetwork(vpcId, updatedMtus, publicMtu, privateMtu);
service.mtuCheckForVpcNetwork(vpcId, updatedMtus, publicMtu);
Assert.assertEquals(vpcMtu, updatedMtus.first());
Assert.assertEquals(privateMtu, updatedMtus.second());
}
Expand Down
Loading