Skip to content

Commit fb061dd

Browse files
Pearl1594dhslove
authored andcommitted
Allow creation of Shared Networks without IP range if network offering has no services - specifyvlan = true (apache#10168)
1 parent 6850026 commit fb061dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,6 +1779,10 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
17791779
throwInvalidIdException("Network offering with specified id doesn't support adding multiple ip ranges", ntwkOff.getUuid(), NETWORK_OFFERING_ID);
17801780
}
17811781

1782+
if (GuestType.Shared == ntwkOff.getGuestType() && !ntwkOff.isSpecifyVlan() && Objects.isNull(associatedNetworkId)) {
1783+
throw new CloudRuntimeException("Associated network must be provided when creating Shared networks when specifyVlan is false");
1784+
}
1785+
17821786
Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId());
17831787
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu, privateMtu);
17841788

0 commit comments

Comments
 (0)