Merge remote-tracking branch 'apache/4.17' into 4.18

This commit is contained in:
Abhishek Kumar 2023-04-19 12:36:10 +05:30
commit 41bbedb530
1 changed files with 5 additions and 3 deletions

View File

@ -4411,12 +4411,14 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
}
vlanOwnerId = vlanOwner.getAccountId();
// Verify physical network isolation type is VLAN
// Verify physical network isolation methods contain VLAN or VXLAN
PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
if (physicalNetwork == null) {
throw new InvalidParameterValueException("Unable to find physical network by id " + physicalNetworkId);
} else if (!physicalNetwork.getIsolationMethods().isEmpty() && !physicalNetwork.getIsolationMethods().contains("VLAN")) {
throw new InvalidParameterValueException("Cannot dedicate guest vlan range. " + "Physical isolation type of network " + physicalNetworkId + " is not VLAN");
} else if (!physicalNetwork.getIsolationMethods().isEmpty() &&
!physicalNetwork.getIsolationMethods().contains("VLAN") &&
!physicalNetwork.getIsolationMethods().contains("VXLAN")) {
throw new InvalidParameterValueException("Cannot dedicate guest vlan range. " + "Physical isolation type of network " + physicalNetworkId + " is not VLAN nor VXLAN");
}
// Get the start and end vlan